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.

757 lines
22 KiB

  1. {
  2. "formatVersion": 1,
  3. "database": {
  4. "version": 1,
  5. "identityHash": "984985d3928b4abdec0802b65e820b2b",
  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, `port` INTEGER NOT NULL, `starttls` INTEGER NOT NULL, `user` TEXT NOT NULL, `password` TEXT NOT NULL, `primary` INTEGER NOT NULL, `synchronize` INTEGER NOT NULL, 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": "port",
  49. "columnName": "port",
  50. "affinity": "INTEGER",
  51. "notNull": true
  52. },
  53. {
  54. "fieldPath": "starttls",
  55. "columnName": "starttls",
  56. "affinity": "INTEGER",
  57. "notNull": true
  58. },
  59. {
  60. "fieldPath": "user",
  61. "columnName": "user",
  62. "affinity": "TEXT",
  63. "notNull": true
  64. },
  65. {
  66. "fieldPath": "password",
  67. "columnName": "password",
  68. "affinity": "TEXT",
  69. "notNull": true
  70. },
  71. {
  72. "fieldPath": "primary",
  73. "columnName": "primary",
  74. "affinity": "INTEGER",
  75. "notNull": true
  76. },
  77. {
  78. "fieldPath": "synchronize",
  79. "columnName": "synchronize",
  80. "affinity": "INTEGER",
  81. "notNull": true
  82. }
  83. ],
  84. "primaryKey": {
  85. "columnNames": [
  86. "id"
  87. ],
  88. "autoGenerate": true
  89. },
  90. "indices": [
  91. {
  92. "name": "index_identity_account",
  93. "unique": false,
  94. "columnNames": [
  95. "account"
  96. ],
  97. "createSql": "CREATE INDEX `index_identity_account` ON `${TABLE_NAME}` (`account`)"
  98. }
  99. ],
  100. "foreignKeys": [
  101. {
  102. "table": "account",
  103. "onDelete": "CASCADE",
  104. "onUpdate": "NO ACTION",
  105. "columns": [
  106. "account"
  107. ],
  108. "referencedColumns": [
  109. "id"
  110. ]
  111. }
  112. ]
  113. },
  114. {
  115. "tableName": "account",
  116. "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` TEXT, `host` TEXT NOT NULL, `port` INTEGER NOT NULL, `user` TEXT NOT NULL, `password` TEXT NOT NULL, `primary` INTEGER NOT NULL, `synchronize` INTEGER NOT NULL, `seen_until` INTEGER, `error` TEXT)",
  117. "fields": [
  118. {
  119. "fieldPath": "id",
  120. "columnName": "id",
  121. "affinity": "INTEGER",
  122. "notNull": false
  123. },
  124. {
  125. "fieldPath": "name",
  126. "columnName": "name",
  127. "affinity": "TEXT",
  128. "notNull": false
  129. },
  130. {
  131. "fieldPath": "host",
  132. "columnName": "host",
  133. "affinity": "TEXT",
  134. "notNull": true
  135. },
  136. {
  137. "fieldPath": "port",
  138. "columnName": "port",
  139. "affinity": "INTEGER",
  140. "notNull": true
  141. },
  142. {
  143. "fieldPath": "user",
  144. "columnName": "user",
  145. "affinity": "TEXT",
  146. "notNull": true
  147. },
  148. {
  149. "fieldPath": "password",
  150. "columnName": "password",
  151. "affinity": "TEXT",
  152. "notNull": true
  153. },
  154. {
  155. "fieldPath": "primary",
  156. "columnName": "primary",
  157. "affinity": "INTEGER",
  158. "notNull": true
  159. },
  160. {
  161. "fieldPath": "synchronize",
  162. "columnName": "synchronize",
  163. "affinity": "INTEGER",
  164. "notNull": true
  165. },
  166. {
  167. "fieldPath": "seen_until",
  168. "columnName": "seen_until",
  169. "affinity": "INTEGER",
  170. "notNull": false
  171. },
  172. {
  173. "fieldPath": "error",
  174. "columnName": "error",
  175. "affinity": "TEXT",
  176. "notNull": false
  177. }
  178. ],
  179. "primaryKey": {
  180. "columnNames": [
  181. "id"
  182. ],
  183. "autoGenerate": true
  184. },
  185. "indices": [],
  186. "foreignKeys": []
  187. },
  188. {
  189. "tableName": "folder",
  190. "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, `after` INTEGER NOT NULL, `error` TEXT, FOREIGN KEY(`account`) REFERENCES `account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
  191. "fields": [
  192. {
  193. "fieldPath": "id",
  194. "columnName": "id",
  195. "affinity": "INTEGER",
  196. "notNull": false
  197. },
  198. {
  199. "fieldPath": "account",
  200. "columnName": "account",
  201. "affinity": "INTEGER",
  202. "notNull": false
  203. },
  204. {
  205. "fieldPath": "name",
  206. "columnName": "name",
  207. "affinity": "TEXT",
  208. "notNull": true
  209. },
  210. {
  211. "fieldPath": "type",
  212. "columnName": "type",
  213. "affinity": "TEXT",
  214. "notNull": true
  215. },
  216. {
  217. "fieldPath": "synchronize",
  218. "columnName": "synchronize",
  219. "affinity": "INTEGER",
  220. "notNull": true
  221. },
  222. {
  223. "fieldPath": "after",
  224. "columnName": "after",
  225. "affinity": "INTEGER",
  226. "notNull": true
  227. },
  228. {
  229. "fieldPath": "error",
  230. "columnName": "error",
  231. "affinity": "TEXT",
  232. "notNull": false
  233. }
  234. ],
  235. "primaryKey": {
  236. "columnNames": [
  237. "id"
  238. ],
  239. "autoGenerate": true
  240. },
  241. "indices": [
  242. {
  243. "name": "index_folder_account_name",
  244. "unique": true,
  245. "columnNames": [
  246. "account",
  247. "name"
  248. ],
  249. "createSql": "CREATE UNIQUE INDEX `index_folder_account_name` ON `${TABLE_NAME}` (`account`, `name`)"
  250. },
  251. {
  252. "name": "index_folder_account",
  253. "unique": false,
  254. "columnNames": [
  255. "account"
  256. ],
  257. "createSql": "CREATE INDEX `index_folder_account` ON `${TABLE_NAME}` (`account`)"
  258. },
  259. {
  260. "name": "index_folder_name",
  261. "unique": false,
  262. "columnNames": [
  263. "name"
  264. ],
  265. "createSql": "CREATE INDEX `index_folder_name` ON `${TABLE_NAME}` (`name`)"
  266. },
  267. {
  268. "name": "index_folder_type",
  269. "unique": false,
  270. "columnNames": [
  271. "type"
  272. ],
  273. "createSql": "CREATE INDEX `index_folder_type` ON `${TABLE_NAME}` (`type`)"
  274. }
  275. ],
  276. "foreignKeys": [
  277. {
  278. "table": "account",
  279. "onDelete": "CASCADE",
  280. "onUpdate": "NO ACTION",
  281. "columns": [
  282. "account"
  283. ],
  284. "referencedColumns": [
  285. "id"
  286. ]
  287. }
  288. ]
  289. },
  290. {
  291. "tableName": "message",
  292. "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, `inreplyto` TEXT, `thread` TEXT, `from` TEXT, `to` TEXT, `cc` TEXT, `bcc` TEXT, `reply` TEXT, `subject` TEXT, `body` TEXT, `sent` INTEGER, `received` INTEGER NOT NULL, `seen` INTEGER NOT NULL, `ui_seen` INTEGER NOT NULL, `ui_hide` 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 )",
  293. "fields": [
  294. {
  295. "fieldPath": "id",
  296. "columnName": "id",
  297. "affinity": "INTEGER",
  298. "notNull": false
  299. },
  300. {
  301. "fieldPath": "account",
  302. "columnName": "account",
  303. "affinity": "INTEGER",
  304. "notNull": false
  305. },
  306. {
  307. "fieldPath": "folder",
  308. "columnName": "folder",
  309. "affinity": "INTEGER",
  310. "notNull": true
  311. },
  312. {
  313. "fieldPath": "identity",
  314. "columnName": "identity",
  315. "affinity": "INTEGER",
  316. "notNull": false
  317. },
  318. {
  319. "fieldPath": "replying",
  320. "columnName": "replying",
  321. "affinity": "INTEGER",
  322. "notNull": false
  323. },
  324. {
  325. "fieldPath": "uid",
  326. "columnName": "uid",
  327. "affinity": "INTEGER",
  328. "notNull": false
  329. },
  330. {
  331. "fieldPath": "msgid",
  332. "columnName": "msgid",
  333. "affinity": "TEXT",
  334. "notNull": false
  335. },
  336. {
  337. "fieldPath": "references",
  338. "columnName": "references",
  339. "affinity": "TEXT",
  340. "notNull": false
  341. },
  342. {
  343. "fieldPath": "inreplyto",
  344. "columnName": "inreplyto",
  345. "affinity": "TEXT",
  346. "notNull": false
  347. },
  348. {
  349. "fieldPath": "thread",
  350. "columnName": "thread",
  351. "affinity": "TEXT",
  352. "notNull": false
  353. },
  354. {
  355. "fieldPath": "from",
  356. "columnName": "from",
  357. "affinity": "TEXT",
  358. "notNull": false
  359. },
  360. {
  361. "fieldPath": "to",
  362. "columnName": "to",
  363. "affinity": "TEXT",
  364. "notNull": false
  365. },
  366. {
  367. "fieldPath": "cc",
  368. "columnName": "cc",
  369. "affinity": "TEXT",
  370. "notNull": false
  371. },
  372. {
  373. "fieldPath": "bcc",
  374. "columnName": "bcc",
  375. "affinity": "TEXT",
  376. "notNull": false
  377. },
  378. {
  379. "fieldPath": "reply",
  380. "columnName": "reply",
  381. "affinity": "TEXT",
  382. "notNull": false
  383. },
  384. {
  385. "fieldPath": "subject",
  386. "columnName": "subject",
  387. "affinity": "TEXT",
  388. "notNull": false
  389. },
  390. {
  391. "fieldPath": "body",
  392. "columnName": "body",
  393. "affinity": "TEXT",
  394. "notNull": false
  395. },
  396. {
  397. "fieldPath": "sent",
  398. "columnName": "sent",
  399. "affinity": "INTEGER",
  400. "notNull": false
  401. },
  402. {
  403. "fieldPath": "received",
  404. "columnName": "received",
  405. "affinity": "INTEGER",
  406. "notNull": true
  407. },
  408. {
  409. "fieldPath": "seen",
  410. "columnName": "seen",
  411. "affinity": "INTEGER",
  412. "notNull": true
  413. },
  414. {
  415. "fieldPath": "ui_seen",
  416. "columnName": "ui_seen",
  417. "affinity": "INTEGER",
  418. "notNull": true
  419. },
  420. {
  421. "fieldPath": "ui_hide",
  422. "columnName": "ui_hide",
  423. "affinity": "INTEGER",
  424. "notNull": true
  425. },
  426. {
  427. "fieldPath": "error",
  428. "columnName": "error",
  429. "affinity": "TEXT",
  430. "notNull": false
  431. }
  432. ],
  433. "primaryKey": {
  434. "columnNames": [
  435. "id"
  436. ],
  437. "autoGenerate": true
  438. },
  439. "indices": [
  440. {
  441. "name": "index_message_account",
  442. "unique": false,
  443. "columnNames": [
  444. "account"
  445. ],
  446. "createSql": "CREATE INDEX `index_message_account` ON `${TABLE_NAME}` (`account`)"
  447. },
  448. {
  449. "name": "index_message_folder",
  450. "unique": false,
  451. "columnNames": [
  452. "folder"
  453. ],
  454. "createSql": "CREATE INDEX `index_message_folder` ON `${TABLE_NAME}` (`folder`)"
  455. },
  456. {
  457. "name": "index_message_identity",
  458. "unique": false,
  459. "columnNames": [
  460. "identity"
  461. ],
  462. "createSql": "CREATE INDEX `index_message_identity` ON `${TABLE_NAME}` (`identity`)"
  463. },
  464. {
  465. "name": "index_message_replying",
  466. "unique": false,
  467. "columnNames": [
  468. "replying"
  469. ],
  470. "createSql": "CREATE INDEX `index_message_replying` ON `${TABLE_NAME}` (`replying`)"
  471. },
  472. {
  473. "name": "index_message_folder_uid",
  474. "unique": true,
  475. "columnNames": [
  476. "folder",
  477. "uid"
  478. ],
  479. "createSql": "CREATE UNIQUE INDEX `index_message_folder_uid` ON `${TABLE_NAME}` (`folder`, `uid`)"
  480. },
  481. {
  482. "name": "index_message_msgid_folder",
  483. "unique": true,
  484. "columnNames": [
  485. "msgid",
  486. "folder"
  487. ],
  488. "createSql": "CREATE UNIQUE INDEX `index_message_msgid_folder` ON `${TABLE_NAME}` (`msgid`, `folder`)"
  489. },
  490. {
  491. "name": "index_message_thread",
  492. "unique": false,
  493. "columnNames": [
  494. "thread"
  495. ],
  496. "createSql": "CREATE INDEX `index_message_thread` ON `${TABLE_NAME}` (`thread`)"
  497. },
  498. {
  499. "name": "index_message_received",
  500. "unique": false,
  501. "columnNames": [
  502. "received"
  503. ],
  504. "createSql": "CREATE INDEX `index_message_received` ON `${TABLE_NAME}` (`received`)"
  505. },
  506. {
  507. "name": "index_message_ui_seen",
  508. "unique": false,
  509. "columnNames": [
  510. "ui_seen"
  511. ],
  512. "createSql": "CREATE INDEX `index_message_ui_seen` ON `${TABLE_NAME}` (`ui_seen`)"
  513. },
  514. {
  515. "name": "index_message_ui_hide",
  516. "unique": false,
  517. "columnNames": [
  518. "ui_hide"
  519. ],
  520. "createSql": "CREATE INDEX `index_message_ui_hide` ON `${TABLE_NAME}` (`ui_hide`)"
  521. }
  522. ],
  523. "foreignKeys": [
  524. {
  525. "table": "account",
  526. "onDelete": "CASCADE",
  527. "onUpdate": "NO ACTION",
  528. "columns": [
  529. "account"
  530. ],
  531. "referencedColumns": [
  532. "id"
  533. ]
  534. },
  535. {
  536. "table": "folder",
  537. "onDelete": "CASCADE",
  538. "onUpdate": "NO ACTION",
  539. "columns": [
  540. "folder"
  541. ],
  542. "referencedColumns": [
  543. "id"
  544. ]
  545. },
  546. {
  547. "table": "identity",
  548. "onDelete": "CASCADE",
  549. "onUpdate": "NO ACTION",
  550. "columns": [
  551. "identity"
  552. ],
  553. "referencedColumns": [
  554. "id"
  555. ]
  556. },
  557. {
  558. "table": "message",
  559. "onDelete": "CASCADE",
  560. "onUpdate": "NO ACTION",
  561. "columns": [
  562. "replying"
  563. ],
  564. "referencedColumns": [
  565. "id"
  566. ]
  567. }
  568. ]
  569. },
  570. {
  571. "tableName": "attachment",
  572. "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, `size` INTEGER, `progress` INTEGER, `content` BLOB, FOREIGN KEY(`message`) REFERENCES `message`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
  573. "fields": [
  574. {
  575. "fieldPath": "id",
  576. "columnName": "id",
  577. "affinity": "INTEGER",
  578. "notNull": false
  579. },
  580. {
  581. "fieldPath": "message",
  582. "columnName": "message",
  583. "affinity": "INTEGER",
  584. "notNull": true
  585. },
  586. {
  587. "fieldPath": "sequence",
  588. "columnName": "sequence",
  589. "affinity": "INTEGER",
  590. "notNull": true
  591. },
  592. {
  593. "fieldPath": "name",
  594. "columnName": "name",
  595. "affinity": "TEXT",
  596. "notNull": false
  597. },
  598. {
  599. "fieldPath": "type",
  600. "columnName": "type",
  601. "affinity": "TEXT",
  602. "notNull": true
  603. },
  604. {
  605. "fieldPath": "size",
  606. "columnName": "size",
  607. "affinity": "INTEGER",
  608. "notNull": false
  609. },
  610. {
  611. "fieldPath": "progress",
  612. "columnName": "progress",
  613. "affinity": "INTEGER",
  614. "notNull": false
  615. },
  616. {
  617. "fieldPath": "content",
  618. "columnName": "content",
  619. "affinity": "BLOB",
  620. "notNull": false
  621. }
  622. ],
  623. "primaryKey": {
  624. "columnNames": [
  625. "id"
  626. ],
  627. "autoGenerate": true
  628. },
  629. "indices": [
  630. {
  631. "name": "index_attachment_message",
  632. "unique": false,
  633. "columnNames": [
  634. "message"
  635. ],
  636. "createSql": "CREATE INDEX `index_attachment_message` ON `${TABLE_NAME}` (`message`)"
  637. },
  638. {
  639. "name": "index_attachment_message_sequence",
  640. "unique": true,
  641. "columnNames": [
  642. "message",
  643. "sequence"
  644. ],
  645. "createSql": "CREATE UNIQUE INDEX `index_attachment_message_sequence` ON `${TABLE_NAME}` (`message`, `sequence`)"
  646. }
  647. ],
  648. "foreignKeys": [
  649. {
  650. "table": "message",
  651. "onDelete": "CASCADE",
  652. "onUpdate": "NO ACTION",
  653. "columns": [
  654. "message"
  655. ],
  656. "referencedColumns": [
  657. "id"
  658. ]
  659. }
  660. ]
  661. },
  662. {
  663. "tableName": "operation",
  664. "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 )",
  665. "fields": [
  666. {
  667. "fieldPath": "id",
  668. "columnName": "id",
  669. "affinity": "INTEGER",
  670. "notNull": false
  671. },
  672. {
  673. "fieldPath": "folder",
  674. "columnName": "folder",
  675. "affinity": "INTEGER",
  676. "notNull": true
  677. },
  678. {
  679. "fieldPath": "message",
  680. "columnName": "message",
  681. "affinity": "INTEGER",
  682. "notNull": true
  683. },
  684. {
  685. "fieldPath": "name",
  686. "columnName": "name",
  687. "affinity": "TEXT",
  688. "notNull": true
  689. },
  690. {
  691. "fieldPath": "args",
  692. "columnName": "args",
  693. "affinity": "TEXT",
  694. "notNull": true
  695. },
  696. {
  697. "fieldPath": "created",
  698. "columnName": "created",
  699. "affinity": "INTEGER",
  700. "notNull": true
  701. }
  702. ],
  703. "primaryKey": {
  704. "columnNames": [
  705. "id"
  706. ],
  707. "autoGenerate": true
  708. },
  709. "indices": [
  710. {
  711. "name": "index_operation_folder",
  712. "unique": false,
  713. "columnNames": [
  714. "folder"
  715. ],
  716. "createSql": "CREATE INDEX `index_operation_folder` ON `${TABLE_NAME}` (`folder`)"
  717. },
  718. {
  719. "name": "index_operation_message",
  720. "unique": false,
  721. "columnNames": [
  722. "message"
  723. ],
  724. "createSql": "CREATE INDEX `index_operation_message` ON `${TABLE_NAME}` (`message`)"
  725. }
  726. ],
  727. "foreignKeys": [
  728. {
  729. "table": "folder",
  730. "onDelete": "CASCADE",
  731. "onUpdate": "NO ACTION",
  732. "columns": [
  733. "folder"
  734. ],
  735. "referencedColumns": [
  736. "id"
  737. ]
  738. },
  739. {
  740. "table": "message",
  741. "onDelete": "CASCADE",
  742. "onUpdate": "NO ACTION",
  743. "columns": [
  744. "message"
  745. ],
  746. "referencedColumns": [
  747. "id"
  748. ]
  749. }
  750. ]
  751. }
  752. ],
  753. "setupQueries": [
  754. "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
  755. "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"984985d3928b4abdec0802b65e820b2b\")"
  756. ]
  757. }
  758. }