Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1033 lines
30 KiB

  1. {
  2. "formatVersion": 1,
  3. "database": {
  4. "version": 23,
  5. "identityHash": "50f45495091ca49a0bcaa5fc9f827604",
  6. "entities": [
  7. {
  8. "tableName": "identity",
  9. "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT NOT NULL, `email` TEXT NOT NULL, `replyto` TEXT, `account` INTEGER NOT NULL, `host` TEXT NOT NULL, `starttls` INTEGER NOT NULL, `insecure` INTEGER NOT NULL, `port` INTEGER NOT NULL, `user` TEXT NOT NULL, `password` TEXT NOT NULL, `auth_type` INTEGER NOT NULL, `primary` INTEGER NOT NULL, `synchronize` INTEGER NOT NULL, `store_sent` INTEGER NOT NULL, `state` TEXT, `error` TEXT, FOREIGN KEY(`account`) REFERENCES `account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
  10. "fields": [
  11. {
  12. "fieldPath": "id",
  13. "columnName": "id",
  14. "affinity": "INTEGER",
  15. "notNull": false
  16. },
  17. {
  18. "fieldPath": "name",
  19. "columnName": "name",
  20. "affinity": "TEXT",
  21. "notNull": true
  22. },
  23. {
  24. "fieldPath": "email",
  25. "columnName": "email",
  26. "affinity": "TEXT",
  27. "notNull": true
  28. },
  29. {
  30. "fieldPath": "replyto",
  31. "columnName": "replyto",
  32. "affinity": "TEXT",
  33. "notNull": false
  34. },
  35. {
  36. "fieldPath": "account",
  37. "columnName": "account",
  38. "affinity": "INTEGER",
  39. "notNull": true
  40. },
  41. {
  42. "fieldPath": "host",
  43. "columnName": "host",
  44. "affinity": "TEXT",
  45. "notNull": true
  46. },
  47. {
  48. "fieldPath": "starttls",
  49. "columnName": "starttls",
  50. "affinity": "INTEGER",
  51. "notNull": true
  52. },
  53. {
  54. "fieldPath": "insecure",
  55. "columnName": "insecure",
  56. "affinity": "INTEGER",
  57. "notNull": true
  58. },
  59. {
  60. "fieldPath": "port",
  61. "columnName": "port",
  62. "affinity": "INTEGER",
  63. "notNull": true
  64. },
  65. {
  66. "fieldPath": "user",
  67. "columnName": "user",
  68. "affinity": "TEXT",
  69. "notNull": true
  70. },
  71. {
  72. "fieldPath": "password",
  73. "columnName": "password",
  74. "affinity": "TEXT",
  75. "notNull": true
  76. },
  77. {
  78. "fieldPath": "auth_type",
  79. "columnName": "auth_type",
  80. "affinity": "INTEGER",
  81. "notNull": true
  82. },
  83. {
  84. "fieldPath": "primary",
  85. "columnName": "primary",
  86. "affinity": "INTEGER",
  87. "notNull": true
  88. },
  89. {
  90. "fieldPath": "synchronize",
  91. "columnName": "synchronize",
  92. "affinity": "INTEGER",
  93. "notNull": true
  94. },
  95. {
  96. "fieldPath": "store_sent",
  97. "columnName": "store_sent",
  98. "affinity": "INTEGER",
  99. "notNull": true
  100. },
  101. {
  102. "fieldPath": "state",
  103. "columnName": "state",
  104. "affinity": "TEXT",
  105. "notNull": false
  106. },
  107. {
  108. "fieldPath": "error",
  109. "columnName": "error",
  110. "affinity": "TEXT",
  111. "notNull": false
  112. }
  113. ],
  114. "primaryKey": {
  115. "columnNames": [
  116. "id"
  117. ],
  118. "autoGenerate": true
  119. },
  120. "indices": [
  121. {
  122. "name": "index_identity_account",
  123. "unique": false,
  124. "columnNames": [
  125. "account"
  126. ],
  127. "createSql": "CREATE INDEX `index_identity_account` ON `${TABLE_NAME}` (`account`)"
  128. }
  129. ],
  130. "foreignKeys": [
  131. {
  132. "table": "account",
  133. "onDelete": "CASCADE",
  134. "onUpdate": "NO ACTION",
  135. "columns": [
  136. "account"
  137. ],
  138. "referencedColumns": [
  139. "id"
  140. ]
  141. }
  142. ]
  143. },
  144. {
  145. "tableName": "account",
  146. "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT, `signature` TEXT, `host` TEXT NOT NULL, `starttls` INTEGER NOT NULL, `insecure` INTEGER NOT NULL, `port` INTEGER NOT NULL, `user` TEXT NOT NULL, `password` TEXT NOT NULL, `auth_type` INTEGER NOT NULL, `synchronize` INTEGER NOT NULL, `primary` INTEGER NOT NULL, `color` INTEGER, `store_sent` INTEGER NOT NULL, `poll_interval` INTEGER NOT NULL, `seen_until` INTEGER, `state` TEXT, `error` TEXT)",
  147. "fields": [
  148. {
  149. "fieldPath": "id",
  150. "columnName": "id",
  151. "affinity": "INTEGER",
  152. "notNull": false
  153. },
  154. {
  155. "fieldPath": "name",
  156. "columnName": "name",
  157. "affinity": "TEXT",
  158. "notNull": false
  159. },
  160. {
  161. "fieldPath": "signature",
  162. "columnName": "signature",
  163. "affinity": "TEXT",
  164. "notNull": false
  165. },
  166. {
  167. "fieldPath": "host",
  168. "columnName": "host",
  169. "affinity": "TEXT",
  170. "notNull": true
  171. },
  172. {
  173. "fieldPath": "starttls",
  174. "columnName": "starttls",
  175. "affinity": "INTEGER",
  176. "notNull": true
  177. },
  178. {
  179. "fieldPath": "insecure",
  180. "columnName": "insecure",
  181. "affinity": "INTEGER",
  182. "notNull": true
  183. },
  184. {
  185. "fieldPath": "port",
  186. "columnName": "port",
  187. "affinity": "INTEGER",
  188. "notNull": true
  189. },
  190. {
  191. "fieldPath": "user",
  192. "columnName": "user",
  193. "affinity": "TEXT",
  194. "notNull": true
  195. },
  196. {
  197. "fieldPath": "password",
  198. "columnName": "password",
  199. "affinity": "TEXT",
  200. "notNull": true
  201. },
  202. {
  203. "fieldPath": "auth_type",
  204. "columnName": "auth_type",
  205. "affinity": "INTEGER",
  206. "notNull": true
  207. },
  208. {
  209. "fieldPath": "synchronize",
  210. "columnName": "synchronize",
  211. "affinity": "INTEGER",
  212. "notNull": true
  213. },
  214. {
  215. "fieldPath": "primary",
  216. "columnName": "primary",
  217. "affinity": "INTEGER",
  218. "notNull": true
  219. },
  220. {
  221. "fieldPath": "color",
  222. "columnName": "color",
  223. "affinity": "INTEGER",
  224. "notNull": false
  225. },
  226. {
  227. "fieldPath": "store_sent",
  228. "columnName": "store_sent",
  229. "affinity": "INTEGER",
  230. "notNull": true
  231. },
  232. {
  233. "fieldPath": "poll_interval",
  234. "columnName": "poll_interval",
  235. "affinity": "INTEGER",
  236. "notNull": true
  237. },
  238. {
  239. "fieldPath": "seen_until",
  240. "columnName": "seen_until",
  241. "affinity": "INTEGER",
  242. "notNull": false
  243. },
  244. {
  245. "fieldPath": "state",
  246. "columnName": "state",
  247. "affinity": "TEXT",
  248. "notNull": false
  249. },
  250. {
  251. "fieldPath": "error",
  252. "columnName": "error",
  253. "affinity": "TEXT",
  254. "notNull": false
  255. }
  256. ],
  257. "primaryKey": {
  258. "columnNames": [
  259. "id"
  260. ],
  261. "autoGenerate": true
  262. },
  263. "indices": [],
  264. "foreignKeys": []
  265. },
  266. {
  267. "tableName": "folder",
  268. "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `account` INTEGER, `name` TEXT NOT NULL, `type` TEXT NOT NULL, `synchronize` INTEGER NOT NULL, `poll_interval` INTEGER, `after` INTEGER NOT NULL, `display` TEXT, `hide` INTEGER NOT NULL, `unified` INTEGER NOT NULL, `state` TEXT, `error` TEXT, FOREIGN KEY(`account`) REFERENCES `account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
  269. "fields": [
  270. {
  271. "fieldPath": "id",
  272. "columnName": "id",
  273. "affinity": "INTEGER",
  274. "notNull": false
  275. },
  276. {
  277. "fieldPath": "account",
  278. "columnName": "account",
  279. "affinity": "INTEGER",
  280. "notNull": false
  281. },
  282. {
  283. "fieldPath": "name",
  284. "columnName": "name",
  285. "affinity": "TEXT",
  286. "notNull": true
  287. },
  288. {
  289. "fieldPath": "type",
  290. "columnName": "type",
  291. "affinity": "TEXT",
  292. "notNull": true
  293. },
  294. {
  295. "fieldPath": "synchronize",
  296. "columnName": "synchronize",
  297. "affinity": "INTEGER",
  298. "notNull": true
  299. },
  300. {
  301. "fieldPath": "poll_interval",
  302. "columnName": "poll_interval",
  303. "affinity": "INTEGER",
  304. "notNull": false
  305. },
  306. {
  307. "fieldPath": "after",
  308. "columnName": "after",
  309. "affinity": "INTEGER",
  310. "notNull": true
  311. },
  312. {
  313. "fieldPath": "display",
  314. "columnName": "display",
  315. "affinity": "TEXT",
  316. "notNull": false
  317. },
  318. {
  319. "fieldPath": "hide",
  320. "columnName": "hide",
  321. "affinity": "INTEGER",
  322. "notNull": true
  323. },
  324. {
  325. "fieldPath": "unified",
  326. "columnName": "unified",
  327. "affinity": "INTEGER",
  328. "notNull": true
  329. },
  330. {
  331. "fieldPath": "state",
  332. "columnName": "state",
  333. "affinity": "TEXT",
  334. "notNull": false
  335. },
  336. {
  337. "fieldPath": "error",
  338. "columnName": "error",
  339. "affinity": "TEXT",
  340. "notNull": false
  341. }
  342. ],
  343. "primaryKey": {
  344. "columnNames": [
  345. "id"
  346. ],
  347. "autoGenerate": true
  348. },
  349. "indices": [
  350. {
  351. "name": "index_folder_account_name",
  352. "unique": true,
  353. "columnNames": [
  354. "account",
  355. "name"
  356. ],
  357. "createSql": "CREATE UNIQUE INDEX `index_folder_account_name` ON `${TABLE_NAME}` (`account`, `name`)"
  358. },
  359. {
  360. "name": "index_folder_account",
  361. "unique": false,
  362. "columnNames": [
  363. "account"
  364. ],
  365. "createSql": "CREATE INDEX `index_folder_account` ON `${TABLE_NAME}` (`account`)"
  366. },
  367. {
  368. "name": "index_folder_name",
  369. "unique": false,
  370. "columnNames": [
  371. "name"
  372. ],
  373. "createSql": "CREATE INDEX `index_folder_name` ON `${TABLE_NAME}` (`name`)"
  374. },
  375. {
  376. "name": "index_folder_type",
  377. "unique": false,
  378. "columnNames": [
  379. "type"
  380. ],
  381. "createSql": "CREATE INDEX `index_folder_type` ON `${TABLE_NAME}` (`type`)"
  382. },
  383. {
  384. "name": "index_folder_unified",
  385. "unique": false,
  386. "columnNames": [
  387. "unified"
  388. ],
  389. "createSql": "CREATE INDEX `index_folder_unified` ON `${TABLE_NAME}` (`unified`)"
  390. }
  391. ],
  392. "foreignKeys": [
  393. {
  394. "table": "account",
  395. "onDelete": "CASCADE",
  396. "onUpdate": "NO ACTION",
  397. "columns": [
  398. "account"
  399. ],
  400. "referencedColumns": [
  401. "id"
  402. ]
  403. }
  404. ]
  405. },
  406. {
  407. "tableName": "message",
  408. "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `account` INTEGER, `folder` INTEGER NOT NULL, `identity` INTEGER, `replying` INTEGER, `uid` INTEGER, `msgid` TEXT, `references` TEXT, `deliveredto` TEXT, `inreplyto` TEXT, `thread` TEXT, `avatar` TEXT, `from` TEXT, `to` TEXT, `cc` TEXT, `bcc` TEXT, `reply` TEXT, `headers` TEXT, `subject` TEXT, `size` INTEGER, `content` INTEGER NOT NULL, `sent` INTEGER, `received` INTEGER NOT NULL, `stored` INTEGER NOT NULL, `seen` INTEGER NOT NULL, `flagged` INTEGER NOT NULL, `ui_seen` INTEGER NOT NULL, `ui_flagged` INTEGER NOT NULL, `ui_hide` INTEGER NOT NULL, `ui_found` INTEGER NOT NULL, `ui_ignored` INTEGER NOT NULL, `error` TEXT, FOREIGN KEY(`account`) REFERENCES `account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`folder`) REFERENCES `folder`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`identity`) REFERENCES `identity`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`replying`) REFERENCES `message`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
  409. "fields": [
  410. {
  411. "fieldPath": "id",
  412. "columnName": "id",
  413. "affinity": "INTEGER",
  414. "notNull": false
  415. },
  416. {
  417. "fieldPath": "account",
  418. "columnName": "account",
  419. "affinity": "INTEGER",
  420. "notNull": false
  421. },
  422. {
  423. "fieldPath": "folder",
  424. "columnName": "folder",
  425. "affinity": "INTEGER",
  426. "notNull": true
  427. },
  428. {
  429. "fieldPath": "identity",
  430. "columnName": "identity",
  431. "affinity": "INTEGER",
  432. "notNull": false
  433. },
  434. {
  435. "fieldPath": "replying",
  436. "columnName": "replying",
  437. "affinity": "INTEGER",
  438. "notNull": false
  439. },
  440. {
  441. "fieldPath": "uid",
  442. "columnName": "uid",
  443. "affinity": "INTEGER",
  444. "notNull": false
  445. },
  446. {
  447. "fieldPath": "msgid",
  448. "columnName": "msgid",
  449. "affinity": "TEXT",
  450. "notNull": false
  451. },
  452. {
  453. "fieldPath": "references",
  454. "columnName": "references",
  455. "affinity": "TEXT",
  456. "notNull": false
  457. },
  458. {
  459. "fieldPath": "deliveredto",
  460. "columnName": "deliveredto",
  461. "affinity": "TEXT",
  462. "notNull": false
  463. },
  464. {
  465. "fieldPath": "inreplyto",
  466. "columnName": "inreplyto",
  467. "affinity": "TEXT",
  468. "notNull": false
  469. },
  470. {
  471. "fieldPath": "thread",
  472. "columnName": "thread",
  473. "affinity": "TEXT",
  474. "notNull": false
  475. },
  476. {
  477. "fieldPath": "avatar",
  478. "columnName": "avatar",
  479. "affinity": "TEXT",
  480. "notNull": false
  481. },
  482. {
  483. "fieldPath": "from",
  484. "columnName": "from",
  485. "affinity": "TEXT",
  486. "notNull": false
  487. },
  488. {
  489. "fieldPath": "to",
  490. "columnName": "to",
  491. "affinity": "TEXT",
  492. "notNull": false
  493. },
  494. {
  495. "fieldPath": "cc",
  496. "columnName": "cc",
  497. "affinity": "TEXT",
  498. "notNull": false
  499. },
  500. {
  501. "fieldPath": "bcc",
  502. "columnName": "bcc",
  503. "affinity": "TEXT",
  504. "notNull": false
  505. },
  506. {
  507. "fieldPath": "reply",
  508. "columnName": "reply",
  509. "affinity": "TEXT",
  510. "notNull": false
  511. },
  512. {
  513. "fieldPath": "headers",
  514. "columnName": "headers",
  515. "affinity": "TEXT",
  516. "notNull": false
  517. },
  518. {
  519. "fieldPath": "subject",
  520. "columnName": "subject",
  521. "affinity": "TEXT",
  522. "notNull": false
  523. },
  524. {
  525. "fieldPath": "size",
  526. "columnName": "size",
  527. "affinity": "INTEGER",
  528. "notNull": false
  529. },
  530. {
  531. "fieldPath": "content",
  532. "columnName": "content",
  533. "affinity": "INTEGER",
  534. "notNull": true
  535. },
  536. {
  537. "fieldPath": "sent",
  538. "columnName": "sent",
  539. "affinity": "INTEGER",
  540. "notNull": false
  541. },
  542. {
  543. "fieldPath": "received",
  544. "columnName": "received",
  545. "affinity": "INTEGER",
  546. "notNull": true
  547. },
  548. {
  549. "fieldPath": "stored",
  550. "columnName": "stored",
  551. "affinity": "INTEGER",
  552. "notNull": true
  553. },
  554. {
  555. "fieldPath": "seen",
  556. "columnName": "seen",
  557. "affinity": "INTEGER",
  558. "notNull": true
  559. },
  560. {
  561. "fieldPath": "flagged",
  562. "columnName": "flagged",
  563. "affinity": "INTEGER",
  564. "notNull": true
  565. },
  566. {
  567. "fieldPath": "ui_seen",
  568. "columnName": "ui_seen",
  569. "affinity": "INTEGER",
  570. "notNull": true
  571. },
  572. {
  573. "fieldPath": "ui_flagged",
  574. "columnName": "ui_flagged",
  575. "affinity": "INTEGER",
  576. "notNull": true
  577. },
  578. {
  579. "fieldPath": "ui_hide",
  580. "columnName": "ui_hide",
  581. "affinity": "INTEGER",
  582. "notNull": true
  583. },
  584. {
  585. "fieldPath": "ui_found",
  586. "columnName": "ui_found",
  587. "affinity": "INTEGER",
  588. "notNull": true
  589. },
  590. {
  591. "fieldPath": "ui_ignored",
  592. "columnName": "ui_ignored",
  593. "affinity": "INTEGER",
  594. "notNull": true
  595. },
  596. {
  597. "fieldPath": "error",
  598. "columnName": "error",
  599. "affinity": "TEXT",
  600. "notNull": false
  601. }
  602. ],
  603. "primaryKey": {
  604. "columnNames": [
  605. "id"
  606. ],
  607. "autoGenerate": true
  608. },
  609. "indices": [
  610. {
  611. "name": "index_message_account",
  612. "unique": false,
  613. "columnNames": [
  614. "account"
  615. ],
  616. "createSql": "CREATE INDEX `index_message_account` ON `${TABLE_NAME}` (`account`)"
  617. },
  618. {
  619. "name": "index_message_folder",
  620. "unique": false,
  621. "columnNames": [
  622. "folder"
  623. ],
  624. "createSql": "CREATE INDEX `index_message_folder` ON `${TABLE_NAME}` (`folder`)"
  625. },
  626. {
  627. "name": "index_message_identity",
  628. "unique": false,
  629. "columnNames": [
  630. "identity"
  631. ],
  632. "createSql": "CREATE INDEX `index_message_identity` ON `${TABLE_NAME}` (`identity`)"
  633. },
  634. {
  635. "name": "index_message_replying",
  636. "unique": false,
  637. "columnNames": [
  638. "replying"
  639. ],
  640. "createSql": "CREATE INDEX `index_message_replying` ON `${TABLE_NAME}` (`replying`)"
  641. },
  642. {
  643. "name": "index_message_folder_uid_ui_found",
  644. "unique": true,
  645. "columnNames": [
  646. "folder",
  647. "uid",
  648. "ui_found"
  649. ],
  650. "createSql": "CREATE UNIQUE INDEX `index_message_folder_uid_ui_found` ON `${TABLE_NAME}` (`folder`, `uid`, `ui_found`)"
  651. },
  652. {
  653. "name": "index_message_msgid_folder_ui_found",
  654. "unique": true,
  655. "columnNames": [
  656. "msgid",
  657. "folder",
  658. "ui_found"
  659. ],
  660. "createSql": "CREATE UNIQUE INDEX `index_message_msgid_folder_ui_found` ON `${TABLE_NAME}` (`msgid`, `folder`, `ui_found`)"
  661. },
  662. {
  663. "name": "index_message_thread",
  664. "unique": false,
  665. "columnNames": [
  666. "thread"
  667. ],
  668. "createSql": "CREATE INDEX `index_message_thread` ON `${TABLE_NAME}` (`thread`)"
  669. },
  670. {
  671. "name": "index_message_received",
  672. "unique": false,
  673. "columnNames": [
  674. "received"
  675. ],
  676. "createSql": "CREATE INDEX `index_message_received` ON `${TABLE_NAME}` (`received`)"
  677. },
  678. {
  679. "name": "index_message_ui_seen",
  680. "unique": false,
  681. "columnNames": [
  682. "ui_seen"
  683. ],
  684. "createSql": "CREATE INDEX `index_message_ui_seen` ON `${TABLE_NAME}` (`ui_seen`)"
  685. },
  686. {
  687. "name": "index_message_ui_hide",
  688. "unique": false,
  689. "columnNames": [
  690. "ui_hide"
  691. ],
  692. "createSql": "CREATE INDEX `index_message_ui_hide` ON `${TABLE_NAME}` (`ui_hide`)"
  693. },
  694. {
  695. "name": "index_message_ui_found",
  696. "unique": false,
  697. "columnNames": [
  698. "ui_found"
  699. ],
  700. "createSql": "CREATE INDEX `index_message_ui_found` ON `${TABLE_NAME}` (`ui_found`)"
  701. },
  702. {
  703. "name": "index_message_ui_ignored",
  704. "unique": false,
  705. "columnNames": [
  706. "ui_ignored"
  707. ],
  708. "createSql": "CREATE INDEX `index_message_ui_ignored` ON `${TABLE_NAME}` (`ui_ignored`)"
  709. }
  710. ],
  711. "foreignKeys": [
  712. {
  713. "table": "account",
  714. "onDelete": "CASCADE",
  715. "onUpdate": "NO ACTION",
  716. "columns": [
  717. "account"
  718. ],
  719. "referencedColumns": [
  720. "id"
  721. ]
  722. },
  723. {
  724. "table": "folder",
  725. "onDelete": "CASCADE",
  726. "onUpdate": "NO ACTION",
  727. "columns": [
  728. "folder"
  729. ],
  730. "referencedColumns": [
  731. "id"
  732. ]
  733. },
  734. {
  735. "table": "identity",
  736. "onDelete": "CASCADE",
  737. "onUpdate": "NO ACTION",
  738. "columns": [
  739. "identity"
  740. ],
  741. "referencedColumns": [
  742. "id"
  743. ]
  744. },
  745. {
  746. "table": "message",
  747. "onDelete": "CASCADE",
  748. "onUpdate": "NO ACTION",
  749. "columns": [
  750. "replying"
  751. ],
  752. "referencedColumns": [
  753. "id"
  754. ]
  755. }
  756. ]
  757. },
  758. {
  759. "tableName": "attachment",
  760. "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `message` INTEGER NOT NULL, `sequence` INTEGER NOT NULL, `name` TEXT, `type` TEXT NOT NULL, `cid` TEXT, `size` INTEGER, `progress` INTEGER, `available` INTEGER NOT NULL, FOREIGN KEY(`message`) REFERENCES `message`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
  761. "fields": [
  762. {
  763. "fieldPath": "id",
  764. "columnName": "id",
  765. "affinity": "INTEGER",
  766. "notNull": false
  767. },
  768. {
  769. "fieldPath": "message",
  770. "columnName": "message",
  771. "affinity": "INTEGER",
  772. "notNull": true
  773. },
  774. {
  775. "fieldPath": "sequence",
  776. "columnName": "sequence",
  777. "affinity": "INTEGER",
  778. "notNull": true
  779. },
  780. {
  781. "fieldPath": "name",
  782. "columnName": "name",
  783. "affinity": "TEXT",
  784. "notNull": false
  785. },
  786. {
  787. "fieldPath": "type",
  788. "columnName": "type",
  789. "affinity": "TEXT",
  790. "notNull": true
  791. },
  792. {
  793. "fieldPath": "cid",
  794. "columnName": "cid",
  795. "affinity": "TEXT",
  796. "notNull": false
  797. },
  798. {
  799. "fieldPath": "size",
  800. "columnName": "size",
  801. "affinity": "INTEGER",
  802. "notNull": false
  803. },
  804. {
  805. "fieldPath": "progress",
  806. "columnName": "progress",
  807. "affinity": "INTEGER",
  808. "notNull": false
  809. },
  810. {
  811. "fieldPath": "available",
  812. "columnName": "available",
  813. "affinity": "INTEGER",
  814. "notNull": true
  815. }
  816. ],
  817. "primaryKey": {
  818. "columnNames": [
  819. "id"
  820. ],
  821. "autoGenerate": true
  822. },
  823. "indices": [
  824. {
  825. "name": "index_attachment_message",
  826. "unique": false,
  827. "columnNames": [
  828. "message"
  829. ],
  830. "createSql": "CREATE INDEX `index_attachment_message` ON `${TABLE_NAME}` (`message`)"
  831. },
  832. {
  833. "name": "index_attachment_message_sequence",
  834. "unique": true,
  835. "columnNames": [
  836. "message",
  837. "sequence"
  838. ],
  839. "createSql": "CREATE UNIQUE INDEX `index_attachment_message_sequence` ON `${TABLE_NAME}` (`message`, `sequence`)"
  840. },
  841. {
  842. "name": "index_attachment_message_cid",
  843. "unique": true,
  844. "columnNames": [
  845. "message",
  846. "cid"
  847. ],
  848. "createSql": "CREATE UNIQUE INDEX `index_attachment_message_cid` ON `${TABLE_NAME}` (`message`, `cid`)"
  849. }
  850. ],
  851. "foreignKeys": [
  852. {
  853. "table": "message",
  854. "onDelete": "CASCADE",
  855. "onUpdate": "NO ACTION",
  856. "columns": [
  857. "message"
  858. ],
  859. "referencedColumns": [
  860. "id"
  861. ]
  862. }
  863. ]
  864. },
  865. {
  866. "tableName": "operation",
  867. "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `folder` INTEGER NOT NULL, `message` INTEGER NOT NULL, `name` TEXT NOT NULL, `args` TEXT NOT NULL, `created` INTEGER NOT NULL, FOREIGN KEY(`folder`) REFERENCES `folder`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`message`) REFERENCES `message`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
  868. "fields": [
  869. {
  870. "fieldPath": "id",
  871. "columnName": "id",
  872. "affinity": "INTEGER",
  873. "notNull": false
  874. },
  875. {
  876. "fieldPath": "folder",
  877. "columnName": "folder",
  878. "affinity": "INTEGER",
  879. "notNull": true
  880. },
  881. {
  882. "fieldPath": "message",
  883. "columnName": "message",
  884. "affinity": "INTEGER",
  885. "notNull": true
  886. },
  887. {
  888. "fieldPath": "name",
  889. "columnName": "name",
  890. "affinity": "TEXT",
  891. "notNull": true
  892. },
  893. {
  894. "fieldPath": "args",
  895. "columnName": "args",
  896. "affinity": "TEXT",
  897. "notNull": true
  898. },
  899. {
  900. "fieldPath": "created",
  901. "columnName": "created",
  902. "affinity": "INTEGER",
  903. "notNull": true
  904. }
  905. ],
  906. "primaryKey": {
  907. "columnNames": [
  908. "id"
  909. ],
  910. "autoGenerate": true
  911. },
  912. "indices": [
  913. {
  914. "name": "index_operation_folder",
  915. "unique": false,
  916. "columnNames": [
  917. "folder"
  918. ],
  919. "createSql": "CREATE INDEX `index_operation_folder` ON `${TABLE_NAME}` (`folder`)"
  920. },
  921. {
  922. "name": "index_operation_message",
  923. "unique": false,
  924. "columnNames": [
  925. "message"
  926. ],
  927. "createSql": "CREATE INDEX `index_operation_message` ON `${TABLE_NAME}` (`message`)"
  928. }
  929. ],
  930. "foreignKeys": [
  931. {
  932. "table": "folder",
  933. "onDelete": "CASCADE",
  934. "onUpdate": "NO ACTION",
  935. "columns": [
  936. "folder"
  937. ],
  938. "referencedColumns": [
  939. "id"
  940. ]
  941. },
  942. {
  943. "table": "message",
  944. "onDelete": "CASCADE",
  945. "onUpdate": "NO ACTION",
  946. "columns": [
  947. "message"
  948. ],
  949. "referencedColumns": [
  950. "id"
  951. ]
  952. }
  953. ]
  954. },
  955. {
  956. "tableName": "answer",
  957. "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT NOT NULL, `text` TEXT NOT NULL)",
  958. "fields": [
  959. {
  960. "fieldPath": "id",
  961. "columnName": "id",
  962. "affinity": "INTEGER",
  963. "notNull": false
  964. },
  965. {
  966. "fieldPath": "name",
  967. "columnName": "name",
  968. "affinity": "TEXT",
  969. "notNull": true
  970. },
  971. {
  972. "fieldPath": "text",
  973. "columnName": "text",
  974. "affinity": "TEXT",
  975. "notNull": true
  976. }
  977. ],
  978. "primaryKey": {
  979. "columnNames": [
  980. "id"
  981. ],
  982. "autoGenerate": true
  983. },
  984. "indices": [],
  985. "foreignKeys": []
  986. },
  987. {
  988. "tableName": "log",
  989. "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `time` INTEGER NOT NULL, `data` TEXT NOT NULL)",
  990. "fields": [
  991. {
  992. "fieldPath": "id",
  993. "columnName": "id",
  994. "affinity": "INTEGER",
  995. "notNull": false
  996. },
  997. {
  998. "fieldPath": "time",
  999. "columnName": "time",
  1000. "affinity": "INTEGER",
  1001. "notNull": true
  1002. },
  1003. {
  1004. "fieldPath": "data",
  1005. "columnName": "data",
  1006. "affinity": "TEXT",
  1007. "notNull": true
  1008. }
  1009. ],
  1010. "primaryKey": {
  1011. "columnNames": [
  1012. "id"
  1013. ],
  1014. "autoGenerate": true
  1015. },
  1016. "indices": [
  1017. {
  1018. "name": "index_log_time",
  1019. "unique": false,
  1020. "columnNames": [
  1021. "time"
  1022. ],
  1023. "createSql": "CREATE INDEX `index_log_time` ON `${TABLE_NAME}` (`time`)"
  1024. }
  1025. ],
  1026. "foreignKeys": []
  1027. }
  1028. ],
  1029. "setupQueries": [
  1030. "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
  1031. "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"50f45495091ca49a0bcaa5fc9f827604\")"
  1032. ]
  1033. }
  1034. }