diff --git a/app/schemas/eu.faircode.email.DB/262.json b/app/schemas/eu.faircode.email.DB/262.json deleted file mode 100644 index c5f27d1e89..0000000000 --- a/app/schemas/eu.faircode.email.DB/262.json +++ /dev/null @@ -1,2907 +0,0 @@ -{ - "formatVersion": 1, - "database": { - "version": 262, - "identityHash": "8e31fcdf5c2bc6b64cd30a101ba4597e", - "entities": [ - { - "tableName": "identity", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `uuid` TEXT NOT NULL, `name` TEXT NOT NULL, `email` TEXT NOT NULL, `account` INTEGER NOT NULL, `display` TEXT, `color` INTEGER, `signature` TEXT, `host` TEXT NOT NULL, `starttls` INTEGER NOT NULL, `insecure` INTEGER NOT NULL, `port` INTEGER NOT NULL, `auth_type` INTEGER NOT NULL, `provider` TEXT, `user` TEXT NOT NULL, `password` TEXT NOT NULL, `certificate` INTEGER NOT NULL, `certificate_alias` TEXT, `realm` TEXT, `fingerprint` TEXT, `use_ip` INTEGER NOT NULL, `ehlo` TEXT, `synchronize` INTEGER NOT NULL, `primary` INTEGER NOT NULL, `self` INTEGER NOT NULL, `sender_extra` INTEGER NOT NULL, `sender_extra_name` INTEGER NOT NULL, `sender_extra_regex` TEXT, `replyto` TEXT, `cc` TEXT, `bcc` TEXT, `internal` TEXT, `unicode` INTEGER NOT NULL, `octetmime` INTEGER NOT NULL, `plain_only` INTEGER NOT NULL, `sign_default` INTEGER NOT NULL, `encrypt_default` INTEGER NOT NULL, `encrypt` INTEGER NOT NULL, `delivery_receipt` INTEGER NOT NULL, `read_receipt` INTEGER NOT NULL, `store_sent` INTEGER NOT NULL, `sent_folder` INTEGER, `sign_key` INTEGER, `sign_key_alias` TEXT, `tbd` INTEGER, `state` TEXT, `error` TEXT, `last_connected` INTEGER, `max_size` INTEGER, FOREIGN KEY(`account`) REFERENCES `account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "uuid", - "columnName": "uuid", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "email", - "columnName": "email", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "account", - "columnName": "account", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "display", - "columnName": "display", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "color", - "columnName": "color", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "signature", - "columnName": "signature", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "host", - "columnName": "host", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "encryption", - "columnName": "starttls", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "insecure", - "columnName": "insecure", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "port", - "columnName": "port", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "auth_type", - "columnName": "auth_type", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "provider", - "columnName": "provider", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "user", - "columnName": "user", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "password", - "columnName": "password", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "certificate", - "columnName": "certificate", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "certificate_alias", - "columnName": "certificate_alias", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "realm", - "columnName": "realm", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "fingerprint", - "columnName": "fingerprint", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "use_ip", - "columnName": "use_ip", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ehlo", - "columnName": "ehlo", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "synchronize", - "columnName": "synchronize", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "primary", - "columnName": "primary", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "self", - "columnName": "self", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "sender_extra", - "columnName": "sender_extra", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "sender_extra_name", - "columnName": "sender_extra_name", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "sender_extra_regex", - "columnName": "sender_extra_regex", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "replyto", - "columnName": "replyto", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "cc", - "columnName": "cc", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "bcc", - "columnName": "bcc", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "internal", - "columnName": "internal", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "unicode", - "columnName": "unicode", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "octetmime", - "columnName": "octetmime", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "plain_only", - "columnName": "plain_only", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "sign_default", - "columnName": "sign_default", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "encrypt_default", - "columnName": "encrypt_default", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "encrypt", - "columnName": "encrypt", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "delivery_receipt", - "columnName": "delivery_receipt", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "read_receipt", - "columnName": "read_receipt", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "store_sent", - "columnName": "store_sent", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "sent_folder", - "columnName": "sent_folder", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "sign_key", - "columnName": "sign_key", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "sign_key_alias", - "columnName": "sign_key_alias", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "tbd", - "columnName": "tbd", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "state", - "columnName": "state", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "error", - "columnName": "error", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "last_connected", - "columnName": "last_connected", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "max_size", - "columnName": "max_size", - "affinity": "INTEGER", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_identity_account", - "unique": false, - "columnNames": [ - "account" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_identity_account` ON `${TABLE_NAME}` (`account`)" - }, - { - "name": "index_identity_account_email", - "unique": false, - "columnNames": [ - "account", - "email" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_identity_account_email` ON `${TABLE_NAME}` (`account`, `email`)" - } - ], - "foreignKeys": [ - { - "table": "account", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "account" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "account", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `uuid` TEXT NOT NULL, `pop` INTEGER NOT NULL, `host` TEXT NOT NULL, `starttls` INTEGER NOT NULL, `insecure` INTEGER NOT NULL, `port` INTEGER NOT NULL, `auth_type` INTEGER NOT NULL, `provider` TEXT, `user` TEXT NOT NULL, `password` TEXT NOT NULL, `certificate` INTEGER NOT NULL, `certificate_alias` TEXT, `realm` TEXT, `fingerprint` TEXT, `name` TEXT, `category` TEXT, `signature` TEXT, `color` INTEGER, `calendar` TEXT, `synchronize` INTEGER NOT NULL, `ondemand` INTEGER NOT NULL, `poll_exempted` INTEGER NOT NULL, `primary` INTEGER NOT NULL, `notify` INTEGER NOT NULL, `browse` INTEGER NOT NULL, `leave_on_server` INTEGER NOT NULL, `leave_deleted` INTEGER NOT NULL, `leave_on_device` INTEGER NOT NULL, `max_messages` INTEGER, `auto_seen` INTEGER NOT NULL, `separator` INTEGER, `swipe_left` INTEGER, `swipe_right` INTEGER, `move_to` INTEGER, `poll_interval` INTEGER NOT NULL, `keep_alive_noop` INTEGER NOT NULL, `keep_alive_ok` INTEGER NOT NULL, `keep_alive_failed` INTEGER NOT NULL, `keep_alive_succeeded` INTEGER NOT NULL, `partial_fetch` INTEGER NOT NULL, `ignore_size` INTEGER NOT NULL, `use_date` INTEGER NOT NULL, `use_received` INTEGER NOT NULL, `prefix` TEXT, `unicode` INTEGER NOT NULL, `conditions` TEXT, `quota_usage` INTEGER, `quota_limit` INTEGER, `created` INTEGER, `tbd` INTEGER, `thread` INTEGER, `state` TEXT, `warning` TEXT, `error` TEXT, `last_connected` INTEGER, `backoff_until` INTEGER, `max_size` INTEGER, `capabilities` TEXT, `capability_idle` INTEGER, `capability_utf8` INTEGER, `capability_uidl` INTEGER, `order` INTEGER)", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "uuid", - "columnName": "uuid", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "protocol", - "columnName": "pop", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "host", - "columnName": "host", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "encryption", - "columnName": "starttls", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "insecure", - "columnName": "insecure", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "port", - "columnName": "port", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "auth_type", - "columnName": "auth_type", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "provider", - "columnName": "provider", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "user", - "columnName": "user", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "password", - "columnName": "password", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "certificate", - "columnName": "certificate", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "certificate_alias", - "columnName": "certificate_alias", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "realm", - "columnName": "realm", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "fingerprint", - "columnName": "fingerprint", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "category", - "columnName": "category", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "signature", - "columnName": "signature", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "color", - "columnName": "color", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "calendar", - "columnName": "calendar", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "synchronize", - "columnName": "synchronize", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ondemand", - "columnName": "ondemand", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "poll_exempted", - "columnName": "poll_exempted", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "primary", - "columnName": "primary", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "notify", - "columnName": "notify", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "browse", - "columnName": "browse", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "leave_on_server", - "columnName": "leave_on_server", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "leave_deleted", - "columnName": "leave_deleted", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "leave_on_device", - "columnName": "leave_on_device", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "max_messages", - "columnName": "max_messages", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "auto_seen", - "columnName": "auto_seen", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "_separator", - "columnName": "separator", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "swipe_left", - "columnName": "swipe_left", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "swipe_right", - "columnName": "swipe_right", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "move_to", - "columnName": "move_to", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "poll_interval", - "columnName": "poll_interval", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "keep_alive_noop", - "columnName": "keep_alive_noop", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "keep_alive_ok", - "columnName": "keep_alive_ok", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "keep_alive_failed", - "columnName": "keep_alive_failed", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "keep_alive_succeeded", - "columnName": "keep_alive_succeeded", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "partial_fetch", - "columnName": "partial_fetch", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ignore_size", - "columnName": "ignore_size", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "use_date", - "columnName": "use_date", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "use_received", - "columnName": "use_received", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "prefix", - "columnName": "prefix", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "unicode", - "columnName": "unicode", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "conditions", - "columnName": "conditions", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "quota_usage", - "columnName": "quota_usage", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "quota_limit", - "columnName": "quota_limit", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "created", - "columnName": "created", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "tbd", - "columnName": "tbd", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "thread", - "columnName": "thread", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "state", - "columnName": "state", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "warning", - "columnName": "warning", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "error", - "columnName": "error", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "last_connected", - "columnName": "last_connected", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "backoff_until", - "columnName": "backoff_until", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "max_size", - "columnName": "max_size", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "capabilities", - "columnName": "capabilities", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "capability_idle", - "columnName": "capability_idle", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "capability_utf8", - "columnName": "capability_utf8", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "capability_uidl", - "columnName": "capability_uidl", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "order", - "columnName": "order", - "affinity": "INTEGER", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_account_synchronize", - "unique": false, - "columnNames": [ - "synchronize" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_account_synchronize` ON `${TABLE_NAME}` (`synchronize`)" - }, - { - "name": "index_account_category", - "unique": false, - "columnNames": [ - "category" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_account_category` ON `${TABLE_NAME}` (`category`)" - } - ], - "foreignKeys": [] - }, - { - "tableName": "folder", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `account` INTEGER, `parent` INTEGER, `uidv` INTEGER, `modseq` INTEGER, `namespace` TEXT, `separator` INTEGER, `name` TEXT NOT NULL, `type` TEXT NOT NULL, `inherited_type` TEXT, `level` INTEGER NOT NULL, `local` INTEGER NOT NULL, `synchronize` INTEGER NOT NULL, `poll` INTEGER NOT NULL, `poll_factor` INTEGER NOT NULL, `poll_count` INTEGER NOT NULL, `download` INTEGER NOT NULL, `auto_classify` INTEGER NOT NULL, `auto_classify_source` INTEGER NOT NULL, `auto_classify_target` INTEGER NOT NULL, `subscribed` INTEGER, `sync_days` INTEGER NOT NULL, `keep_days` INTEGER NOT NULL, `auto_delete` INTEGER NOT NULL, `auto_add` INTEGER, `display` TEXT, `color` INTEGER, `hide` INTEGER NOT NULL, `hide_seen` INTEGER NOT NULL, `collapsed` INTEGER NOT NULL, `unified` INTEGER NOT NULL, `navigation` INTEGER NOT NULL, `notify` INTEGER NOT NULL, `total` INTEGER, `keywords` TEXT, `selected_last` INTEGER NOT NULL, `selected_count` INTEGER NOT NULL, `initialize` INTEGER NOT NULL, `tbc` INTEGER, `tbd` INTEGER, `rename` TEXT, `state` TEXT, `sync_state` TEXT, `read_only` INTEGER NOT NULL, `selectable` INTEGER NOT NULL, `inferiors` INTEGER NOT NULL, `error` TEXT, `last_sync` INTEGER, `last_sync_foreground` INTEGER, `last_sync_count` INTEGER, `order` INTEGER, FOREIGN KEY(`account`) REFERENCES `account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "account", - "columnName": "account", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "parent", - "columnName": "parent", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "uidv", - "columnName": "uidv", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "modseq", - "columnName": "modseq", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "namespace", - "columnName": "namespace", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "separator", - "columnName": "separator", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "type", - "columnName": "type", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "inherited_type", - "columnName": "inherited_type", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "level", - "columnName": "level", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "local", - "columnName": "local", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "synchronize", - "columnName": "synchronize", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "poll", - "columnName": "poll", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "poll_factor", - "columnName": "poll_factor", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "poll_count", - "columnName": "poll_count", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "download", - "columnName": "download", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "auto_classify", - "columnName": "auto_classify", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "auto_classify_source", - "columnName": "auto_classify_source", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "auto_classify_target", - "columnName": "auto_classify_target", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "subscribed", - "columnName": "subscribed", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "sync_days", - "columnName": "sync_days", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "keep_days", - "columnName": "keep_days", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "auto_delete", - "columnName": "auto_delete", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "auto_add", - "columnName": "auto_add", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "display", - "columnName": "display", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "color", - "columnName": "color", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "hide", - "columnName": "hide", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "hide_seen", - "columnName": "hide_seen", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "collapsed", - "columnName": "collapsed", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "unified", - "columnName": "unified", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "navigation", - "columnName": "navigation", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "notify", - "columnName": "notify", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "total", - "columnName": "total", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "keywords", - "columnName": "keywords", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "selected_last", - "columnName": "selected_last", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "selected_count", - "columnName": "selected_count", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "initialize", - "columnName": "initialize", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "tbc", - "columnName": "tbc", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "tbd", - "columnName": "tbd", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "rename", - "columnName": "rename", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "state", - "columnName": "state", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "sync_state", - "columnName": "sync_state", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "read_only", - "columnName": "read_only", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "selectable", - "columnName": "selectable", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "inferiors", - "columnName": "inferiors", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "error", - "columnName": "error", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "last_sync", - "columnName": "last_sync", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "last_sync_foreground", - "columnName": "last_sync_foreground", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "last_sync_count", - "columnName": "last_sync_count", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "order", - "columnName": "order", - "affinity": "INTEGER", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_folder_account_name", - "unique": true, - "columnNames": [ - "account", - "name" - ], - "orders": [], - "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_folder_account_name` ON `${TABLE_NAME}` (`account`, `name`)" - }, - { - "name": "index_folder_account", - "unique": false, - "columnNames": [ - "account" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_folder_account` ON `${TABLE_NAME}` (`account`)" - }, - { - "name": "index_folder_name", - "unique": false, - "columnNames": [ - "name" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_folder_name` ON `${TABLE_NAME}` (`name`)" - }, - { - "name": "index_folder_type", - "unique": false, - "columnNames": [ - "type" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_folder_type` ON `${TABLE_NAME}` (`type`)" - }, - { - "name": "index_folder_unified", - "unique": false, - "columnNames": [ - "unified" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_folder_unified` ON `${TABLE_NAME}` (`unified`)" - } - ], - "foreignKeys": [ - { - "table": "account", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "account" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "message", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `account` INTEGER NOT NULL, `folder` INTEGER NOT NULL, `identity` INTEGER, `extra` TEXT, `replying` INTEGER, `forwarding` INTEGER, `uid` INTEGER, `uidl` TEXT, `msgid` TEXT, `hash` TEXT, `references` TEXT, `deliveredto` TEXT, `inreplyto` TEXT, `wasforwardedfrom` TEXT, `thread` TEXT, `priority` INTEGER, `importance` INTEGER, `sensitivity` INTEGER, `auto_submitted` INTEGER, `receipt` INTEGER, `receipt_request` INTEGER, `receipt_to` TEXT, `bimi_selector` TEXT, `tls` INTEGER, `dkim` INTEGER, `spf` INTEGER, `dmarc` INTEGER, `mx` INTEGER, `blocklist` INTEGER, `from_domain` INTEGER, `reply_domain` INTEGER, `avatar` TEXT, `sender` TEXT, `return_path` TEXT, `smtp_from` TEXT, `submitter` TEXT, `from` TEXT, `to` TEXT, `cc` TEXT, `bcc` TEXT, `reply` TEXT, `list_post` TEXT, `unsubscribe` TEXT, `autocrypt` TEXT, `headers` TEXT, `infrastructure` TEXT, `raw` INTEGER, `subject` TEXT, `size` INTEGER, `total` INTEGER, `attachments` INTEGER NOT NULL, `content` INTEGER NOT NULL, `language` TEXT, `plain_only` INTEGER, `resend` INTEGER, `encrypt` INTEGER, `ui_encrypt` INTEGER, `verified` INTEGER NOT NULL, `preview` TEXT, `notes` TEXT, `notes_color` INTEGER, `signature` INTEGER NOT NULL, `sent` INTEGER, `received` INTEGER NOT NULL, `stored` INTEGER NOT NULL, `recent` INTEGER NOT NULL, `seen` INTEGER NOT NULL, `answered` INTEGER NOT NULL, `flagged` INTEGER NOT NULL, `deleted` INTEGER NOT NULL, `flags` TEXT, `keywords` TEXT, `labels` TEXT, `fts` INTEGER NOT NULL, `auto_classified` INTEGER NOT NULL, `notifying` INTEGER NOT NULL, `ui_seen` INTEGER NOT NULL, `ui_answered` INTEGER NOT NULL, `ui_flagged` INTEGER NOT NULL, `ui_deleted` INTEGER NOT NULL, `ui_hide` INTEGER NOT NULL, `ui_found` INTEGER NOT NULL, `ui_ignored` INTEGER NOT NULL, `ui_silent` INTEGER NOT NULL, `ui_local_only` INTEGER NOT NULL, `ui_browsed` INTEGER NOT NULL, `ui_busy` INTEGER, `ui_snoozed` INTEGER, `ui_unsnoozed` INTEGER NOT NULL, `show_images` INTEGER NOT NULL, `show_full` INTEGER NOT NULL, `color` INTEGER, `revision` INTEGER, `revisions` INTEGER, `warning` TEXT, `error` TEXT, `last_attempt` INTEGER, 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 SET NULL , FOREIGN KEY(`replying`) REFERENCES `message`(`id`) ON UPDATE NO ACTION ON DELETE SET NULL , FOREIGN KEY(`forwarding`) REFERENCES `message`(`id`) ON UPDATE NO ACTION ON DELETE SET NULL )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "account", - "columnName": "account", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "folder", - "columnName": "folder", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "identity", - "columnName": "identity", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "extra", - "columnName": "extra", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "replying", - "columnName": "replying", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "forwarding", - "columnName": "forwarding", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "uid", - "columnName": "uid", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "uidl", - "columnName": "uidl", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "msgid", - "columnName": "msgid", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "hash", - "columnName": "hash", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "references", - "columnName": "references", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "deliveredto", - "columnName": "deliveredto", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "inreplyto", - "columnName": "inreplyto", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "wasforwardedfrom", - "columnName": "wasforwardedfrom", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "thread", - "columnName": "thread", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "priority", - "columnName": "priority", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "importance", - "columnName": "importance", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "sensitivity", - "columnName": "sensitivity", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "auto_submitted", - "columnName": "auto_submitted", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "dsn", - "columnName": "receipt", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "receipt_request", - "columnName": "receipt_request", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "receipt_to", - "columnName": "receipt_to", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "bimi_selector", - "columnName": "bimi_selector", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "tls", - "columnName": "tls", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "dkim", - "columnName": "dkim", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "spf", - "columnName": "spf", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "dmarc", - "columnName": "dmarc", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "mx", - "columnName": "mx", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "blocklist", - "columnName": "blocklist", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "from_domain", - "columnName": "from_domain", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "reply_domain", - "columnName": "reply_domain", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "avatar", - "columnName": "avatar", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "sender", - "columnName": "sender", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "return_path", - "columnName": "return_path", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "smtp_from", - "columnName": "smtp_from", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "submitter", - "columnName": "submitter", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "from", - "columnName": "from", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "to", - "columnName": "to", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "cc", - "columnName": "cc", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "bcc", - "columnName": "bcc", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "reply", - "columnName": "reply", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "list_post", - "columnName": "list_post", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "unsubscribe", - "columnName": "unsubscribe", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "autocrypt", - "columnName": "autocrypt", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "headers", - "columnName": "headers", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "infrastructure", - "columnName": "infrastructure", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "raw", - "columnName": "raw", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "subject", - "columnName": "subject", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "size", - "columnName": "size", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "total", - "columnName": "total", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "attachments", - "columnName": "attachments", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "content", - "columnName": "content", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "language", - "columnName": "language", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "plain_only", - "columnName": "plain_only", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "resend", - "columnName": "resend", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "encrypt", - "columnName": "encrypt", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "ui_encrypt", - "columnName": "ui_encrypt", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "verified", - "columnName": "verified", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "preview", - "columnName": "preview", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "notes", - "columnName": "notes", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "notes_color", - "columnName": "notes_color", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "signature", - "columnName": "signature", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "sent", - "columnName": "sent", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "received", - "columnName": "received", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "stored", - "columnName": "stored", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "recent", - "columnName": "recent", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "seen", - "columnName": "seen", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "answered", - "columnName": "answered", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "flagged", - "columnName": "flagged", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "deleted", - "columnName": "deleted", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "flags", - "columnName": "flags", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "keywords", - "columnName": "keywords", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "labels", - "columnName": "labels", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "fts", - "columnName": "fts", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "auto_classified", - "columnName": "auto_classified", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "notifying", - "columnName": "notifying", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ui_seen", - "columnName": "ui_seen", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ui_answered", - "columnName": "ui_answered", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ui_flagged", - "columnName": "ui_flagged", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ui_deleted", - "columnName": "ui_deleted", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ui_hide", - "columnName": "ui_hide", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ui_found", - "columnName": "ui_found", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ui_ignored", - "columnName": "ui_ignored", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ui_silent", - "columnName": "ui_silent", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ui_local_only", - "columnName": "ui_local_only", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ui_browsed", - "columnName": "ui_browsed", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ui_busy", - "columnName": "ui_busy", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "ui_snoozed", - "columnName": "ui_snoozed", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "ui_unsnoozed", - "columnName": "ui_unsnoozed", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "show_images", - "columnName": "show_images", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "show_full", - "columnName": "show_full", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "color", - "columnName": "color", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "revision", - "columnName": "revision", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "revisions", - "columnName": "revisions", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "warning", - "columnName": "warning", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "error", - "columnName": "error", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "last_attempt", - "columnName": "last_attempt", - "affinity": "INTEGER", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_message_account", - "unique": false, - "columnNames": [ - "account" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_account` ON `${TABLE_NAME}` (`account`)" - }, - { - "name": "index_message_folder", - "unique": false, - "columnNames": [ - "folder" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_folder` ON `${TABLE_NAME}` (`folder`)" - }, - { - "name": "index_message_identity", - "unique": false, - "columnNames": [ - "identity" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_identity` ON `${TABLE_NAME}` (`identity`)" - }, - { - "name": "index_message_folder_uid", - "unique": true, - "columnNames": [ - "folder", - "uid" - ], - "orders": [], - "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_message_folder_uid` ON `${TABLE_NAME}` (`folder`, `uid`)" - }, - { - "name": "index_message_inreplyto", - "unique": false, - "columnNames": [ - "inreplyto" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_inreplyto` ON `${TABLE_NAME}` (`inreplyto`)" - }, - { - "name": "index_message_msgid", - "unique": false, - "columnNames": [ - "msgid" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_msgid` ON `${TABLE_NAME}` (`msgid`)" - }, - { - "name": "index_message_thread", - "unique": false, - "columnNames": [ - "thread" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_thread` ON `${TABLE_NAME}` (`thread`)" - }, - { - "name": "index_message_sender", - "unique": false, - "columnNames": [ - "sender" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_sender` ON `${TABLE_NAME}` (`sender`)" - }, - { - "name": "index_message_received", - "unique": false, - "columnNames": [ - "received" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_received` ON `${TABLE_NAME}` (`received`)" - }, - { - "name": "index_message_subject", - "unique": false, - "columnNames": [ - "subject" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_subject` ON `${TABLE_NAME}` (`subject`)" - }, - { - "name": "index_message_ui_seen", - "unique": false, - "columnNames": [ - "ui_seen" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_ui_seen` ON `${TABLE_NAME}` (`ui_seen`)" - }, - { - "name": "index_message_ui_flagged", - "unique": false, - "columnNames": [ - "ui_flagged" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_ui_flagged` ON `${TABLE_NAME}` (`ui_flagged`)" - }, - { - "name": "index_message_ui_hide", - "unique": false, - "columnNames": [ - "ui_hide" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_ui_hide` ON `${TABLE_NAME}` (`ui_hide`)" - }, - { - "name": "index_message_ui_found", - "unique": false, - "columnNames": [ - "ui_found" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_ui_found` ON `${TABLE_NAME}` (`ui_found`)" - }, - { - "name": "index_message_ui_ignored", - "unique": false, - "columnNames": [ - "ui_ignored" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_ui_ignored` ON `${TABLE_NAME}` (`ui_ignored`)" - }, - { - "name": "index_message_ui_browsed", - "unique": false, - "columnNames": [ - "ui_browsed" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_ui_browsed` ON `${TABLE_NAME}` (`ui_browsed`)" - }, - { - "name": "index_message_ui_snoozed", - "unique": false, - "columnNames": [ - "ui_snoozed" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_message_ui_snoozed` ON `${TABLE_NAME}` (`ui_snoozed`)" - } - ], - "foreignKeys": [ - { - "table": "account", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "account" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "folder", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "folder" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "identity", - "onDelete": "SET NULL", - "onUpdate": "NO ACTION", - "columns": [ - "identity" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "message", - "onDelete": "SET NULL", - "onUpdate": "NO ACTION", - "columns": [ - "replying" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "message", - "onDelete": "SET NULL", - "onUpdate": "NO ACTION", - "columns": [ - "forwarding" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "attachment", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `message` INTEGER NOT NULL, `sequence` INTEGER NOT NULL, `subsequence` INTEGER, `name` TEXT, `type` TEXT NOT NULL, `disposition` TEXT, `cid` TEXT, `related` INTEGER, `encryption` INTEGER, `size` INTEGER, `progress` INTEGER, `available` INTEGER NOT NULL, `media_uri` TEXT, `error` TEXT, FOREIGN KEY(`message`) REFERENCES `message`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "message", - "columnName": "message", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "sequence", - "columnName": "sequence", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "subsequence", - "columnName": "subsequence", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "type", - "columnName": "type", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "disposition", - "columnName": "disposition", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "cid", - "columnName": "cid", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "related", - "columnName": "related", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "encryption", - "columnName": "encryption", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "size", - "columnName": "size", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "progress", - "columnName": "progress", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "available", - "columnName": "available", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "media_uri", - "columnName": "media_uri", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "error", - "columnName": "error", - "affinity": "TEXT", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_attachment_message", - "unique": false, - "columnNames": [ - "message" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_attachment_message` ON `${TABLE_NAME}` (`message`)" - }, - { - "name": "index_attachment_message_sequence_subsequence", - "unique": true, - "columnNames": [ - "message", - "sequence", - "subsequence" - ], - "orders": [], - "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_attachment_message_sequence_subsequence` ON `${TABLE_NAME}` (`message`, `sequence`, `subsequence`)" - }, - { - "name": "index_attachment_message_cid", - "unique": false, - "columnNames": [ - "message", - "cid" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_attachment_message_cid` ON `${TABLE_NAME}` (`message`, `cid`)" - } - ], - "foreignKeys": [ - { - "table": "message", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "message" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "operation", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `account` INTEGER, `folder` INTEGER NOT NULL, `message` INTEGER, `name` TEXT NOT NULL, `args` TEXT NOT NULL, `created` INTEGER NOT NULL, `tries` INTEGER NOT NULL, `state` TEXT, `error` TEXT, 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 )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "account", - "columnName": "account", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "folder", - "columnName": "folder", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "message", - "columnName": "message", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "args", - "columnName": "args", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "created", - "columnName": "created", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "tries", - "columnName": "tries", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "state", - "columnName": "state", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "error", - "columnName": "error", - "affinity": "TEXT", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_operation_account", - "unique": false, - "columnNames": [ - "account" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_operation_account` ON `${TABLE_NAME}` (`account`)" - }, - { - "name": "index_operation_folder", - "unique": false, - "columnNames": [ - "folder" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_operation_folder` ON `${TABLE_NAME}` (`folder`)" - }, - { - "name": "index_operation_message", - "unique": false, - "columnNames": [ - "message" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_operation_message` ON `${TABLE_NAME}` (`message`)" - }, - { - "name": "index_operation_name", - "unique": false, - "columnNames": [ - "name" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_operation_name` ON `${TABLE_NAME}` (`name`)" - }, - { - "name": "index_operation_state", - "unique": false, - "columnNames": [ - "state" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_operation_state` ON `${TABLE_NAME}` (`state`)" - } - ], - "foreignKeys": [ - { - "table": "folder", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "folder" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "message", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "message" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "contact", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `account` INTEGER NOT NULL, `identity` INTEGER, `type` INTEGER NOT NULL, `email` TEXT NOT NULL, `name` TEXT, `group` TEXT, `avatar` TEXT, `times_contacted` INTEGER NOT NULL, `first_contacted` INTEGER NOT NULL, `last_contacted` INTEGER NOT NULL, `state` INTEGER NOT NULL, FOREIGN KEY(`account`) REFERENCES `account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "account", - "columnName": "account", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "identity", - "columnName": "identity", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "type", - "columnName": "type", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "email", - "columnName": "email", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "group", - "columnName": "group", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "avatar", - "columnName": "avatar", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "times_contacted", - "columnName": "times_contacted", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "first_contacted", - "columnName": "first_contacted", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "last_contacted", - "columnName": "last_contacted", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "state", - "columnName": "state", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_contact_account_type_email", - "unique": true, - "columnNames": [ - "account", - "type", - "email" - ], - "orders": [], - "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_contact_account_type_email` ON `${TABLE_NAME}` (`account`, `type`, `email`)" - }, - { - "name": "index_contact_email", - "unique": false, - "columnNames": [ - "email" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_contact_email` ON `${TABLE_NAME}` (`email`)" - }, - { - "name": "index_contact_name", - "unique": false, - "columnNames": [ - "name" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_contact_name` ON `${TABLE_NAME}` (`name`)" - }, - { - "name": "index_contact_avatar", - "unique": false, - "columnNames": [ - "avatar" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_contact_avatar` ON `${TABLE_NAME}` (`avatar`)" - }, - { - "name": "index_contact_times_contacted", - "unique": false, - "columnNames": [ - "times_contacted" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_contact_times_contacted` ON `${TABLE_NAME}` (`times_contacted`)" - }, - { - "name": "index_contact_last_contacted", - "unique": false, - "columnNames": [ - "last_contacted" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_contact_last_contacted` ON `${TABLE_NAME}` (`last_contacted`)" - }, - { - "name": "index_contact_state", - "unique": false, - "columnNames": [ - "state" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_contact_state` ON `${TABLE_NAME}` (`state`)" - } - ], - "foreignKeys": [ - { - "table": "account", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "account" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "certificate", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `fingerprint` TEXT NOT NULL, `intermediate` INTEGER NOT NULL, `email` TEXT NOT NULL, `subject` TEXT, `after` INTEGER, `before` INTEGER, `data` TEXT NOT NULL)", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "fingerprint", - "columnName": "fingerprint", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "intermediate", - "columnName": "intermediate", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "email", - "columnName": "email", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "subject", - "columnName": "subject", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "after", - "columnName": "after", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "before", - "columnName": "before", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "data", - "columnName": "data", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_certificate_fingerprint_email", - "unique": true, - "columnNames": [ - "fingerprint", - "email" - ], - "orders": [], - "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_certificate_fingerprint_email` ON `${TABLE_NAME}` (`fingerprint`, `email`)" - }, - { - "name": "index_certificate_email", - "unique": false, - "columnNames": [ - "email" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_certificate_email` ON `${TABLE_NAME}` (`email`)" - } - ], - "foreignKeys": [] - }, - { - "tableName": "answer", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `uuid` TEXT NOT NULL, `name` TEXT NOT NULL, `group` TEXT, `standard` INTEGER NOT NULL, `receipt` INTEGER NOT NULL, `favorite` INTEGER NOT NULL, `snippet` INTEGER NOT NULL, `hide` INTEGER NOT NULL, `external` INTEGER NOT NULL, `color` INTEGER, `text` TEXT NOT NULL, `applied` INTEGER NOT NULL, `last_applied` INTEGER)", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "uuid", - "columnName": "uuid", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "group", - "columnName": "group", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "standard", - "columnName": "standard", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "receipt", - "columnName": "receipt", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "favorite", - "columnName": "favorite", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "snippet", - "columnName": "snippet", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "hide", - "columnName": "hide", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "external", - "columnName": "external", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "color", - "columnName": "color", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "text", - "columnName": "text", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "applied", - "columnName": "applied", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "last_applied", - "columnName": "last_applied", - "affinity": "INTEGER", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [], - "foreignKeys": [] - }, - { - "tableName": "rule", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `uuid` TEXT NOT NULL, `folder` INTEGER NOT NULL, `name` TEXT NOT NULL, `order` INTEGER NOT NULL, `enabled` INTEGER NOT NULL, `daily` INTEGER NOT NULL, `stop` INTEGER NOT NULL, `condition` TEXT NOT NULL, `action` TEXT NOT NULL, `applied` INTEGER NOT NULL, `last_applied` INTEGER, FOREIGN KEY(`folder`) REFERENCES `folder`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "uuid", - "columnName": "uuid", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "folder", - "columnName": "folder", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "order", - "columnName": "order", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "enabled", - "columnName": "enabled", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "daily", - "columnName": "daily", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "stop", - "columnName": "stop", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "condition", - "columnName": "condition", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "action", - "columnName": "action", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "applied", - "columnName": "applied", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "last_applied", - "columnName": "last_applied", - "affinity": "INTEGER", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_rule_folder", - "unique": false, - "columnNames": [ - "folder" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_rule_folder` ON `${TABLE_NAME}` (`folder`)" - }, - { - "name": "index_rule_order", - "unique": false, - "columnNames": [ - "order" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_rule_order` ON `${TABLE_NAME}` (`order`)" - } - ], - "foreignKeys": [ - { - "table": "folder", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "folder" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "search", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `account_uuid` TEXT, `folder_name` TEXT, `name` TEXT NOT NULL, `order` INTEGER, `color` INTEGER, `data` TEXT NOT NULL)", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "account_uuid", - "columnName": "account_uuid", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "folder_name", - "columnName": "folder_name", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "order", - "columnName": "order", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "color", - "columnName": "color", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "data", - "columnName": "data", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [], - "foreignKeys": [] - }, - { - "tableName": "log", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `time` INTEGER NOT NULL, `type` INTEGER NOT NULL, `account` INTEGER, `folder` INTEGER, `message` INTEGER, `data` TEXT NOT NULL)", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "time", - "columnName": "time", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "type", - "columnName": "type", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "account", - "columnName": "account", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "folder", - "columnName": "folder", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "message", - "columnName": "message", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "data", - "columnName": "data", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_log_time", - "unique": false, - "columnNames": [ - "time" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_log_time` ON `${TABLE_NAME}` (`time`)" - } - ], - "foreignKeys": [] - }, - { - "tableName": "sync", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `entity` TEXT NOT NULL, `reference` TEXT, `action` TEXT NOT NULL, `time` INTEGER NOT NULL)", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "entity", - "columnName": "entity", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "reference", - "columnName": "reference", - "affinity": "TEXT", - "notNull": false - }, - { - "fieldPath": "action", - "columnName": "action", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "time", - "columnName": "time", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": true - }, - "indices": [ - { - "name": "index_sync_entity_reference", - "unique": false, - "columnNames": [ - "entity", - "reference" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sync_entity_reference` ON `${TABLE_NAME}` (`entity`, `reference`)" - }, - { - "name": "index_sync_time", - "unique": false, - "columnNames": [ - "time" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sync_time` ON `${TABLE_NAME}` (`time`)" - } - ], - "foreignKeys": [] - } - ], - "views": [ - { - "viewName": "account_view", - "createSql": "CREATE VIEW `${VIEW_NAME}` AS SELECT id, pop, name, category, color, synchronize, notify, leave_deleted, auto_seen, created FROM account" - }, - { - "viewName": "identity_view", - "createSql": "CREATE VIEW `${VIEW_NAME}` AS SELECT id, name, email, account, display, color, synchronize FROM identity" - }, - { - "viewName": "folder_view", - "createSql": "CREATE VIEW `${VIEW_NAME}` AS SELECT id, account, name, type, inherited_type, display, color, unified, notify, read_only FROM folder" - } - ], - "setupQueries": [ - "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", - "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '8e31fcdf5c2bc6b64cd30a101ba4597e')" - ] - } -} \ No newline at end of file diff --git a/app/src/main/java/eu/faircode/email/CloudSync.java b/app/src/main/java/eu/faircode/email/CloudSync.java index 1ee29d818a..8c0cb3b4d4 100644 --- a/app/src/main/java/eu/faircode/email/CloudSync.java +++ b/app/src/main/java/eu/faircode/email/CloudSync.java @@ -19,11 +19,8 @@ package eu.faircode.email; Copyright 2018-2023 by Marcel Bokhorst (M66B) */ -import static eu.faircode.email.ServiceAuthenticator.AUTH_TYPE_PASSWORD; - import android.content.Context; import android.content.SharedPreferences; -import android.text.TextUtils; import android.util.Base64; import android.util.Pair; @@ -47,10 +44,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; @@ -84,12 +79,6 @@ public class CloudSync { long lrevision = prefs.getLong("sync_status", new Date().getTime()); Log.i("Cloud local revision=" + lrevision + " (" + new Date(lrevision) + ")"); - Long lastUpdate = getLastUpdate(context); - Log.i("Cloud last update=" + (lastUpdate == null ? null : new Date(lastUpdate))); - if (lastUpdate != null && lrevision > lastUpdate) - Log.w("Cloud invalid local revision" + - " lrevision=" + lrevision + " last=" + lastUpdate); - JSONObject jsyncstatus = new JSONObject(); jsyncstatus.put("key", "sync.status"); jsyncstatus.put("rev", lrevision); @@ -104,7 +93,6 @@ public class CloudSync { if (jitems.length() == 0) { Log.i("Cloud server is empty"); - sendLocalData(context, user, password, lrevision); } else if (jitems.length() == 1) { Log.i("Cloud sync check"); jsyncstatus = jitems.getJSONObject(0); @@ -113,33 +101,9 @@ public class CloudSync { int sync_version = jstatus.optInt("sync.version", 0); int app_version = jstatus.optInt("app.version", 0); Log.i("Cloud version sync=" + sync_version + " app=" + app_version + - " local=" + lrevision + " last=" + lastUpdate + " remote=" + rrevision); - - // last > local (local mods) && remote > local (remote mods) = CONFLICT - // local > last = ignorable ERROR - // remote > local = fetch remote - // last > remote = send local - - if (lastUpdate != null && lastUpdate > rrevision) // local newer than remote - sendLocalData(context, user, password, lastUpdate); - else if (rrevision > lrevision) // remote changes - if (lastUpdate != null && lastUpdate > lrevision) { // local changes - Log.w("Cloud conflict" + - " lrevision=" + lrevision + " last=" + lastUpdate + " rrevision=" + rrevision); - if (manual) - if (lastUpdate >= rrevision) - sendLocalData(context, user, password, lastUpdate); - else - receiveRemoteData(context, user, password, lrevision, jstatus); - } else - receiveRemoteData(context, user, password, lrevision, jstatus); - else if (BuildConfig.DEBUG) - receiveRemoteData(context, user, password, lrevision - 1, jstatus); + " local=" + lrevision + " remote=" + rrevision); } else throw new IllegalArgumentException("Expected one status item"); - - if (lastUpdate != null) - db.sync().deleteSyncByTime(lastUpdate); } else { JSONArray jitems = new JSONArray(); jrequest.put("items", jitems); @@ -149,411 +113,6 @@ public class CloudSync { prefs.edit().putLong("cloud_last_sync", new Date().getTime()).apply(); } - private static Long getLastUpdate(Context context) { - DB db = DB.getInstance(context); - - Long lastUpdate = null; - - for (EntitySync sync : db.sync().getSync(null, null, Long.MAX_VALUE)) { - Log.i("Cloud sync " + sync.entity + ":" + sync.reference + " " + sync.action + " " + new Date(sync.time)); - if (sync.reference == null) { - Log.w("Cloud reference missing"); - db.sync().deleteSync(sync.id); - continue; - } - - if ("account".equals(sync.entity) && "auth".equals(sync.action)) { - EntityAccount account = db.account().getAccountByUUID(sync.reference); - if (account == null || account.auth_type != AUTH_TYPE_PASSWORD) { - if (account == null) - Log.w("Cloud account missing uuid=" + sync.reference); - else - Log.i("Cloud account oauth uuid=" + sync.reference); - db.sync().deleteSync(sync.id); - continue; - } - } - - if ("identity".equals(sync.entity) && "auth".equals(sync.action)) { - EntityIdentity identity = db.identity().getIdentityByUUID(sync.reference); - if (identity == null || identity.auth_type != AUTH_TYPE_PASSWORD) { - if (identity == null) - Log.w("Cloud identity missing uuid=" + sync.reference); - else - Log.i("Cloud identity oauth uuid=" + sync.reference); - db.sync().deleteSync(sync.id); - continue; - } - } - - if (lastUpdate == null || sync.time > lastUpdate) - lastUpdate = sync.time; - } - - return lastUpdate; - } - - private static void sendLocalData(Context context, String user, String password, long lrevision) - throws JSONException, GeneralSecurityException, IOException { - DB db = DB.getInstance(context); - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); - - List accounts = db.account().getSynchronizingAccounts(null); - Log.i("Cloud accounts=" + (accounts == null ? null : accounts.size())); - if (accounts == null || accounts.size() == 0) { - Log.i("Cloud no accounts"); - return; - } - - JSONArray jupload = new JSONArray(); - - JSONArray jaccountuuidlist = new JSONArray(); - for (EntityAccount account : accounts) - if (!TextUtils.isEmpty(account.uuid)) { - jaccountuuidlist.put(account.uuid); - - JSONArray jidentitieuuids = new JSONArray(); - List identities = db.identity().getIdentities(account.id); - if (identities != null) - for (EntityIdentity identity : identities) - if (!TextUtils.isEmpty(identity.uuid)) { - jidentitieuuids.put(identity.uuid); - - JSONObject jidentity = new JSONObject(); - jidentity.put("key", "identity." + identity.uuid); - jidentity.put("val", toJSON(identity).toString()); - jidentity.put("rev", lrevision); - jupload.put(jidentity); - } - - JSONObject jaccountdata = new JSONObject(); - jaccountdata.put("account", toJSON(account)); - jaccountdata.put("identities", jidentitieuuids); - - JSONObject jaccount = new JSONObject(); - jaccount.put("key", "account." + account.uuid); - jaccount.put("val", jaccountdata.toString()); - jaccount.put("rev", lrevision); - jupload.put(jaccount); - } - - JSONObject jaccountuuids = new JSONObject(); - jaccountuuids.put("uuids", jaccountuuidlist); - - JSONObject jstatus = new JSONObject(); - jstatus.put("sync.version", 1); - jstatus.put("app.version", BuildConfig.VERSION_CODE); - jstatus.put("accounts", jaccountuuids); - - JSONObject jsyncstatus = new JSONObject(); - jsyncstatus.put("key", "sync.status"); - jsyncstatus.put("val", jstatus.toString()); - jsyncstatus.put("rev", lrevision); - jupload.put(jsyncstatus); - - JSONObject jrequest = new JSONObject(); - jrequest.put("items", jupload); - call(context, user, password, "write", jrequest); - - prefs.edit().putLong("sync_status", lrevision).apply(); - } - - private static void receiveRemoteData(Context context, String user, String password, long lrevision, JSONObject jstatus) - throws JSONException, GeneralSecurityException, IOException { - DB db = DB.getInstance(context); - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); - boolean sync_accounts = prefs.getBoolean("cloud_sync_accounts", true); - boolean sync_accounts_delete = prefs.getBoolean("cloud_sync_accounts_delete", false); - boolean sync_blocked_senders = prefs.getBoolean("cloud_sync_blocked_senders", true); - boolean sync_filter_rules = prefs.getBoolean("cloud_sync_filter_rules", true); - - // New revision - boolean updates = false; - JSONArray jdownload = new JSONArray(); - - // Get accounts - JSONObject jaccountstatus = jstatus.getJSONObject("accounts"); - JSONArray jaccountuuidlist = jaccountstatus.getJSONArray("uuids"); - for (int i = 0; i < jaccountuuidlist.length(); i++) { - String uuid = jaccountuuidlist.getString(i); - JSONObject jaccount = new JSONObject(); - jaccount.put("key", "account." + uuid); - jaccount.put("rev", lrevision); - jdownload.put(jaccount); - Log.i("Cloud account uuid=" + uuid); - } - - if (jdownload.length() > 0) { - Log.i("Cloud getting accounts"); - JSONObject jrequest = new JSONObject(); - jrequest.put("items", jdownload); - JSONObject jresponse = call(context, user, password, "sync", jrequest); - - // Process accounts - Log.i("Cloud processing accounts"); - JSONArray jitems = jresponse.getJSONArray("items"); - jdownload = new JSONArray(); - for (int i = 0; i < jitems.length(); i++) { - JSONObject jaccount = jitems.getJSONObject(i); - String value = jaccount.getString("val"); - long revision = jaccount.getLong("rev"); - - JSONObject jaccountdata = new JSONObject(value); - EntityAccount raccount = accountFromJSON(jaccountdata.getJSONObject("account")); - EntityAccount laccount = db.account().getAccountByUUID(raccount.uuid); - - JSONArray jidentities = jaccountdata.getJSONArray("identities"); - Log.i("Cloud account " + raccount.uuid + "=" + - (laccount == null ? "insert" : (areEqual(toJSON(raccount), toJSON(laccount)) ? "equal" : "update")) + - " rev=" + revision + - " identities=" + jidentities + - " size=" + value.length()); - - for (int j = 0; j < jidentities.length(); j++) { - JSONObject jidentity = new JSONObject(); - jidentity.put("key", "identity." + jidentities.getString(j)); - jidentity.put("rev", lrevision); - jdownload.put(jidentity); - } - } - - if (jdownload.length() > 0) { - // Get identities - Log.i("Cloud getting identities"); - jrequest.put("items", jdownload); - jresponse = call(context, user, password, "sync", jrequest); - - // Process identities - Log.i("Cloud processing identities"); - jitems = jresponse.getJSONArray("items"); - for (int i = 0; i < jitems.length(); i++) { - JSONObject jidentity = jitems.getJSONObject(i); - String value = jidentity.getString("val"); - long revision = jidentity.getLong("rev"); - EntityIdentity ridentity = identityFromJSON(new JSONObject(value)); - EntityIdentity lidentity = db.identity().getIdentityByUUID(ridentity.uuid); - - Log.i("Cloud identity " + ridentity.uuid + "=" + - (lidentity == null ? "insert" : (areEqual(toJSON(ridentity), toJSON(lidentity)) ? "equal" : "update")) + - " rev=" + revision + - " size=" + value.length()); - } - } - } - - prefs.edit().putLong("sync_status", lrevision).apply(); - - if (updates) - ServiceSynchronize.reload(context, null, true, "sync"); - } - - private static boolean areEqual(JSONObject o1, JSONObject o2) throws JSONException { - if (o1 == null && o2 == null) - return true; - if (o1 == null || o2 == null) - return false; - - Iterator i1 = o1.keys(); - while (i1.hasNext()) { - String k1 = i1.next(); - if (!o2.has(k1)) - return false; - } - - Iterator i2 = o2.keys(); - while (i2.hasNext()) { - String k2 = i2.next(); - if (!o2.has(k2)) - return false; - if (!Objects.equals(o1.get(k2), o2.get(k2))) - return false; - } - - return true; - } - - private static JSONObject toJSON(EntityAccount account) throws JSONException { - JSONObject json = new JSONObject(); - if (account == null) - return json; - //json.put("id", id); - json.put("uuid", account.uuid); - //json.put("order", order); - json.put("protocol", account.protocol); - json.put("host", account.host); - json.put("encryption", account.encryption); - json.put("insecure", account.insecure); - json.put("port", account.port); - json.put("auth_type", account.auth_type); - json.put("provider", account.provider); - json.put("user", account.user); - json.put("password", account.password); - //json.put("certificate_alias", certificate_alias); - json.put("realm", account.realm); - json.put("fingerprint", account.fingerprint); - - //json.put("name", name); - //json.put("category", category); - //json.put("color", color); - //json.put("calendar", calendar); - - //json.put("synchronize", synchronize); - //json.put("ondemand", ondemand); - //json.put("poll_exempted", poll_exempted); - //json.put("primary", primary); - //json.put("notify", notify); - //json.put("browse", browse); - //json.put("leave_on_server", leave_on_server); - //json.put("leave_deleted", leave_deleted); - //json.put("leave_on_device", leave_on_device); - //json.put("max_messages", max_messages); - //json.put("auto_seen", auto_seen); - // not separator - - //json.put("swipe_left", swipe_left); - //json.put("swipe_right", swipe_right); - - //json.put("move_to", move_to); - - json.put("poll_interval", account.poll_interval); - json.put("keep_alive_noop", account.keep_alive_noop); - json.put("partial_fetch", account.partial_fetch); - json.put("ignore_size", account.ignore_size); - json.put("use_date", account.use_date); - json.put("use_received", account.use_received); - json.put("unicode", account.unicode); - //json.put("conditions", conditions); - // not prefix - // not created - // not tbd - // not state - // not warning - // not error - // not last connected - return json; - } - - public static EntityAccount accountFromJSON(JSONObject json) throws JSONException { - EntityAccount account = new EntityAccount(); - account.uuid = json.getString("uuid"); - if (json.has("protocol")) - account.protocol = json.getInt("protocol"); - - account.host = json.getString("host"); - account.encryption = json.getInt("encryption"); - account.insecure = (json.has("insecure") && json.getBoolean("insecure")); - account.port = json.getInt("port"); - account.auth_type = json.getInt("auth_type"); - if (json.has("provider") && !json.isNull("provider")) - account.provider = json.getString("provider"); - account.user = json.getString("user"); - account.password = json.getString("password"); - if (json.has("realm") && !json.isNull("realm")) - account.realm = json.getString("realm"); - if (json.has("fingerprint") && !json.isNull("fingerprint")) - account.fingerprint = json.getString("fingerprint"); - - account.poll_interval = json.getInt("poll_interval"); - account.keep_alive_noop = json.optBoolean("keep_alive_noop"); - - account.partial_fetch = json.optBoolean("partial_fetch", true); - account.ignore_size = json.optBoolean("ignore_size", false); - account.use_date = json.optBoolean("use_date", false); - account.use_received = json.optBoolean("use_received", false); - account.unicode = json.optBoolean("unicode", false); - - return account; - } - - private static JSONObject toJSON(EntityIdentity identity) throws JSONException { - JSONObject json = new JSONObject(); - if (identity == null) - return json; - //json.put("id", id); - json.put("uuid", identity.uuid); - //json.put("name", name); - json.put("email", identity.email); - // not account - //json.put("display", display); - //if (color != null) - // json.put("color", color); - //TODO json.put("signature", signature); - - json.put("host", identity.host); - json.put("encryption", identity.encryption); - json.put("insecure", identity.insecure); - json.put("port", identity.port); - json.put("auth_type", identity.auth_type); - json.put("provider", identity.provider); - json.put("user", identity.user); - json.put("password", identity.password); - //json.put("certificate_alias", certificate_alias); - json.put("realm", identity.realm); - json.put("fingerprint", identity.fingerprint); - json.put("use_ip", identity.use_ip); - json.put("ehlo", identity.ehlo); - - //json.put("synchronize", synchronize); - //json.put("primary", primary); - //TODO json.put("self", self); - //TODO json.put("sender_extra", sender_extra); - //TODO json.put("sender_extra_name", sender_extra_name); - //TODO json.put("sender_extra_regex", sender_extra_regex); - - //json.put("replyto", replyto); - //json.put("cc", cc); - //json.put("bcc", bcc); - //json.put("internal", internal); - - json.put("unicode", identity.unicode); - json.put("octetmime", identity.octetmime); - // not plain_only - //json.put("sign_default", sign_default); - //json.put("encrypt_default", encrypt_default); - // not encrypt - // delivery_receipt - // read_receipt - // not store_sent - // not sent_folder - // not sign_key - // sign_key_alias - // not tbd - // not state - // not error - // not last_connected - // not max_size - return json; - } - - public static EntityIdentity identityFromJSON(JSONObject json) throws JSONException { - EntityIdentity identity = new EntityIdentity(); - identity.uuid = json.getString("uuid"); - identity.email = json.getString("email"); - - identity.host = json.getString("host"); - identity.encryption = json.getInt("encryption"); - identity.insecure = json.optBoolean("insecure"); - identity.port = json.getInt("port"); - identity.auth_type = json.getInt("auth_type"); - if (json.has("provider") && !json.isNull("provider")) - identity.provider = json.getString("provider"); - identity.user = json.getString("user"); - identity.password = json.getString("password"); - if (json.has("realm") && !json.isNull("realm")) - identity.realm = json.getString("realm"); - if (json.has("fingerprint") && !json.isNull("fingerprint")) - identity.fingerprint = json.getString("fingerprint"); - if (json.has("use_ip")) - identity.use_ip = json.getBoolean("use_ip"); - if (json.has("ehlo") && !json.isNull("ehlo")) - identity.ehlo = json.getString("ehlo"); - - identity.unicode = json.optBoolean("unicode"); - identity.octetmime = json.optBoolean("octetmime"); - - return identity; - } - // Lower level public static JSONObject call(Context context, String user, String password, String command, JSONObject jrequest) diff --git a/app/src/main/java/eu/faircode/email/DB.java b/app/src/main/java/eu/faircode/email/DB.java index 855cf69e4a..e832656c51 100644 --- a/app/src/main/java/eu/faircode/email/DB.java +++ b/app/src/main/java/eu/faircode/email/DB.java @@ -68,7 +68,7 @@ import javax.mail.internet.InternetAddress; // https://developer.android.com/topic/libraries/architecture/room.html @Database( - version = 262, + version = 261, entities = { EntityIdentity.class, EntityAccount.class, @@ -81,8 +81,7 @@ import javax.mail.internet.InternetAddress; EntityAnswer.class, EntityRule.class, EntitySearch.class, - EntityLog.class, - EntitySync.class + EntityLog.class }, views = { TupleAccountView.class, @@ -117,8 +116,6 @@ public abstract class DB extends RoomDatabase { public abstract DaoLog log(); - public abstract DaoSync sync(); - private static int sPid; private static Context sContext; private static DB sInstance; @@ -479,19 +476,9 @@ public abstract class DB extends RoomDatabase { Log.i("Get PRAGMA " + pragma + "="); } - if (BuildConfig.DEBUG) { + if (BuildConfig.DEBUG && false) { db.execSQL("DROP TRIGGER IF EXISTS `attachment_insert`"); db.execSQL("DROP TRIGGER IF EXISTS `attachment_delete`"); - - db.execSQL("DROP TRIGGER IF EXISTS `account_insert`"); - db.execSQL("DROP TRIGGER IF EXISTS `account_update`"); - db.execSQL("DROP TRIGGER IF EXISTS `account_auth`"); - db.execSQL("DROP TRIGGER IF EXISTS `account_delete`"); - - db.execSQL("DROP TRIGGER IF EXISTS `identity_insert`"); - db.execSQL("DROP TRIGGER IF EXISTS `identity_update`"); - db.execSQL("DROP TRIGGER IF EXISTS `identity_auth`"); - db.execSQL("DROP TRIGGER IF EXISTS `identity_delete`"); } createTriggers(db); @@ -553,72 +540,6 @@ public abstract class DB extends RoomDatabase { " AND OLD.encryption IS NULL" + " AND NOT ((OLD.disposition = 'inline' OR (OLD.related IS NOT 0 AND OLD.cid IS NOT NULL)) AND OLD.type IN (" + images + "));" + " END"); - - db.execSQL("CREATE TRIGGER IF NOT EXISTS account_insert" + - " AFTER INSERT ON account" + - " BEGIN" + - " INSERT INTO sync ('entity', 'reference', 'action', 'time')" + - " VALUES ('account', NEW.uuid, 'insert', strftime('%s') * 1000);" + - " END"); - - db.execSQL("CREATE TRIGGER IF NOT EXISTS account_update" + - " AFTER UPDATE" + - " OF host, encryption, insecure, port, realm, fingerprint" + - ", poll_interval, keep_alive_noop, partial_fetch, ignore_size, use_date, use_received, unicode" + - " ON account" + - " BEGIN" + - " INSERT INTO sync ('entity', 'reference', 'action', 'time')" + - " VALUES ('account', NEW.uuid, 'update', strftime('%s') * 1000);" + - " END"); - - db.execSQL("CREATE TRIGGER IF NOT EXISTS account_auth" + - " AFTER UPDATE" + - " OF auth_type, provider, `user`, password" + - " ON account" + - " BEGIN" + - " INSERT INTO sync ('entity', 'reference', 'action', 'time')" + - " VALUES ('account', NEW.uuid, 'auth', strftime('%s') * 1000);" + - " END"); - - db.execSQL("CREATE TRIGGER IF NOT EXISTS account_delete" + - " AFTER DELETE ON account" + - " BEGIN" + - " INSERT INTO sync ('entity', 'reference', 'action', 'time')" + - " VALUES ('account', OLD.uuid, 'delete', strftime('%s') * 1000);" + - " END"); - - db.execSQL("CREATE TRIGGER IF NOT EXISTS identity_insert" + - " AFTER INSERT ON identity" + - " BEGIN" + - " INSERT INTO sync ('entity', 'reference', 'action', 'time')" + - " VALUES ('identity', NEW.uuid, 'insert', strftime('%s') * 1000);" + - " END"); - - db.execSQL("CREATE TRIGGER IF NOT EXISTS identity_update" + - " AFTER UPDATE" + - " OF email, host, encryption, insecure, port, realm, fingerprint" + - ", use_ip, ehlo, unicode, octetmime" + - " ON identity" + - " BEGIN" + - " INSERT INTO sync ('entity', 'reference', 'action', 'time')" + - " VALUES ('identity', NEW.uuid, 'update', strftime('%s') * 1000);" + - " END"); - - db.execSQL("CREATE TRIGGER IF NOT EXISTS identity_auth" + - " AFTER UPDATE" + - " OF auth_type, provider, `user`, password" + - " ON identity" + - " BEGIN" + - " INSERT INTO sync ('entity', 'reference', 'action', 'time')" + - " VALUES ('identity', NEW.uuid, 'auth', strftime('%s') * 1000);" + - " END"); - - db.execSQL("CREATE TRIGGER IF NOT EXISTS identity_delete" + - " AFTER DELETE ON identity" + - " BEGIN" + - " INSERT INTO sync ('entity', 'reference', 'action', 'time')" + - " VALUES ('identity', OLD.uuid, 'delete', strftime('%s') * 1000);" + - " END"); } private static void logMigration(int startVersion, int endVersion) { @@ -2716,20 +2637,6 @@ public abstract class DB extends RoomDatabase { else db.execSQL("UPDATE `folder` SET `hide_seen` = 0"); } - }).addMigrations(new Migration(261, 262) { - @Override - public void migrate(@NonNull SupportSQLiteDatabase db) { - logMigration(startVersion, endVersion); - db.execSQL("CREATE TABLE `sync`" + - " (`id` INTEGER PRIMARY KEY AUTOINCREMENT" + - ", `entity` TEXT NOT NULL" + - ", `reference` TEXT" + - ", `action` TEXT NOT NULL" + - ", `time` INTEGER NOT NULL)"); - db.execSQL("CREATE INDEX IF NOT EXISTS `index_sync_entity_reference` ON `sync` (`entity`, `reference`)"); - db.execSQL("CREATE INDEX IF NOT EXISTS `index_sync_time` ON `sync` (`time`)"); - createTriggers(db); - } }).addMigrations(new Migration(998, 999) { @Override public void migrate(@NonNull SupportSQLiteDatabase db) { diff --git a/app/src/main/java/eu/faircode/email/DaoSync.java b/app/src/main/java/eu/faircode/email/DaoSync.java deleted file mode 100644 index bcf18516bf..0000000000 --- a/app/src/main/java/eu/faircode/email/DaoSync.java +++ /dev/null @@ -1,41 +0,0 @@ -package eu.faircode.email; - -/* - This file is part of FairEmail. - - FairEmail is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - FairEmail is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with FairEmail. If not, see . - - Copyright 2018-2023 by Marcel Bokhorst (M66B) -*/ - -import androidx.room.Dao; -import androidx.room.Query; - -import java.util.List; - -@Dao -public interface DaoSync { - @Query("SELECT * FROM sync" + - " WHERE (:entity IS NULL OR entity = :entity)" + - " AND (:reference IS NULL OR reference = :reference)" + - " AND time <= :time" + - " ORDER BY time") - List getSync(String entity, String reference, long time); - - @Query("DELETE FROM sync WHERE id= :id") - int deleteSync(long id); - - @Query("DELETE FROM sync WHERE time <= :time") - int deleteSyncByTime(long time); -} diff --git a/app/src/main/java/eu/faircode/email/EntitySync.java b/app/src/main/java/eu/faircode/email/EntitySync.java deleted file mode 100644 index b5e7da1b20..0000000000 --- a/app/src/main/java/eu/faircode/email/EntitySync.java +++ /dev/null @@ -1,49 +0,0 @@ -package eu.faircode.email; - -/* - This file is part of FairEmail. - - FairEmail is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - FairEmail is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with FairEmail. If not, see . - - Copyright 2018-2023 by Marcel Bokhorst (M66B) -*/ - -import androidx.annotation.NonNull; -import androidx.room.Entity; -import androidx.room.Index; -import androidx.room.PrimaryKey; - -@Entity( - tableName = EntitySync.TABLE_NAME, - foreignKeys = { - }, - indices = { - @Index(value = {"entity", "reference"}), - @Index(value = {"time"}) - } -) - -public class EntitySync { - static final String TABLE_NAME = "sync"; - - @PrimaryKey(autoGenerate = true) - public Long id; - @NonNull - public String entity; - public String reference; - @NonNull - public String action; - @NonNull - public Long time; -} diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsBackup.java b/app/src/main/java/eu/faircode/email/FragmentOptionsBackup.java index 252fa5b901..916d703906 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsBackup.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsBackup.java @@ -118,10 +118,7 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere private TextInputLayout tilPassword; private Button btnLogin; private TextView tvLogin; - private CheckBox cbAccounts; - private CheckBox cbAccountsDelete; private CheckBox cbBlockedSenders; - private CheckBox cbFilterRules; private ImageButton ibSync; private TextView tvLastSync; private Button btnLogout; @@ -162,10 +159,7 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere tilPassword = view.findViewById(R.id.tilPassword); btnLogin = view.findViewById(R.id.btnLogin); tvLogin = view.findViewById(R.id.tvLogin); - cbAccounts = view.findViewById(R.id.cbAccounts); - cbAccountsDelete = view.findViewById(R.id.cbAccountsDelete); cbBlockedSenders = view.findViewById(R.id.cbBlockedSenders); - cbFilterRules = view.findViewById(R.id.cbFilterRules); ibSync = view.findViewById(R.id.ibSync); tvLastSync = view.findViewById(R.id.tvLastSync); btnLogout = view.findViewById(R.id.btnLogout); @@ -212,21 +206,6 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere } }); - cbAccounts.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - prefs.edit().putBoolean("cloud_sync_accounts", isChecked).apply(); - cbAccountsDelete.setEnabled(isChecked); - } - }); - - cbAccountsDelete.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - prefs.edit().putBoolean("cloud_sync_accounts_delete", isChecked).apply(); - } - }); - cbBlockedSenders.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { @@ -234,13 +213,6 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere } }); - cbFilterRules.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { - prefs.edit().putBoolean("cloud_sync_filter_rules", isChecked).apply(); - } - }); - ibSync.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -266,11 +238,7 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere Helper.linkPro(tvCloudPro); prefs.registerOnSharedPreferenceChangeListener(this); - cbAccounts.setChecked(prefs.getBoolean("cloud_sync_accounts", true)); - cbAccountsDelete.setChecked(prefs.getBoolean("cloud_sync_accounts_delete", false)); - cbAccountsDelete.setEnabled(cbAccounts.isChecked()); cbBlockedSenders.setChecked(prefs.getBoolean("cloud_sync_blocked_senders", true)); - cbFilterRules.setChecked(prefs.getBoolean("cloud_sync_filter_rules", true)); onSharedPreferenceChanged(prefs, null); return view; diff --git a/app/src/main/res/layout/fragment_options_backup.xml b/app/src/main/res/layout/fragment_options_backup.xml index 77777d1217..76e6c1487f 100644 --- a/app/src/main/res/layout/fragment_options_backup.xml +++ b/app/src/main/res/layout/fragment_options_backup.xml @@ -303,38 +303,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvRegister" /> - - - - - - - - + app:layout_constraintTop_toBottomOf="@id/tvLogin" /> Login Logging in for the first time will automatically create an account Invalid username or password - Sync accounts - Delete accounts - Only the server configuration will be synchronized Sync blocked senders - Sync filter rules Last sync: %1$s Update settings Logout