diff --git a/app/schemas/de.jeanlucmakiola.agendula.data.tasks.room.TasksDatabase/7.json b/app/schemas/de.jeanlucmakiola.agendula.data.tasks.room.TasksDatabase/7.json index b2a704d..27309a6 100644 --- a/app/schemas/de.jeanlucmakiola.agendula.data.tasks.room.TasksDatabase/7.json +++ b/app/schemas/de.jeanlucmakiola.agendula.data.tasks.room.TasksDatabase/7.json @@ -2,7 +2,7 @@ "formatVersion": 1, "database": { "version": 7, - "identityHash": "6b4e1394949216ad24168835d260a73f", + "identityHash": "774919dbed9faffbddd3358514b60bdd", "entities": [ { "tableName": "accounts", @@ -770,11 +770,273 @@ ] } ] + }, + { + "tableName": "advanced_deleted", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `copy_id` INTEGER NOT NULL, `anchor` INTEGER NOT NULL, `alarms` TEXT NOT NULL DEFAULT '', `row_id` INTEGER NOT NULL, `row_list_id` INTEGER NOT NULL, `row_uid` TEXT NOT NULL, `row_href` TEXT, `row_etag` TEXT, `row_title` TEXT, `row_description` TEXT, `row_location` TEXT, `row_url` TEXT, `row_color` INTEGER, `row_categories` TEXT NOT NULL DEFAULT '', `row_status` INTEGER NOT NULL DEFAULT 0, `row_percent_complete` INTEGER, `row_completed_at` INTEGER, `row_priority` INTEGER NOT NULL DEFAULT 0, `row_classification` INTEGER, `row_dtstart` INTEGER, `row_due` INTEGER, `row_duration` TEXT, `row_is_all_day` INTEGER NOT NULL DEFAULT 0, `row_untimed` TEXT, `row_timezone` TEXT, `row_rrule` TEXT, `row_rdate` TEXT, `row_exdate` TEXT, `row_recurrence_id` INTEGER, `row_master_id` INTEGER, `row_parent_id` INTEGER, `row_sort_order` INTEGER NOT NULL DEFAULT 0, `row_created_at` INTEGER, `row_last_modified` INTEGER, `row_sequence` INTEGER NOT NULL DEFAULT 0, `row_is_dirty` INTEGER NOT NULL DEFAULT 0, `row_is_deleted` INTEGER NOT NULL DEFAULT 0, `row_unknown_properties` TEXT, `row_reminders_off` INTEGER NOT NULL DEFAULT 0, FOREIGN KEY(`copy_id`) REFERENCES `advanced_occurrences`(`copy_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "copyId", + "columnName": "copy_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "anchor", + "columnName": "anchor", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "alarms", + "columnName": "alarms", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "row.id", + "columnName": "row_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "row.listId", + "columnName": "row_list_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "row.uid", + "columnName": "row_uid", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "row.href", + "columnName": "row_href", + "affinity": "TEXT" + }, + { + "fieldPath": "row.etag", + "columnName": "row_etag", + "affinity": "TEXT" + }, + { + "fieldPath": "row.title", + "columnName": "row_title", + "affinity": "TEXT" + }, + { + "fieldPath": "row.description", + "columnName": "row_description", + "affinity": "TEXT" + }, + { + "fieldPath": "row.location", + "columnName": "row_location", + "affinity": "TEXT" + }, + { + "fieldPath": "row.url", + "columnName": "row_url", + "affinity": "TEXT" + }, + { + "fieldPath": "row.color", + "columnName": "row_color", + "affinity": "INTEGER" + }, + { + "fieldPath": "row.categories", + "columnName": "row_categories", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "row.status", + "columnName": "row_status", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "row.percentComplete", + "columnName": "row_percent_complete", + "affinity": "INTEGER" + }, + { + "fieldPath": "row.completedAt", + "columnName": "row_completed_at", + "affinity": "INTEGER" + }, + { + "fieldPath": "row.priority", + "columnName": "row_priority", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "row.classification", + "columnName": "row_classification", + "affinity": "INTEGER" + }, + { + "fieldPath": "row.dtstart", + "columnName": "row_dtstart", + "affinity": "INTEGER" + }, + { + "fieldPath": "row.due", + "columnName": "row_due", + "affinity": "INTEGER" + }, + { + "fieldPath": "row.duration", + "columnName": "row_duration", + "affinity": "TEXT" + }, + { + "fieldPath": "row.isAllDay", + "columnName": "row_is_all_day", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "row.untimed", + "columnName": "row_untimed", + "affinity": "TEXT" + }, + { + "fieldPath": "row.timezone", + "columnName": "row_timezone", + "affinity": "TEXT" + }, + { + "fieldPath": "row.rrule", + "columnName": "row_rrule", + "affinity": "TEXT" + }, + { + "fieldPath": "row.rdate", + "columnName": "row_rdate", + "affinity": "TEXT" + }, + { + "fieldPath": "row.exdate", + "columnName": "row_exdate", + "affinity": "TEXT" + }, + { + "fieldPath": "row.recurrenceId", + "columnName": "row_recurrence_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "row.masterId", + "columnName": "row_master_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "row.parentId", + "columnName": "row_parent_id", + "affinity": "INTEGER" + }, + { + "fieldPath": "row.sortOrder", + "columnName": "row_sort_order", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "row.createdAt", + "columnName": "row_created_at", + "affinity": "INTEGER" + }, + { + "fieldPath": "row.lastModified", + "columnName": "row_last_modified", + "affinity": "INTEGER" + }, + { + "fieldPath": "row.sequence", + "columnName": "row_sequence", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "row.isDirty", + "columnName": "row_is_dirty", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "row.isDeleted", + "columnName": "row_is_deleted", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "row.unknownProperties", + "columnName": "row_unknown_properties", + "affinity": "TEXT" + }, + { + "fieldPath": "row.remindersOff", + "columnName": "row_reminders_off", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_advanced_deleted_copy_id", + "unique": false, + "columnNames": [ + "copy_id" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_advanced_deleted_copy_id` ON `${TABLE_NAME}` (`copy_id`)" + } + ], + "foreignKeys": [ + { + "table": "advanced_occurrences", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "copy_id" + ], + "referencedColumns": [ + "copy_id" + ] + } + ] } ], "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, '6b4e1394949216ad24168835d260a73f')" + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '774919dbed9faffbddd3358514b60bdd')" ] } } \ No newline at end of file diff --git a/app/schemas/de.jeanlucmakiola.agendula.data.tasks.room.TasksDatabase/8.json b/app/schemas/de.jeanlucmakiola.agendula.data.tasks.room.TasksDatabase/8.json deleted file mode 100644 index d908766..0000000 --- a/app/schemas/de.jeanlucmakiola.agendula.data.tasks.room.TasksDatabase/8.json +++ /dev/null @@ -1,1042 +0,0 @@ -{ - "formatVersion": 1, - "database": { - "version": 8, - "identityHash": "774919dbed9faffbddd3358514b60bdd", - "entities": [ - { - "tableName": "accounts", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `display_name` TEXT NOT NULL, `principal_url` TEXT, `home_set_url` TEXT, `username` TEXT, `last_sync_at` INTEGER, `last_sync_error` TEXT, `label` TEXT)", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "displayName", - "columnName": "display_name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "principalUrl", - "columnName": "principal_url", - "affinity": "TEXT" - }, - { - "fieldPath": "homeSetUrl", - "columnName": "home_set_url", - "affinity": "TEXT" - }, - { - "fieldPath": "username", - "columnName": "username", - "affinity": "TEXT" - }, - { - "fieldPath": "lastSyncAt", - "columnName": "last_sync_at", - "affinity": "INTEGER" - }, - { - "fieldPath": "lastSyncError", - "columnName": "last_sync_error", - "affinity": "TEXT" - }, - { - "fieldPath": "label", - "columnName": "label", - "affinity": "TEXT" - } - ], - "primaryKey": { - "autoGenerate": true, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "task_lists", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT NOT NULL, `color` INTEGER NOT NULL, `account_id` INTEGER, `is_visible` INTEGER NOT NULL DEFAULT 1, `is_synced` INTEGER NOT NULL DEFAULT 1, `owner` TEXT, `is_read_only` INTEGER NOT NULL DEFAULT 0, `sort_order` INTEGER NOT NULL DEFAULT 0, `href` TEXT, `ctag` TEXT, `sync_token` TEXT, `is_dirty` INTEGER NOT NULL DEFAULT 0, FOREIGN KEY(`account_id`) REFERENCES `accounts`(`id`) ON UPDATE NO ACTION ON DELETE SET NULL )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "color", - "columnName": "color", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "accountId", - "columnName": "account_id", - "affinity": "INTEGER" - }, - { - "fieldPath": "isVisible", - "columnName": "is_visible", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "1" - }, - { - "fieldPath": "isSynced", - "columnName": "is_synced", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "1" - }, - { - "fieldPath": "owner", - "columnName": "owner", - "affinity": "TEXT" - }, - { - "fieldPath": "isReadOnly", - "columnName": "is_read_only", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "sortOrder", - "columnName": "sort_order", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "href", - "columnName": "href", - "affinity": "TEXT" - }, - { - "fieldPath": "ctag", - "columnName": "ctag", - "affinity": "TEXT" - }, - { - "fieldPath": "syncToken", - "columnName": "sync_token", - "affinity": "TEXT" - }, - { - "fieldPath": "isDirty", - "columnName": "is_dirty", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - } - ], - "primaryKey": { - "autoGenerate": true, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_task_lists_account_id", - "unique": false, - "columnNames": [ - "account_id" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_task_lists_account_id` ON `${TABLE_NAME}` (`account_id`)" - } - ], - "foreignKeys": [ - { - "table": "accounts", - "onDelete": "SET NULL", - "onUpdate": "NO ACTION", - "columns": [ - "account_id" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "tasks", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `list_id` INTEGER NOT NULL, `uid` TEXT NOT NULL, `href` TEXT, `etag` TEXT, `title` TEXT, `description` TEXT, `location` TEXT, `url` TEXT, `color` INTEGER, `categories` TEXT NOT NULL DEFAULT '', `status` INTEGER NOT NULL DEFAULT 0, `percent_complete` INTEGER, `completed_at` INTEGER, `priority` INTEGER NOT NULL DEFAULT 0, `classification` INTEGER, `dtstart` INTEGER, `due` INTEGER, `duration` TEXT, `is_all_day` INTEGER NOT NULL DEFAULT 0, `untimed` TEXT, `timezone` TEXT, `rrule` TEXT, `rdate` TEXT, `exdate` TEXT, `recurrence_id` INTEGER, `master_id` INTEGER, `parent_id` INTEGER, `sort_order` INTEGER NOT NULL DEFAULT 0, `created_at` INTEGER, `last_modified` INTEGER, `sequence` INTEGER NOT NULL DEFAULT 0, `is_dirty` INTEGER NOT NULL DEFAULT 0, `is_deleted` INTEGER NOT NULL DEFAULT 0, `unknown_properties` TEXT, `reminders_off` INTEGER NOT NULL DEFAULT 0, FOREIGN KEY(`list_id`) REFERENCES `task_lists`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`master_id`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`parent_id`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE SET NULL )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "listId", - "columnName": "list_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "uid", - "columnName": "uid", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "href", - "columnName": "href", - "affinity": "TEXT" - }, - { - "fieldPath": "etag", - "columnName": "etag", - "affinity": "TEXT" - }, - { - "fieldPath": "title", - "columnName": "title", - "affinity": "TEXT" - }, - { - "fieldPath": "description", - "columnName": "description", - "affinity": "TEXT" - }, - { - "fieldPath": "location", - "columnName": "location", - "affinity": "TEXT" - }, - { - "fieldPath": "url", - "columnName": "url", - "affinity": "TEXT" - }, - { - "fieldPath": "color", - "columnName": "color", - "affinity": "INTEGER" - }, - { - "fieldPath": "categories", - "columnName": "categories", - "affinity": "TEXT", - "notNull": true, - "defaultValue": "''" - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "percentComplete", - "columnName": "percent_complete", - "affinity": "INTEGER" - }, - { - "fieldPath": "completedAt", - "columnName": "completed_at", - "affinity": "INTEGER" - }, - { - "fieldPath": "priority", - "columnName": "priority", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "classification", - "columnName": "classification", - "affinity": "INTEGER" - }, - { - "fieldPath": "dtstart", - "columnName": "dtstart", - "affinity": "INTEGER" - }, - { - "fieldPath": "due", - "columnName": "due", - "affinity": "INTEGER" - }, - { - "fieldPath": "duration", - "columnName": "duration", - "affinity": "TEXT" - }, - { - "fieldPath": "isAllDay", - "columnName": "is_all_day", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "untimed", - "columnName": "untimed", - "affinity": "TEXT" - }, - { - "fieldPath": "timezone", - "columnName": "timezone", - "affinity": "TEXT" - }, - { - "fieldPath": "rrule", - "columnName": "rrule", - "affinity": "TEXT" - }, - { - "fieldPath": "rdate", - "columnName": "rdate", - "affinity": "TEXT" - }, - { - "fieldPath": "exdate", - "columnName": "exdate", - "affinity": "TEXT" - }, - { - "fieldPath": "recurrenceId", - "columnName": "recurrence_id", - "affinity": "INTEGER" - }, - { - "fieldPath": "masterId", - "columnName": "master_id", - "affinity": "INTEGER" - }, - { - "fieldPath": "parentId", - "columnName": "parent_id", - "affinity": "INTEGER" - }, - { - "fieldPath": "sortOrder", - "columnName": "sort_order", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "createdAt", - "columnName": "created_at", - "affinity": "INTEGER" - }, - { - "fieldPath": "lastModified", - "columnName": "last_modified", - "affinity": "INTEGER" - }, - { - "fieldPath": "sequence", - "columnName": "sequence", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "isDirty", - "columnName": "is_dirty", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "isDeleted", - "columnName": "is_deleted", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "unknownProperties", - "columnName": "unknown_properties", - "affinity": "TEXT" - }, - { - "fieldPath": "remindersOff", - "columnName": "reminders_off", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - } - ], - "primaryKey": { - "autoGenerate": true, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_tasks_list_id_is_deleted", - "unique": false, - "columnNames": [ - "list_id", - "is_deleted" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_list_id_is_deleted` ON `${TABLE_NAME}` (`list_id`, `is_deleted`)" - }, - { - "name": "index_tasks_parent_id", - "unique": false, - "columnNames": [ - "parent_id" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_parent_id` ON `${TABLE_NAME}` (`parent_id`)" - }, - { - "name": "index_tasks_master_id_recurrence_id", - "unique": false, - "columnNames": [ - "master_id", - "recurrence_id" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_master_id_recurrence_id` ON `${TABLE_NAME}` (`master_id`, `recurrence_id`)" - }, - { - "name": "index_tasks_is_dirty", - "unique": false, - "columnNames": [ - "is_dirty" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_is_dirty` ON `${TABLE_NAME}` (`is_dirty`)" - }, - { - "name": "index_tasks_list_id_uid_recurrence_id", - "unique": true, - "columnNames": [ - "list_id", - "uid", - "recurrence_id" - ], - "orders": [], - "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_tasks_list_id_uid_recurrence_id` ON `${TABLE_NAME}` (`list_id`, `uid`, `recurrence_id`)" - } - ], - "foreignKeys": [ - { - "table": "task_lists", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "list_id" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "master_id" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "tasks", - "onDelete": "SET NULL", - "onUpdate": "NO ACTION", - "columns": [ - "parent_id" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "task_alarms", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `task_id` INTEGER NOT NULL, `minutes_before` INTEGER NOT NULL, `reference` TEXT NOT NULL DEFAULT 'DUE', `message` TEXT, `uid` TEXT NOT NULL DEFAULT '', `raw` TEXT, FOREIGN KEY(`task_id`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "taskId", - "columnName": "task_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "minutesBefore", - "columnName": "minutes_before", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "reference", - "columnName": "reference", - "affinity": "TEXT", - "notNull": true, - "defaultValue": "'DUE'" - }, - { - "fieldPath": "message", - "columnName": "message", - "affinity": "TEXT" - }, - { - "fieldPath": "uid", - "columnName": "uid", - "affinity": "TEXT", - "notNull": true, - "defaultValue": "''" - }, - { - "fieldPath": "raw", - "columnName": "raw", - "affinity": "TEXT" - } - ], - "primaryKey": { - "autoGenerate": true, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_task_alarms_task_id", - "unique": false, - "columnNames": [ - "task_id" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_task_alarms_task_id` ON `${TABLE_NAME}` (`task_id`)" - } - ], - "foreignKeys": [ - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "task_id" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "advanced_occurrences", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`copy_id` INTEGER NOT NULL, `master_id` INTEGER NOT NULL, `anchor` INTEGER NOT NULL, `advanced_to` INTEGER NOT NULL, `prior_dtstart` INTEGER, `prior_due` INTEGER, `prior_status` INTEGER NOT NULL, `prior_percent_complete` INTEGER, `prior_completed_at` INTEGER, `spent` INTEGER NOT NULL, `rule_after` TEXT, `dropped_exdates` TEXT NOT NULL DEFAULT '', `from_override` INTEGER NOT NULL, `undoable` INTEGER NOT NULL DEFAULT 1, `settled` INTEGER NOT NULL DEFAULT 0, `reset_subtasks` TEXT NOT NULL DEFAULT '', PRIMARY KEY(`copy_id`), FOREIGN KEY(`copy_id`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`master_id`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "copyId", - "columnName": "copy_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "masterId", - "columnName": "master_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "anchor", - "columnName": "anchor", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "advancedTo", - "columnName": "advanced_to", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "priorDtstart", - "columnName": "prior_dtstart", - "affinity": "INTEGER" - }, - { - "fieldPath": "priorDue", - "columnName": "prior_due", - "affinity": "INTEGER" - }, - { - "fieldPath": "priorStatus", - "columnName": "prior_status", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "priorPercentComplete", - "columnName": "prior_percent_complete", - "affinity": "INTEGER" - }, - { - "fieldPath": "priorCompletedAt", - "columnName": "prior_completed_at", - "affinity": "INTEGER" - }, - { - "fieldPath": "spent", - "columnName": "spent", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "ruleAfter", - "columnName": "rule_after", - "affinity": "TEXT" - }, - { - "fieldPath": "droppedExdates", - "columnName": "dropped_exdates", - "affinity": "TEXT", - "notNull": true, - "defaultValue": "''" - }, - { - "fieldPath": "fromOverride", - "columnName": "from_override", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "undoable", - "columnName": "undoable", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "1" - }, - { - "fieldPath": "settled", - "columnName": "settled", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "resetSubtasks", - "columnName": "reset_subtasks", - "affinity": "TEXT", - "notNull": true, - "defaultValue": "''" - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "copy_id" - ] - }, - "indices": [ - { - "name": "index_advanced_occurrences_master_id_anchor", - "unique": false, - "columnNames": [ - "master_id", - "anchor" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_advanced_occurrences_master_id_anchor` ON `${TABLE_NAME}` (`master_id`, `anchor`)" - } - ], - "foreignKeys": [ - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "copy_id" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "master_id" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "advanced_detached", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `copy_id` INTEGER NOT NULL, `anchor` INTEGER NOT NULL, `task_id` INTEGER, FOREIGN KEY(`copy_id`) REFERENCES `advanced_occurrences`(`copy_id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`task_id`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE SET NULL )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "copyId", - "columnName": "copy_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "anchor", - "columnName": "anchor", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "taskId", - "columnName": "task_id", - "affinity": "INTEGER" - } - ], - "primaryKey": { - "autoGenerate": true, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_advanced_detached_copy_id", - "unique": false, - "columnNames": [ - "copy_id" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_advanced_detached_copy_id` ON `${TABLE_NAME}` (`copy_id`)" - }, - { - "name": "index_advanced_detached_task_id", - "unique": false, - "columnNames": [ - "task_id" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_advanced_detached_task_id` ON `${TABLE_NAME}` (`task_id`)" - } - ], - "foreignKeys": [ - { - "table": "advanced_occurrences", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "copy_id" - ], - "referencedColumns": [ - "copy_id" - ] - }, - { - "table": "tasks", - "onDelete": "SET NULL", - "onUpdate": "NO ACTION", - "columns": [ - "task_id" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "advanced_deleted", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `copy_id` INTEGER NOT NULL, `anchor` INTEGER NOT NULL, `alarms` TEXT NOT NULL DEFAULT '', `row_id` INTEGER NOT NULL, `row_list_id` INTEGER NOT NULL, `row_uid` TEXT NOT NULL, `row_href` TEXT, `row_etag` TEXT, `row_title` TEXT, `row_description` TEXT, `row_location` TEXT, `row_url` TEXT, `row_color` INTEGER, `row_categories` TEXT NOT NULL DEFAULT '', `row_status` INTEGER NOT NULL DEFAULT 0, `row_percent_complete` INTEGER, `row_completed_at` INTEGER, `row_priority` INTEGER NOT NULL DEFAULT 0, `row_classification` INTEGER, `row_dtstart` INTEGER, `row_due` INTEGER, `row_duration` TEXT, `row_is_all_day` INTEGER NOT NULL DEFAULT 0, `row_untimed` TEXT, `row_timezone` TEXT, `row_rrule` TEXT, `row_rdate` TEXT, `row_exdate` TEXT, `row_recurrence_id` INTEGER, `row_master_id` INTEGER, `row_parent_id` INTEGER, `row_sort_order` INTEGER NOT NULL DEFAULT 0, `row_created_at` INTEGER, `row_last_modified` INTEGER, `row_sequence` INTEGER NOT NULL DEFAULT 0, `row_is_dirty` INTEGER NOT NULL DEFAULT 0, `row_is_deleted` INTEGER NOT NULL DEFAULT 0, `row_unknown_properties` TEXT, `row_reminders_off` INTEGER NOT NULL DEFAULT 0, FOREIGN KEY(`copy_id`) REFERENCES `advanced_occurrences`(`copy_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "copyId", - "columnName": "copy_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "anchor", - "columnName": "anchor", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "alarms", - "columnName": "alarms", - "affinity": "TEXT", - "notNull": true, - "defaultValue": "''" - }, - { - "fieldPath": "row.id", - "columnName": "row_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "row.listId", - "columnName": "row_list_id", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "row.uid", - "columnName": "row_uid", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "row.href", - "columnName": "row_href", - "affinity": "TEXT" - }, - { - "fieldPath": "row.etag", - "columnName": "row_etag", - "affinity": "TEXT" - }, - { - "fieldPath": "row.title", - "columnName": "row_title", - "affinity": "TEXT" - }, - { - "fieldPath": "row.description", - "columnName": "row_description", - "affinity": "TEXT" - }, - { - "fieldPath": "row.location", - "columnName": "row_location", - "affinity": "TEXT" - }, - { - "fieldPath": "row.url", - "columnName": "row_url", - "affinity": "TEXT" - }, - { - "fieldPath": "row.color", - "columnName": "row_color", - "affinity": "INTEGER" - }, - { - "fieldPath": "row.categories", - "columnName": "row_categories", - "affinity": "TEXT", - "notNull": true, - "defaultValue": "''" - }, - { - "fieldPath": "row.status", - "columnName": "row_status", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "row.percentComplete", - "columnName": "row_percent_complete", - "affinity": "INTEGER" - }, - { - "fieldPath": "row.completedAt", - "columnName": "row_completed_at", - "affinity": "INTEGER" - }, - { - "fieldPath": "row.priority", - "columnName": "row_priority", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "row.classification", - "columnName": "row_classification", - "affinity": "INTEGER" - }, - { - "fieldPath": "row.dtstart", - "columnName": "row_dtstart", - "affinity": "INTEGER" - }, - { - "fieldPath": "row.due", - "columnName": "row_due", - "affinity": "INTEGER" - }, - { - "fieldPath": "row.duration", - "columnName": "row_duration", - "affinity": "TEXT" - }, - { - "fieldPath": "row.isAllDay", - "columnName": "row_is_all_day", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "row.untimed", - "columnName": "row_untimed", - "affinity": "TEXT" - }, - { - "fieldPath": "row.timezone", - "columnName": "row_timezone", - "affinity": "TEXT" - }, - { - "fieldPath": "row.rrule", - "columnName": "row_rrule", - "affinity": "TEXT" - }, - { - "fieldPath": "row.rdate", - "columnName": "row_rdate", - "affinity": "TEXT" - }, - { - "fieldPath": "row.exdate", - "columnName": "row_exdate", - "affinity": "TEXT" - }, - { - "fieldPath": "row.recurrenceId", - "columnName": "row_recurrence_id", - "affinity": "INTEGER" - }, - { - "fieldPath": "row.masterId", - "columnName": "row_master_id", - "affinity": "INTEGER" - }, - { - "fieldPath": "row.parentId", - "columnName": "row_parent_id", - "affinity": "INTEGER" - }, - { - "fieldPath": "row.sortOrder", - "columnName": "row_sort_order", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "row.createdAt", - "columnName": "row_created_at", - "affinity": "INTEGER" - }, - { - "fieldPath": "row.lastModified", - "columnName": "row_last_modified", - "affinity": "INTEGER" - }, - { - "fieldPath": "row.sequence", - "columnName": "row_sequence", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "row.isDirty", - "columnName": "row_is_dirty", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "row.isDeleted", - "columnName": "row_is_deleted", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - }, - { - "fieldPath": "row.unknownProperties", - "columnName": "row_unknown_properties", - "affinity": "TEXT" - }, - { - "fieldPath": "row.remindersOff", - "columnName": "row_reminders_off", - "affinity": "INTEGER", - "notNull": true, - "defaultValue": "0" - } - ], - "primaryKey": { - "autoGenerate": true, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_advanced_deleted_copy_id", - "unique": false, - "columnNames": [ - "copy_id" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_advanced_deleted_copy_id` ON `${TABLE_NAME}` (`copy_id`)" - } - ], - "foreignKeys": [ - { - "table": "advanced_occurrences", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "copy_id" - ], - "referencedColumns": [ - "copy_id" - ] - } - ] - } - ], - "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, '774919dbed9faffbddd3358514b60bdd')" - ] - } -} \ No newline at end of file diff --git a/app/src/androidTest/java/de/jeanlucmakiola/agendula/data/tasks/room/TasksDatabaseMigrationTest.kt b/app/src/androidTest/java/de/jeanlucmakiola/agendula/data/tasks/room/TasksDatabaseMigrationTest.kt index 5e5f035..3e1627a 100644 --- a/app/src/androidTest/java/de/jeanlucmakiola/agendula/data/tasks/room/TasksDatabaseMigrationTest.kt +++ b/app/src/androidTest/java/de/jeanlucmakiola/agendula/data/tasks/room/TasksDatabaseMigrationTest.kt @@ -194,7 +194,7 @@ class TasksDatabaseMigrationTest { } @Test - fun leavesExistingTasksWithBothEndsAsTheyWere() { + fun keepsExistingTasksAndAddsAnEmptyTableForDeletedOverrides() { helper.createDatabase(TEST_DB, 6).use { db -> db.execSQL("INSERT INTO task_lists (id, name, color) VALUES (1, 'Personal', 0)") db.execSQL("INSERT INTO tasks (id, list_id, uid, dtstart, due, is_all_day) VALUES (1, 1, 'a', 0, 3600000, 0)") @@ -207,14 +207,6 @@ class TasksDatabaseMigrationTest { assertThat(c.getLong(1)).isEqualTo(0L) assertThat(c.getLong(2)).isEqualTo(3_600_000L) } - } - } - - @Test - fun addsAnEmptyTableForDeletedOverrides() { - helper.createDatabase(TEST_DB, 7).close() - - helper.runMigrationsAndValidate(TEST_DB, 8, true, TasksDatabase.MIGRATION_7_8).use { db -> db.query("SELECT COUNT(*) FROM advanced_deleted").use { c -> assertThat(c.moveToFirst()).isTrue() assertThat(c.getInt(0)).isEqualTo(0) diff --git a/app/src/main/java/de/jeanlucmakiola/agendula/data/di/DataModule.kt b/app/src/main/java/de/jeanlucmakiola/agendula/data/di/DataModule.kt index 1732f2b..6cf4785 100644 --- a/app/src/main/java/de/jeanlucmakiola/agendula/data/di/DataModule.kt +++ b/app/src/main/java/de/jeanlucmakiola/agendula/data/di/DataModule.kt @@ -89,7 +89,7 @@ object DataProvideModule { // backed-up `.db` does not. The backup rules carry all three files and // the app checkpoints on ON_STOP. .setJournalMode(RoomDatabase.JournalMode.WRITE_AHEAD_LOGGING) - .addMigrations(TasksDatabase.MIGRATION_1_2, TasksDatabase.MIGRATION_2_3, TasksDatabase.MIGRATION_3_4, TasksDatabase.MIGRATION_4_5, TasksDatabase.MIGRATION_5_6, TasksDatabase.MIGRATION_6_7, TasksDatabase.MIGRATION_7_8) + .addMigrations(TasksDatabase.MIGRATION_1_2, TasksDatabase.MIGRATION_2_3, TasksDatabase.MIGRATION_3_4, TasksDatabase.MIGRATION_4_5, TasksDatabase.MIGRATION_5_6, TasksDatabase.MIGRATION_6_7) .build() /** diff --git a/app/src/main/java/de/jeanlucmakiola/agendula/data/tasks/room/TasksDatabase.kt b/app/src/main/java/de/jeanlucmakiola/agendula/data/tasks/room/TasksDatabase.kt index 2f991e8..4156f8c 100644 --- a/app/src/main/java/de/jeanlucmakiola/agendula/data/tasks/room/TasksDatabase.kt +++ b/app/src/main/java/de/jeanlucmakiola/agendula/data/tasks/room/TasksDatabase.kt @@ -25,7 +25,7 @@ import kotlin.time.Instant AdvancedDetachedEntity::class, AdvancedDeletedEntity::class, ], - version = 8, + version = 7, exportSchema = true, ) @TypeConverters(Converters::class) @@ -213,16 +213,13 @@ abstract class TasksDatabase : RoomDatabase() { } } - /** v7 lets one end of a timed task go without a time (#101). */ + /** + * v7 lets one end of a timed task go without a time (#101) and keeps the open overrides a tick + * repeating from completion deleted, for its undo (#79). + */ val MIGRATION_6_7 = object : Migration(6, 7) { override fun migrate(db: SupportSQLiteDatabase) { db.execSQL("ALTER TABLE tasks ADD COLUMN `untimed` TEXT") - } - } - - /** v8 keeps the open overrides a tick repeating from completion deleted, for its undo (#79). */ - val MIGRATION_7_8 = object : Migration(7, 8) { - override fun migrate(db: SupportSQLiteDatabase) { db.execSQL( "CREATE TABLE IF NOT EXISTS `advanced_deleted` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `copy_id` INTEGER NOT NULL, `anchor` INTEGER NOT NULL, `alarms` TEXT NOT NULL DEFAULT '', `row_id` INTEGER NOT NULL, `row_list_id` INTEGER NOT NULL, `row_uid` TEXT NOT NULL, `row_href` TEXT, `row_etag` TEXT, `row_title` TEXT, `row_description` TEXT, `row_location` TEXT, `row_url` TEXT, `row_color` INTEGER, `row_categories` TEXT NOT NULL DEFAULT '', `row_status` INTEGER NOT NULL DEFAULT 0, `row_percent_complete` INTEGER, `row_completed_at` INTEGER, `row_priority` INTEGER NOT NULL DEFAULT 0, `row_classification` INTEGER, `row_dtstart` INTEGER, `row_due` INTEGER, `row_duration` TEXT, `row_is_all_day` INTEGER NOT NULL DEFAULT 0, `row_untimed` TEXT, `row_timezone` TEXT, `row_rrule` TEXT, `row_rdate` TEXT, `row_exdate` TEXT, `row_recurrence_id` INTEGER, `row_master_id` INTEGER, `row_parent_id` INTEGER, `row_sort_order` INTEGER NOT NULL DEFAULT 0, `row_created_at` INTEGER, `row_last_modified` INTEGER, `row_sequence` INTEGER NOT NULL DEFAULT 0, `row_is_dirty` INTEGER NOT NULL DEFAULT 0, `row_is_deleted` INTEGER NOT NULL DEFAULT 0, `row_unknown_properties` TEXT, `row_reminders_off` INTEGER NOT NULL DEFAULT 0, FOREIGN KEY(`copy_id`) REFERENCES `advanced_occurrences`(`copy_id`) ON UPDATE NO ACTION ON DELETE CASCADE )", )