diff --git a/core/database/schemas/com.awan.app.core.database.AwanDatabase/1.json b/core/database/schemas/com.awan.app.core.database.AwanDatabase/1.json index c87b4b9c..5e324792 100644 --- a/core/database/schemas/com.awan.app.core.database.AwanDatabase/1.json +++ b/core/database/schemas/com.awan.app.core.database.AwanDatabase/1.json @@ -2,11 +2,11 @@ "formatVersion": 1, "database": { "version": 1, - "identityHash": "4deb40bbb1b52534836e027dae3de36d", + "identityHash": "992ecd7c5630959737c670c515606372", "entities": [ { "tableName": "users", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `email` TEXT NOT NULL, `firstName` TEXT, `lastName` TEXT, `birthDate` TEXT, `points` INTEGER NOT NULL, `streak` INTEGER NOT NULL, `maxStreak` INTEGER NOT NULL, `profilePictureUrl` TEXT, `isNew` INTEGER NOT NULL, PRIMARY KEY(`id`))", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `email` TEXT NOT NULL, `firstName` TEXT, `lastName` TEXT, `birthDate` TEXT, `points` INTEGER NOT NULL, `streak` INTEGER NOT NULL, `maxStreak` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, `profilePictureUrl` TEXT, `isNew` INTEGER NOT NULL, PRIMARY KEY(`id`))", "fields": [ { "fieldPath": "id", @@ -53,6 +53,12 @@ "affinity": "INTEGER", "notNull": true }, + { + "fieldPath": "expiryTime", + "columnName": "expiryTime", + "affinity": "INTEGER", + "notNull": true + }, { "fieldPath": "profilePictureUrl", "columnName": "profilePictureUrl", @@ -152,7 +158,7 @@ }, { "tableName": "goals", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `status` TEXT NOT NULL, `targetDate` TEXT, `createdAt` TEXT NOT NULL, `isInbox` INTEGER NOT NULL, PRIMARY KEY(`id`))", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `status` TEXT NOT NULL, `targetDate` TEXT, `createdAt` TEXT NOT NULL, `isInbox` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", "fields": [ { "fieldPath": "id", @@ -193,6 +199,12 @@ "columnName": "isInbox", "affinity": "INTEGER", "notNull": true + }, + { + "fieldPath": "expiryTime", + "columnName": "expiryTime", + "affinity": "INTEGER", + "notNull": true } ], "primaryKey": { @@ -204,7 +216,7 @@ }, { "tableName": "tasks", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `estimatedDuration` INTEGER NOT NULL, `status` TEXT NOT NULL, `mandatory` INTEGER NOT NULL, `estimatedPoints` INTEGER NOT NULL, `allowTaskSplitting` INTEGER NOT NULL, `goalId` TEXT NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`goalId`) REFERENCES `goals`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `estimatedDuration` INTEGER NOT NULL, `status` TEXT NOT NULL, `mandatory` INTEGER NOT NULL, `estimatedPoints` INTEGER NOT NULL, `allowTaskSplitting` INTEGER NOT NULL, `goalId` TEXT, `categoryId` TEXT, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`categoryId`) REFERENCES `categories`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", "fields": [ { "fieldPath": "id", @@ -256,7 +268,17 @@ { "fieldPath": "goalId", "columnName": "goalId", - "affinity": "TEXT", + "affinity": "TEXT" + }, + { + "fieldPath": "categoryId", + "columnName": "categoryId", + "affinity": "TEXT" + }, + { + "fieldPath": "expiryTime", + "columnName": "expiryTime", + "affinity": "INTEGER", "notNull": true } ], @@ -275,15 +297,24 @@ ], "orders": [], "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_goalId` ON `${TABLE_NAME}` (`goalId`)" + }, + { + "name": "index_tasks_categoryId", + "unique": false, + "columnNames": [ + "categoryId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_categoryId` ON `${TABLE_NAME}` (`categoryId`)" } ], "foreignKeys": [ { - "table": "goals", + "table": "categories", "onDelete": "NO ACTION", "onUpdate": "NO ACTION", "columns": [ - "goalId" + "categoryId" ], "referencedColumns": [ "id" @@ -362,7 +393,7 @@ }, { "tableName": "templates", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY(`id`))", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", "fields": [ { "fieldPath": "id", @@ -375,6 +406,12 @@ "columnName": "name", "affinity": "TEXT", "notNull": true + }, + { + "fieldPath": "expiryTime", + "columnName": "expiryTime", + "affinity": "INTEGER", + "notNull": true } ], "primaryKey": { @@ -566,11 +603,325 @@ ] } ] + }, + { + "tableName": "categories", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `colorHex` TEXT, `icon` TEXT, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "colorHex", + "columnName": "colorHex", + "affinity": "TEXT" + }, + { + "fieldPath": "icon", + "columnName": "icon", + "affinity": "TEXT" + }, + { + "fieldPath": "expiryTime", + "columnName": "expiryTime", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + } + }, + { + "tableName": "sessions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `taskId` TEXT NOT NULL, `zoneId` TEXT, `date` TEXT NOT NULL, `startTime` TEXT NOT NULL, `endTime` TEXT NOT NULL, `status` TEXT NOT NULL, `locked` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`taskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "taskId", + "columnName": "taskId", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "zoneId", + "columnName": "zoneId", + "affinity": "TEXT" + }, + { + "fieldPath": "date", + "columnName": "date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "startTime", + "columnName": "startTime", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "endTime", + "columnName": "endTime", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "locked", + "columnName": "locked", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "expiryTime", + "columnName": "expiryTime", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "index_sessions_taskId", + "unique": false, + "columnNames": [ + "taskId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_taskId` ON `${TABLE_NAME}` (`taskId`)" + }, + { + "name": "index_sessions_zoneId", + "unique": false, + "columnNames": [ + "zoneId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_zoneId` ON `${TABLE_NAME}` (`zoneId`)" + }, + { + "name": "index_sessions_date", + "unique": false, + "columnNames": [ + "date" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_date` ON `${TABLE_NAME}` (`date`)" + } + ], + "foreignKeys": [ + { + "table": "tasks", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "taskId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "cached_schedule_dates", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`date` TEXT NOT NULL, `lastSyncedAt` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`date`))", + "fields": [ + { + "fieldPath": "date", + "columnName": "date", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "lastSyncedAt", + "columnName": "lastSyncedAt", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expiryTime", + "columnName": "expiryTime", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "date" + ] + } + }, + { + "tableName": "store_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `description` TEXT NOT NULL, `image` TEXT NOT NULL, `info` TEXT, `price` INTEGER NOT NULL, `version` TEXT NOT NULL, `type` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "name", + "columnName": "name", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "image", + "columnName": "image", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "info", + "columnName": "info", + "affinity": "TEXT" + }, + { + "fieldPath": "price", + "columnName": "price", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "version", + "columnName": "version", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expiryTime", + "columnName": "expiryTime", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + } + }, + { + "tableName": "owned_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `itemId` TEXT NOT NULL, `boughtAt` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "itemId", + "columnName": "itemId", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "boughtAt", + "columnName": "boughtAt", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expiryTime", + "columnName": "expiryTime", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + } + }, + { + "tableName": "equipped_items", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`type` TEXT NOT NULL, `itemId` TEXT NOT NULL, `equippedAt` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`type`))", + "fields": [ + { + "fieldPath": "type", + "columnName": "type", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "itemId", + "columnName": "itemId", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "equippedAt", + "columnName": "equippedAt", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "expiryTime", + "columnName": "expiryTime", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "type" + ] + } } ], "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, '4deb40bbb1b52534836e027dae3de36d')" + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '992ecd7c5630959737c670c515606372')" ] } } \ No newline at end of file diff --git a/core/database/schemas/com.awan.app.core.database.AwanDatabase/2.json b/core/database/schemas/com.awan.app.core.database.AwanDatabase/2.json deleted file mode 100644 index 05ad58b0..00000000 --- a/core/database/schemas/com.awan.app.core.database.AwanDatabase/2.json +++ /dev/null @@ -1,748 +0,0 @@ -{ - "formatVersion": 1, - "database": { - "version": 2, - "identityHash": "d68742e1a812da84c2fee06fa55db72b", - "entities": [ - { - "tableName": "users", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `email` TEXT NOT NULL, `firstName` TEXT, `lastName` TEXT, `birthDate` TEXT, `points` INTEGER NOT NULL, `streak` INTEGER NOT NULL, `maxStreak` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "email", - "columnName": "email", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "firstName", - "columnName": "firstName", - "affinity": "TEXT" - }, - { - "fieldPath": "lastName", - "columnName": "lastName", - "affinity": "TEXT" - }, - { - "fieldPath": "birthDate", - "columnName": "birthDate", - "affinity": "TEXT" - }, - { - "fieldPath": "points", - "columnName": "points", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "streak", - "columnName": "streak", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "maxStreak", - "columnName": "maxStreak", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "user_preferences", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `timezone` TEXT NOT NULL, `preferredSessionDuration` INTEGER NOT NULL, `bufferBetweenSessions` INTEGER NOT NULL, `wakeupTime` TEXT NOT NULL, `sleepTime` TEXT NOT NULL, `schedulingType` TEXT NOT NULL, PRIMARY KEY(`userId`), FOREIGN KEY(`userId`) REFERENCES `users`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "userId", - "columnName": "userId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "timezone", - "columnName": "timezone", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "preferredSessionDuration", - "columnName": "preferredSessionDuration", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "bufferBetweenSessions", - "columnName": "bufferBetweenSessions", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "wakeupTime", - "columnName": "wakeupTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "sleepTime", - "columnName": "sleepTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "schedulingType", - "columnName": "schedulingType", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "userId" - ] - }, - "indices": [ - { - "name": "index_user_preferences_userId", - "unique": false, - "columnNames": [ - "userId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_user_preferences_userId` ON `${TABLE_NAME}` (`userId`)" - } - ], - "foreignKeys": [ - { - "table": "users", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "userId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "goals", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `status` TEXT NOT NULL, `targetDate` TEXT, `createdAt` TEXT NOT NULL, `isInbox` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "title", - "columnName": "title", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "description", - "columnName": "description", - "affinity": "TEXT" - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "targetDate", - "columnName": "targetDate", - "affinity": "TEXT" - }, - { - "fieldPath": "createdAt", - "columnName": "createdAt", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "isInbox", - "columnName": "isInbox", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "tasks", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `estimatedDuration` INTEGER NOT NULL, `status` TEXT NOT NULL, `mandatory` INTEGER NOT NULL, `estimatedPoints` INTEGER NOT NULL, `allowTaskSplitting` INTEGER NOT NULL, `goalId` TEXT, `categoryId` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`goalId`) REFERENCES `goals`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION , FOREIGN KEY(`categoryId`) REFERENCES `categories`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "title", - "columnName": "title", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "description", - "columnName": "description", - "affinity": "TEXT" - }, - { - "fieldPath": "estimatedDuration", - "columnName": "estimatedDuration", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "mandatory", - "columnName": "mandatory", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "estimatedPoints", - "columnName": "estimatedPoints", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "allowTaskSplitting", - "columnName": "allowTaskSplitting", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "goalId", - "columnName": "goalId", - "affinity": "TEXT" - }, - { - "fieldPath": "categoryId", - "columnName": "categoryId", - "affinity": "TEXT" - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_tasks_goalId", - "unique": false, - "columnNames": [ - "goalId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_goalId` ON `${TABLE_NAME}` (`goalId`)" - }, - { - "name": "index_tasks_categoryId", - "unique": false, - "columnNames": [ - "categoryId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_categoryId` ON `${TABLE_NAME}` (`categoryId`)" - } - ], - "foreignKeys": [ - { - "table": "goals", - "onDelete": "NO ACTION", - "onUpdate": "NO ACTION", - "columns": [ - "goalId" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "categories", - "onDelete": "NO ACTION", - "onUpdate": "NO ACTION", - "columns": [ - "categoryId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "task_dependencies", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`taskId` TEXT NOT NULL, `dependsOnTaskId` TEXT NOT NULL, PRIMARY KEY(`taskId`, `dependsOnTaskId`), FOREIGN KEY(`taskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`dependsOnTaskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "taskId", - "columnName": "taskId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "dependsOnTaskId", - "columnName": "dependsOnTaskId", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "taskId", - "dependsOnTaskId" - ] - }, - "indices": [ - { - "name": "index_task_dependencies_taskId", - "unique": false, - "columnNames": [ - "taskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_task_dependencies_taskId` ON `${TABLE_NAME}` (`taskId`)" - }, - { - "name": "index_task_dependencies_dependsOnTaskId", - "unique": false, - "columnNames": [ - "dependsOnTaskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_task_dependencies_dependsOnTaskId` ON `${TABLE_NAME}` (`dependsOnTaskId`)" - } - ], - "foreignKeys": [ - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "taskId" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "dependsOnTaskId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "templates", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "template_days_of_week", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`dayOfWeek` TEXT NOT NULL, `templateId` TEXT NOT NULL, PRIMARY KEY(`dayOfWeek`), FOREIGN KEY(`templateId`) REFERENCES `templates`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "dayOfWeek", - "columnName": "dayOfWeek", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "templateId", - "columnName": "templateId", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "dayOfWeek" - ] - }, - "indices": [ - { - "name": "index_template_days_of_week_templateId", - "unique": false, - "columnNames": [ - "templateId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_template_days_of_week_templateId` ON `${TABLE_NAME}` (`templateId`)" - } - ], - "foreignKeys": [ - { - "table": "templates", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "template_overrides", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT, `dateOfDay` TEXT NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT" - }, - { - "fieldPath": "dateOfDay", - "columnName": "dateOfDay", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_template_overrides_dateOfDay", - "unique": true, - "columnNames": [ - "dateOfDay" - ], - "orders": [], - "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_template_overrides_dateOfDay` ON `${TABLE_NAME}` (`dateOfDay`)" - } - ] - }, - { - "tableName": "zones", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `startTime` TEXT NOT NULL, `endTime` TEXT NOT NULL, `color` TEXT, `templateId` TEXT, `templateOverrideId` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`templateId`) REFERENCES `templates`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`templateOverrideId`) REFERENCES `template_overrides`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "startTime", - "columnName": "startTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "endTime", - "columnName": "endTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "color", - "columnName": "color", - "affinity": "TEXT" - }, - { - "fieldPath": "templateId", - "columnName": "templateId", - "affinity": "TEXT" - }, - { - "fieldPath": "templateOverrideId", - "columnName": "templateOverrideId", - "affinity": "TEXT" - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_zones_templateId", - "unique": false, - "columnNames": [ - "templateId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_zones_templateId` ON `${TABLE_NAME}` (`templateId`)" - }, - { - "name": "index_zones_templateOverrideId", - "unique": false, - "columnNames": [ - "templateOverrideId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_zones_templateOverrideId` ON `${TABLE_NAME}` (`templateOverrideId`)" - } - ], - "foreignKeys": [ - { - "table": "templates", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateId" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "template_overrides", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateOverrideId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "categories", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `colorHex` TEXT, `icon` TEXT, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "colorHex", - "columnName": "colorHex", - "affinity": "TEXT" - }, - { - "fieldPath": "icon", - "columnName": "icon", - "affinity": "TEXT" - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "sessions", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `taskId` TEXT NOT NULL, `zoneId` TEXT, `date` TEXT NOT NULL, `startTime` TEXT NOT NULL, `endTime` TEXT NOT NULL, `status` TEXT NOT NULL, `locked` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`taskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "taskId", - "columnName": "taskId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "zoneId", - "columnName": "zoneId", - "affinity": "TEXT" - }, - { - "fieldPath": "date", - "columnName": "date", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "startTime", - "columnName": "startTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "endTime", - "columnName": "endTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "locked", - "columnName": "locked", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_sessions_taskId", - "unique": false, - "columnNames": [ - "taskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_taskId` ON `${TABLE_NAME}` (`taskId`)" - }, - { - "name": "index_sessions_zoneId", - "unique": false, - "columnNames": [ - "zoneId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_zoneId` ON `${TABLE_NAME}` (`zoneId`)" - }, - { - "name": "index_sessions_date", - "unique": false, - "columnNames": [ - "date" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_date` ON `${TABLE_NAME}` (`date`)" - } - ], - "foreignKeys": [ - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "taskId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "cached_schedule_dates", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`date` TEXT NOT NULL, `lastSyncedAt` TEXT NOT NULL, PRIMARY KEY(`date`))", - "fields": [ - { - "fieldPath": "date", - "columnName": "date", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "lastSyncedAt", - "columnName": "lastSyncedAt", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "date" - ] - } - } - ], - "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, 'd68742e1a812da84c2fee06fa55db72b')" - ] - } -} \ No newline at end of file diff --git a/core/database/schemas/com.awan.app.core.database.AwanDatabase/3.json b/core/database/schemas/com.awan.app.core.database.AwanDatabase/3.json deleted file mode 100644 index 319a3668..00000000 --- a/core/database/schemas/com.awan.app.core.database.AwanDatabase/3.json +++ /dev/null @@ -1,779 +0,0 @@ -{ - "formatVersion": 1, - "database": { - "version": 3, - "identityHash": "09a3c64cb648818bff5aed1be6fd471f", - "entities": [ - { - "tableName": "users", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `email` TEXT NOT NULL, `firstName` TEXT, `lastName` TEXT, `birthDate` TEXT, `points` INTEGER NOT NULL, `streak` INTEGER NOT NULL, `maxStreak` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "email", - "columnName": "email", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "firstName", - "columnName": "firstName", - "affinity": "TEXT" - }, - { - "fieldPath": "lastName", - "columnName": "lastName", - "affinity": "TEXT" - }, - { - "fieldPath": "birthDate", - "columnName": "birthDate", - "affinity": "TEXT" - }, - { - "fieldPath": "points", - "columnName": "points", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "streak", - "columnName": "streak", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "maxStreak", - "columnName": "maxStreak", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "user_preferences", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `timezone` TEXT NOT NULL, `preferredSessionDuration` INTEGER NOT NULL, `bufferBetweenSessions` INTEGER NOT NULL, `wakeupTime` TEXT NOT NULL, `sleepTime` TEXT NOT NULL, `schedulingType` TEXT NOT NULL, PRIMARY KEY(`userId`), FOREIGN KEY(`userId`) REFERENCES `users`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "userId", - "columnName": "userId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "timezone", - "columnName": "timezone", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "preferredSessionDuration", - "columnName": "preferredSessionDuration", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "bufferBetweenSessions", - "columnName": "bufferBetweenSessions", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "wakeupTime", - "columnName": "wakeupTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "sleepTime", - "columnName": "sleepTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "schedulingType", - "columnName": "schedulingType", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "userId" - ] - }, - "indices": [ - { - "name": "index_user_preferences_userId", - "unique": false, - "columnNames": [ - "userId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_user_preferences_userId` ON `${TABLE_NAME}` (`userId`)" - } - ], - "foreignKeys": [ - { - "table": "users", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "userId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "goals", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `status` TEXT NOT NULL, `targetDate` TEXT, `createdAt` TEXT NOT NULL, `isInbox` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "title", - "columnName": "title", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "description", - "columnName": "description", - "affinity": "TEXT" - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "targetDate", - "columnName": "targetDate", - "affinity": "TEXT" - }, - { - "fieldPath": "createdAt", - "columnName": "createdAt", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "isInbox", - "columnName": "isInbox", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "tasks", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `estimatedDuration` INTEGER NOT NULL, `status` TEXT NOT NULL, `mandatory` INTEGER NOT NULL, `estimatedPoints` INTEGER NOT NULL, `allowTaskSplitting` INTEGER NOT NULL, `goalId` TEXT, `categoryId` TEXT, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`categoryId`) REFERENCES `categories`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "title", - "columnName": "title", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "description", - "columnName": "description", - "affinity": "TEXT" - }, - { - "fieldPath": "estimatedDuration", - "columnName": "estimatedDuration", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "mandatory", - "columnName": "mandatory", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "estimatedPoints", - "columnName": "estimatedPoints", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "allowTaskSplitting", - "columnName": "allowTaskSplitting", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "goalId", - "columnName": "goalId", - "affinity": "TEXT" - }, - { - "fieldPath": "categoryId", - "columnName": "categoryId", - "affinity": "TEXT" - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_tasks_goalId", - "unique": false, - "columnNames": [ - "goalId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_goalId` ON `${TABLE_NAME}` (`goalId`)" - }, - { - "name": "index_tasks_categoryId", - "unique": false, - "columnNames": [ - "categoryId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_categoryId` ON `${TABLE_NAME}` (`categoryId`)" - } - ], - "foreignKeys": [ - { - "table": "categories", - "onDelete": "NO ACTION", - "onUpdate": "NO ACTION", - "columns": [ - "categoryId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "task_dependencies", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`taskId` TEXT NOT NULL, `dependsOnTaskId` TEXT NOT NULL, PRIMARY KEY(`taskId`, `dependsOnTaskId`), FOREIGN KEY(`taskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`dependsOnTaskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "taskId", - "columnName": "taskId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "dependsOnTaskId", - "columnName": "dependsOnTaskId", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "taskId", - "dependsOnTaskId" - ] - }, - "indices": [ - { - "name": "index_task_dependencies_taskId", - "unique": false, - "columnNames": [ - "taskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_task_dependencies_taskId` ON `${TABLE_NAME}` (`taskId`)" - }, - { - "name": "index_task_dependencies_dependsOnTaskId", - "unique": false, - "columnNames": [ - "dependsOnTaskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_task_dependencies_dependsOnTaskId` ON `${TABLE_NAME}` (`dependsOnTaskId`)" - } - ], - "foreignKeys": [ - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "taskId" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "dependsOnTaskId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "templates", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "template_days_of_week", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`dayOfWeek` TEXT NOT NULL, `templateId` TEXT NOT NULL, PRIMARY KEY(`dayOfWeek`), FOREIGN KEY(`templateId`) REFERENCES `templates`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "dayOfWeek", - "columnName": "dayOfWeek", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "templateId", - "columnName": "templateId", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "dayOfWeek" - ] - }, - "indices": [ - { - "name": "index_template_days_of_week_templateId", - "unique": false, - "columnNames": [ - "templateId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_template_days_of_week_templateId` ON `${TABLE_NAME}` (`templateId`)" - } - ], - "foreignKeys": [ - { - "table": "templates", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "template_overrides", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT, `dateOfDay` TEXT NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT" - }, - { - "fieldPath": "dateOfDay", - "columnName": "dateOfDay", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_template_overrides_dateOfDay", - "unique": true, - "columnNames": [ - "dateOfDay" - ], - "orders": [], - "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_template_overrides_dateOfDay` ON `${TABLE_NAME}` (`dateOfDay`)" - } - ] - }, - { - "tableName": "zones", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `startTime` TEXT NOT NULL, `endTime` TEXT NOT NULL, `color` TEXT, `templateId` TEXT, `templateOverrideId` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`templateId`) REFERENCES `templates`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`templateOverrideId`) REFERENCES `template_overrides`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "startTime", - "columnName": "startTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "endTime", - "columnName": "endTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "color", - "columnName": "color", - "affinity": "TEXT" - }, - { - "fieldPath": "templateId", - "columnName": "templateId", - "affinity": "TEXT" - }, - { - "fieldPath": "templateOverrideId", - "columnName": "templateOverrideId", - "affinity": "TEXT" - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_zones_templateId", - "unique": false, - "columnNames": [ - "templateId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_zones_templateId` ON `${TABLE_NAME}` (`templateId`)" - }, - { - "name": "index_zones_templateOverrideId", - "unique": false, - "columnNames": [ - "templateOverrideId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_zones_templateOverrideId` ON `${TABLE_NAME}` (`templateOverrideId`)" - } - ], - "foreignKeys": [ - { - "table": "templates", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateId" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "template_overrides", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateOverrideId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "categories", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `colorHex` TEXT, `icon` TEXT, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "colorHex", - "columnName": "colorHex", - "affinity": "TEXT" - }, - { - "fieldPath": "icon", - "columnName": "icon", - "affinity": "TEXT" - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "sessions", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `taskId` TEXT NOT NULL, `zoneId` TEXT, `date` TEXT NOT NULL, `startTime` TEXT NOT NULL, `endTime` TEXT NOT NULL, `status` TEXT NOT NULL, `locked` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`taskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "taskId", - "columnName": "taskId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "zoneId", - "columnName": "zoneId", - "affinity": "TEXT" - }, - { - "fieldPath": "date", - "columnName": "date", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "startTime", - "columnName": "startTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "endTime", - "columnName": "endTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "locked", - "columnName": "locked", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_sessions_taskId", - "unique": false, - "columnNames": [ - "taskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_taskId` ON `${TABLE_NAME}` (`taskId`)" - }, - { - "name": "index_sessions_zoneId", - "unique": false, - "columnNames": [ - "zoneId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_zoneId` ON `${TABLE_NAME}` (`zoneId`)" - }, - { - "name": "index_sessions_date", - "unique": false, - "columnNames": [ - "date" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_date` ON `${TABLE_NAME}` (`date`)" - } - ], - "foreignKeys": [ - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "taskId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "cached_schedule_dates", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`date` TEXT NOT NULL, `lastSyncedAt` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`date`))", - "fields": [ - { - "fieldPath": "date", - "columnName": "date", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "lastSyncedAt", - "columnName": "lastSyncedAt", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "date" - ] - } - } - ], - "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, '09a3c64cb648818bff5aed1be6fd471f')" - ] - } -} \ No newline at end of file diff --git a/core/database/schemas/com.awan.app.core.database.AwanDatabase/4.json b/core/database/schemas/com.awan.app.core.database.AwanDatabase/4.json deleted file mode 100644 index b61fb7be..00000000 --- a/core/database/schemas/com.awan.app.core.database.AwanDatabase/4.json +++ /dev/null @@ -1,790 +0,0 @@ -{ - "formatVersion": 1, - "database": { - "version": 4, - "identityHash": "5bb53543db0b6216bfbb6b6636c77b04", - "entities": [ - { - "tableName": "users", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `email` TEXT NOT NULL, `firstName` TEXT, `lastName` TEXT, `birthDate` TEXT, `points` INTEGER NOT NULL, `streak` INTEGER NOT NULL, `maxStreak` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, `profilePictureUrl` TEXT, `isNew` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "email", - "columnName": "email", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "firstName", - "columnName": "firstName", - "affinity": "TEXT" - }, - { - "fieldPath": "lastName", - "columnName": "lastName", - "affinity": "TEXT" - }, - { - "fieldPath": "birthDate", - "columnName": "birthDate", - "affinity": "TEXT" - }, - { - "fieldPath": "points", - "columnName": "points", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "streak", - "columnName": "streak", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "maxStreak", - "columnName": "maxStreak", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "profilePictureUrl", - "columnName": "profilePictureUrl", - "affinity": "TEXT" - }, - { - "fieldPath": "isNew", - "columnName": "isNew", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "user_preferences", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `timezone` TEXT NOT NULL, `preferredSessionDuration` INTEGER NOT NULL, `bufferBetweenSessions` INTEGER NOT NULL, `wakeupTime` TEXT NOT NULL, `sleepTime` TEXT NOT NULL, `schedulingType` TEXT NOT NULL, PRIMARY KEY(`userId`), FOREIGN KEY(`userId`) REFERENCES `users`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "userId", - "columnName": "userId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "timezone", - "columnName": "timezone", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "preferredSessionDuration", - "columnName": "preferredSessionDuration", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "bufferBetweenSessions", - "columnName": "bufferBetweenSessions", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "wakeupTime", - "columnName": "wakeupTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "sleepTime", - "columnName": "sleepTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "schedulingType", - "columnName": "schedulingType", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "userId" - ] - }, - "indices": [ - { - "name": "index_user_preferences_userId", - "unique": false, - "columnNames": [ - "userId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_user_preferences_userId` ON `${TABLE_NAME}` (`userId`)" - } - ], - "foreignKeys": [ - { - "table": "users", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "userId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "goals", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `status` TEXT NOT NULL, `targetDate` TEXT, `createdAt` TEXT NOT NULL, `isInbox` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "title", - "columnName": "title", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "description", - "columnName": "description", - "affinity": "TEXT" - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "targetDate", - "columnName": "targetDate", - "affinity": "TEXT" - }, - { - "fieldPath": "createdAt", - "columnName": "createdAt", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "isInbox", - "columnName": "isInbox", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "tasks", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `estimatedDuration` INTEGER NOT NULL, `status` TEXT NOT NULL, `mandatory` INTEGER NOT NULL, `estimatedPoints` INTEGER NOT NULL, `allowTaskSplitting` INTEGER NOT NULL, `goalId` TEXT, `categoryId` TEXT, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`categoryId`) REFERENCES `categories`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "title", - "columnName": "title", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "description", - "columnName": "description", - "affinity": "TEXT" - }, - { - "fieldPath": "estimatedDuration", - "columnName": "estimatedDuration", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "mandatory", - "columnName": "mandatory", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "estimatedPoints", - "columnName": "estimatedPoints", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "allowTaskSplitting", - "columnName": "allowTaskSplitting", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "goalId", - "columnName": "goalId", - "affinity": "TEXT" - }, - { - "fieldPath": "categoryId", - "columnName": "categoryId", - "affinity": "TEXT" - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_tasks_goalId", - "unique": false, - "columnNames": [ - "goalId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_goalId` ON `${TABLE_NAME}` (`goalId`)" - }, - { - "name": "index_tasks_categoryId", - "unique": false, - "columnNames": [ - "categoryId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_categoryId` ON `${TABLE_NAME}` (`categoryId`)" - } - ], - "foreignKeys": [ - { - "table": "categories", - "onDelete": "NO ACTION", - "onUpdate": "NO ACTION", - "columns": [ - "categoryId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "task_dependencies", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`taskId` TEXT NOT NULL, `dependsOnTaskId` TEXT NOT NULL, PRIMARY KEY(`taskId`, `dependsOnTaskId`), FOREIGN KEY(`taskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`dependsOnTaskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "taskId", - "columnName": "taskId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "dependsOnTaskId", - "columnName": "dependsOnTaskId", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "taskId", - "dependsOnTaskId" - ] - }, - "indices": [ - { - "name": "index_task_dependencies_taskId", - "unique": false, - "columnNames": [ - "taskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_task_dependencies_taskId` ON `${TABLE_NAME}` (`taskId`)" - }, - { - "name": "index_task_dependencies_dependsOnTaskId", - "unique": false, - "columnNames": [ - "dependsOnTaskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_task_dependencies_dependsOnTaskId` ON `${TABLE_NAME}` (`dependsOnTaskId`)" - } - ], - "foreignKeys": [ - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "taskId" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "dependsOnTaskId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "templates", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "template_days_of_week", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`dayOfWeek` TEXT NOT NULL, `templateId` TEXT NOT NULL, PRIMARY KEY(`dayOfWeek`), FOREIGN KEY(`templateId`) REFERENCES `templates`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "dayOfWeek", - "columnName": "dayOfWeek", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "templateId", - "columnName": "templateId", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "dayOfWeek" - ] - }, - "indices": [ - { - "name": "index_template_days_of_week_templateId", - "unique": false, - "columnNames": [ - "templateId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_template_days_of_week_templateId` ON `${TABLE_NAME}` (`templateId`)" - } - ], - "foreignKeys": [ - { - "table": "templates", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "template_overrides", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT, `dateOfDay` TEXT NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT" - }, - { - "fieldPath": "dateOfDay", - "columnName": "dateOfDay", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_template_overrides_dateOfDay", - "unique": true, - "columnNames": [ - "dateOfDay" - ], - "orders": [], - "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_template_overrides_dateOfDay` ON `${TABLE_NAME}` (`dateOfDay`)" - } - ] - }, - { - "tableName": "zones", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `startTime` TEXT NOT NULL, `endTime` TEXT NOT NULL, `color` TEXT, `templateId` TEXT, `templateOverrideId` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`templateId`) REFERENCES `templates`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`templateOverrideId`) REFERENCES `template_overrides`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "startTime", - "columnName": "startTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "endTime", - "columnName": "endTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "color", - "columnName": "color", - "affinity": "TEXT" - }, - { - "fieldPath": "templateId", - "columnName": "templateId", - "affinity": "TEXT" - }, - { - "fieldPath": "templateOverrideId", - "columnName": "templateOverrideId", - "affinity": "TEXT" - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_zones_templateId", - "unique": false, - "columnNames": [ - "templateId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_zones_templateId` ON `${TABLE_NAME}` (`templateId`)" - }, - { - "name": "index_zones_templateOverrideId", - "unique": false, - "columnNames": [ - "templateOverrideId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_zones_templateOverrideId` ON `${TABLE_NAME}` (`templateOverrideId`)" - } - ], - "foreignKeys": [ - { - "table": "templates", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateId" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "template_overrides", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateOverrideId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "categories", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `colorHex` TEXT, `icon` TEXT, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "colorHex", - "columnName": "colorHex", - "affinity": "TEXT" - }, - { - "fieldPath": "icon", - "columnName": "icon", - "affinity": "TEXT" - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "sessions", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `taskId` TEXT NOT NULL, `zoneId` TEXT, `date` TEXT NOT NULL, `startTime` TEXT NOT NULL, `endTime` TEXT NOT NULL, `status` TEXT NOT NULL, `locked` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`taskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "taskId", - "columnName": "taskId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "zoneId", - "columnName": "zoneId", - "affinity": "TEXT" - }, - { - "fieldPath": "date", - "columnName": "date", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "startTime", - "columnName": "startTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "endTime", - "columnName": "endTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "locked", - "columnName": "locked", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_sessions_taskId", - "unique": false, - "columnNames": [ - "taskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_taskId` ON `${TABLE_NAME}` (`taskId`)" - }, - { - "name": "index_sessions_zoneId", - "unique": false, - "columnNames": [ - "zoneId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_zoneId` ON `${TABLE_NAME}` (`zoneId`)" - }, - { - "name": "index_sessions_date", - "unique": false, - "columnNames": [ - "date" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_date` ON `${TABLE_NAME}` (`date`)" - } - ], - "foreignKeys": [ - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "taskId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "cached_schedule_dates", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`date` TEXT NOT NULL, `lastSyncedAt` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`date`))", - "fields": [ - { - "fieldPath": "date", - "columnName": "date", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "lastSyncedAt", - "columnName": "lastSyncedAt", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "date" - ] - } - } - ], - "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, '5bb53543db0b6216bfbb6b6636c77b04')" - ] - } -} \ No newline at end of file diff --git a/core/database/schemas/com.awan.app.core.database.AwanDatabase/5.json b/core/database/schemas/com.awan.app.core.database.AwanDatabase/5.json deleted file mode 100644 index 4475a4b5..00000000 --- a/core/database/schemas/com.awan.app.core.database.AwanDatabase/5.json +++ /dev/null @@ -1,927 +0,0 @@ -{ - "formatVersion": 1, - "database": { - "version": 5, - "identityHash": "992ecd7c5630959737c670c515606372", - "entities": [ - { - "tableName": "users", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `email` TEXT NOT NULL, `firstName` TEXT, `lastName` TEXT, `birthDate` TEXT, `points` INTEGER NOT NULL, `streak` INTEGER NOT NULL, `maxStreak` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, `profilePictureUrl` TEXT, `isNew` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "email", - "columnName": "email", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "firstName", - "columnName": "firstName", - "affinity": "TEXT" - }, - { - "fieldPath": "lastName", - "columnName": "lastName", - "affinity": "TEXT" - }, - { - "fieldPath": "birthDate", - "columnName": "birthDate", - "affinity": "TEXT" - }, - { - "fieldPath": "points", - "columnName": "points", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "streak", - "columnName": "streak", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "maxStreak", - "columnName": "maxStreak", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "profilePictureUrl", - "columnName": "profilePictureUrl", - "affinity": "TEXT" - }, - { - "fieldPath": "isNew", - "columnName": "isNew", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "user_preferences", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `timezone` TEXT NOT NULL, `preferredSessionDuration` INTEGER NOT NULL, `bufferBetweenSessions` INTEGER NOT NULL, `wakeupTime` TEXT NOT NULL, `sleepTime` TEXT NOT NULL, `schedulingType` TEXT NOT NULL, PRIMARY KEY(`userId`), FOREIGN KEY(`userId`) REFERENCES `users`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "userId", - "columnName": "userId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "timezone", - "columnName": "timezone", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "preferredSessionDuration", - "columnName": "preferredSessionDuration", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "bufferBetweenSessions", - "columnName": "bufferBetweenSessions", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "wakeupTime", - "columnName": "wakeupTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "sleepTime", - "columnName": "sleepTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "schedulingType", - "columnName": "schedulingType", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "userId" - ] - }, - "indices": [ - { - "name": "index_user_preferences_userId", - "unique": false, - "columnNames": [ - "userId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_user_preferences_userId` ON `${TABLE_NAME}` (`userId`)" - } - ], - "foreignKeys": [ - { - "table": "users", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "userId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "goals", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `status` TEXT NOT NULL, `targetDate` TEXT, `createdAt` TEXT NOT NULL, `isInbox` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "title", - "columnName": "title", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "description", - "columnName": "description", - "affinity": "TEXT" - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "targetDate", - "columnName": "targetDate", - "affinity": "TEXT" - }, - { - "fieldPath": "createdAt", - "columnName": "createdAt", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "isInbox", - "columnName": "isInbox", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "tasks", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `estimatedDuration` INTEGER NOT NULL, `status` TEXT NOT NULL, `mandatory` INTEGER NOT NULL, `estimatedPoints` INTEGER NOT NULL, `allowTaskSplitting` INTEGER NOT NULL, `goalId` TEXT, `categoryId` TEXT, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`categoryId`) REFERENCES `categories`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "title", - "columnName": "title", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "description", - "columnName": "description", - "affinity": "TEXT" - }, - { - "fieldPath": "estimatedDuration", - "columnName": "estimatedDuration", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "mandatory", - "columnName": "mandatory", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "estimatedPoints", - "columnName": "estimatedPoints", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "allowTaskSplitting", - "columnName": "allowTaskSplitting", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "goalId", - "columnName": "goalId", - "affinity": "TEXT" - }, - { - "fieldPath": "categoryId", - "columnName": "categoryId", - "affinity": "TEXT" - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_tasks_goalId", - "unique": false, - "columnNames": [ - "goalId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_goalId` ON `${TABLE_NAME}` (`goalId`)" - }, - { - "name": "index_tasks_categoryId", - "unique": false, - "columnNames": [ - "categoryId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_categoryId` ON `${TABLE_NAME}` (`categoryId`)" - } - ], - "foreignKeys": [ - { - "table": "categories", - "onDelete": "NO ACTION", - "onUpdate": "NO ACTION", - "columns": [ - "categoryId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "task_dependencies", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`taskId` TEXT NOT NULL, `dependsOnTaskId` TEXT NOT NULL, PRIMARY KEY(`taskId`, `dependsOnTaskId`), FOREIGN KEY(`taskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`dependsOnTaskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "taskId", - "columnName": "taskId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "dependsOnTaskId", - "columnName": "dependsOnTaskId", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "taskId", - "dependsOnTaskId" - ] - }, - "indices": [ - { - "name": "index_task_dependencies_taskId", - "unique": false, - "columnNames": [ - "taskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_task_dependencies_taskId` ON `${TABLE_NAME}` (`taskId`)" - }, - { - "name": "index_task_dependencies_dependsOnTaskId", - "unique": false, - "columnNames": [ - "dependsOnTaskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_task_dependencies_dependsOnTaskId` ON `${TABLE_NAME}` (`dependsOnTaskId`)" - } - ], - "foreignKeys": [ - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "taskId" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "dependsOnTaskId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "templates", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "template_days_of_week", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`dayOfWeek` TEXT NOT NULL, `templateId` TEXT NOT NULL, PRIMARY KEY(`dayOfWeek`), FOREIGN KEY(`templateId`) REFERENCES `templates`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "dayOfWeek", - "columnName": "dayOfWeek", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "templateId", - "columnName": "templateId", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "dayOfWeek" - ] - }, - "indices": [ - { - "name": "index_template_days_of_week_templateId", - "unique": false, - "columnNames": [ - "templateId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_template_days_of_week_templateId` ON `${TABLE_NAME}` (`templateId`)" - } - ], - "foreignKeys": [ - { - "table": "templates", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "template_overrides", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT, `dateOfDay` TEXT NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT" - }, - { - "fieldPath": "dateOfDay", - "columnName": "dateOfDay", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_template_overrides_dateOfDay", - "unique": true, - "columnNames": [ - "dateOfDay" - ], - "orders": [], - "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_template_overrides_dateOfDay` ON `${TABLE_NAME}` (`dateOfDay`)" - } - ] - }, - { - "tableName": "zones", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `startTime` TEXT NOT NULL, `endTime` TEXT NOT NULL, `color` TEXT, `templateId` TEXT, `templateOverrideId` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`templateId`) REFERENCES `templates`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`templateOverrideId`) REFERENCES `template_overrides`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "startTime", - "columnName": "startTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "endTime", - "columnName": "endTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "color", - "columnName": "color", - "affinity": "TEXT" - }, - { - "fieldPath": "templateId", - "columnName": "templateId", - "affinity": "TEXT" - }, - { - "fieldPath": "templateOverrideId", - "columnName": "templateOverrideId", - "affinity": "TEXT" - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_zones_templateId", - "unique": false, - "columnNames": [ - "templateId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_zones_templateId` ON `${TABLE_NAME}` (`templateId`)" - }, - { - "name": "index_zones_templateOverrideId", - "unique": false, - "columnNames": [ - "templateOverrideId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_zones_templateOverrideId` ON `${TABLE_NAME}` (`templateOverrideId`)" - } - ], - "foreignKeys": [ - { - "table": "templates", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateId" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "template_overrides", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateOverrideId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "categories", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `colorHex` TEXT, `icon` TEXT, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "colorHex", - "columnName": "colorHex", - "affinity": "TEXT" - }, - { - "fieldPath": "icon", - "columnName": "icon", - "affinity": "TEXT" - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "sessions", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `taskId` TEXT NOT NULL, `zoneId` TEXT, `date` TEXT NOT NULL, `startTime` TEXT NOT NULL, `endTime` TEXT NOT NULL, `status` TEXT NOT NULL, `locked` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`taskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "taskId", - "columnName": "taskId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "zoneId", - "columnName": "zoneId", - "affinity": "TEXT" - }, - { - "fieldPath": "date", - "columnName": "date", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "startTime", - "columnName": "startTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "endTime", - "columnName": "endTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "locked", - "columnName": "locked", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_sessions_taskId", - "unique": false, - "columnNames": [ - "taskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_taskId` ON `${TABLE_NAME}` (`taskId`)" - }, - { - "name": "index_sessions_zoneId", - "unique": false, - "columnNames": [ - "zoneId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_zoneId` ON `${TABLE_NAME}` (`zoneId`)" - }, - { - "name": "index_sessions_date", - "unique": false, - "columnNames": [ - "date" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_date` ON `${TABLE_NAME}` (`date`)" - } - ], - "foreignKeys": [ - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "taskId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "cached_schedule_dates", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`date` TEXT NOT NULL, `lastSyncedAt` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`date`))", - "fields": [ - { - "fieldPath": "date", - "columnName": "date", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "lastSyncedAt", - "columnName": "lastSyncedAt", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "date" - ] - } - }, - { - "tableName": "store_items", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `description` TEXT NOT NULL, `image` TEXT NOT NULL, `info` TEXT, `price` INTEGER NOT NULL, `version` TEXT NOT NULL, `type` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "description", - "columnName": "description", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "image", - "columnName": "image", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "info", - "columnName": "info", - "affinity": "TEXT" - }, - { - "fieldPath": "price", - "columnName": "price", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "version", - "columnName": "version", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "type", - "columnName": "type", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "owned_items", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `itemId` TEXT NOT NULL, `boughtAt` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "itemId", - "columnName": "itemId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "boughtAt", - "columnName": "boughtAt", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "equipped_items", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`type` TEXT NOT NULL, `itemId` TEXT NOT NULL, `equippedAt` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`type`))", - "fields": [ - { - "fieldPath": "type", - "columnName": "type", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "itemId", - "columnName": "itemId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "equippedAt", - "columnName": "equippedAt", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "type" - ] - } - } - ], - "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, '992ecd7c5630959737c670c515606372')" - ] - } -} \ No newline at end of file diff --git a/core/database/schemas/com.awan.app.core.database.AwanDatabase/6.json b/core/database/schemas/com.awan.app.core.database.AwanDatabase/6.json deleted file mode 100644 index 58c983a3..00000000 --- a/core/database/schemas/com.awan.app.core.database.AwanDatabase/6.json +++ /dev/null @@ -1,882 +0,0 @@ -{ - "formatVersion": 1, - "database": { - "version": 6, - "identityHash": "c4a9fea5c05ca9915cd5fcb3aef378fe", - "entities": [ - { - "tableName": "users", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `email` TEXT NOT NULL, `firstName` TEXT, `lastName` TEXT, `birthDate` TEXT, `points` INTEGER NOT NULL, `streak` INTEGER NOT NULL, `maxStreak` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, `profilePictureUrl` TEXT, `isNew` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "email", - "columnName": "email", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "firstName", - "columnName": "firstName", - "affinity": "TEXT" - }, - { - "fieldPath": "lastName", - "columnName": "lastName", - "affinity": "TEXT" - }, - { - "fieldPath": "birthDate", - "columnName": "birthDate", - "affinity": "TEXT" - }, - { - "fieldPath": "points", - "columnName": "points", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "streak", - "columnName": "streak", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "maxStreak", - "columnName": "maxStreak", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "profilePictureUrl", - "columnName": "profilePictureUrl", - "affinity": "TEXT" - }, - { - "fieldPath": "isNew", - "columnName": "isNew", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "user_preferences", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`userId` TEXT NOT NULL, `timezone` TEXT NOT NULL, `preferredSessionDuration` INTEGER NOT NULL, `bufferBetweenSessions` INTEGER NOT NULL, `wakeupTime` TEXT NOT NULL, `sleepTime` TEXT NOT NULL, `schedulingType` TEXT NOT NULL, PRIMARY KEY(`userId`), FOREIGN KEY(`userId`) REFERENCES `users`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "userId", - "columnName": "userId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "timezone", - "columnName": "timezone", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "preferredSessionDuration", - "columnName": "preferredSessionDuration", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "bufferBetweenSessions", - "columnName": "bufferBetweenSessions", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "wakeupTime", - "columnName": "wakeupTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "sleepTime", - "columnName": "sleepTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "schedulingType", - "columnName": "schedulingType", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "userId" - ] - }, - "indices": [ - { - "name": "index_user_preferences_userId", - "unique": false, - "columnNames": [ - "userId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_user_preferences_userId` ON `${TABLE_NAME}` (`userId`)" - } - ], - "foreignKeys": [ - { - "table": "users", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "userId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "goals", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `status` TEXT NOT NULL, `targetDate` TEXT, `createdAt` TEXT NOT NULL, `isInbox` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "title", - "columnName": "title", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "description", - "columnName": "description", - "affinity": "TEXT" - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "targetDate", - "columnName": "targetDate", - "affinity": "TEXT" - }, - { - "fieldPath": "createdAt", - "columnName": "createdAt", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "isInbox", - "columnName": "isInbox", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "tasks", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `title` TEXT NOT NULL, `description` TEXT, `estimatedDuration` INTEGER NOT NULL, `status` TEXT NOT NULL, `mandatory` INTEGER NOT NULL, `estimatedPoints` INTEGER NOT NULL, `allowTaskSplitting` INTEGER NOT NULL, `goalId` TEXT, `categoryId` TEXT, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`categoryId`) REFERENCES `categories`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "title", - "columnName": "title", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "description", - "columnName": "description", - "affinity": "TEXT" - }, - { - "fieldPath": "estimatedDuration", - "columnName": "estimatedDuration", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "mandatory", - "columnName": "mandatory", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "estimatedPoints", - "columnName": "estimatedPoints", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "allowTaskSplitting", - "columnName": "allowTaskSplitting", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "goalId", - "columnName": "goalId", - "affinity": "TEXT" - }, - { - "fieldPath": "categoryId", - "columnName": "categoryId", - "affinity": "TEXT" - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_tasks_goalId", - "unique": false, - "columnNames": [ - "goalId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_goalId` ON `${TABLE_NAME}` (`goalId`)" - }, - { - "name": "index_tasks_categoryId", - "unique": false, - "columnNames": [ - "categoryId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_tasks_categoryId` ON `${TABLE_NAME}` (`categoryId`)" - } - ], - "foreignKeys": [ - { - "table": "categories", - "onDelete": "NO ACTION", - "onUpdate": "NO ACTION", - "columns": [ - "categoryId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "task_dependencies", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`taskId` TEXT NOT NULL, `dependsOnTaskId` TEXT NOT NULL, PRIMARY KEY(`taskId`, `dependsOnTaskId`), FOREIGN KEY(`taskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`dependsOnTaskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "taskId", - "columnName": "taskId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "dependsOnTaskId", - "columnName": "dependsOnTaskId", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "taskId", - "dependsOnTaskId" - ] - }, - "indices": [ - { - "name": "index_task_dependencies_taskId", - "unique": false, - "columnNames": [ - "taskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_task_dependencies_taskId` ON `${TABLE_NAME}` (`taskId`)" - }, - { - "name": "index_task_dependencies_dependsOnTaskId", - "unique": false, - "columnNames": [ - "dependsOnTaskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_task_dependencies_dependsOnTaskId` ON `${TABLE_NAME}` (`dependsOnTaskId`)" - } - ], - "foreignKeys": [ - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "taskId" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "dependsOnTaskId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "templates", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "template_days_of_week", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`dayOfWeek` TEXT NOT NULL, `templateId` TEXT NOT NULL, PRIMARY KEY(`dayOfWeek`), FOREIGN KEY(`templateId`) REFERENCES `templates`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "dayOfWeek", - "columnName": "dayOfWeek", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "templateId", - "columnName": "templateId", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "dayOfWeek" - ] - }, - "indices": [ - { - "name": "index_template_days_of_week_templateId", - "unique": false, - "columnNames": [ - "templateId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_template_days_of_week_templateId` ON `${TABLE_NAME}` (`templateId`)" - } - ], - "foreignKeys": [ - { - "table": "templates", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "template_overrides", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT, `dateOfDay` TEXT NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT" - }, - { - "fieldPath": "dateOfDay", - "columnName": "dateOfDay", - "affinity": "TEXT", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_template_overrides_dateOfDay", - "unique": true, - "columnNames": [ - "dateOfDay" - ], - "orders": [], - "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `index_template_overrides_dateOfDay` ON `${TABLE_NAME}` (`dateOfDay`)" - } - ] - }, - { - "tableName": "zones", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `startTime` TEXT NOT NULL, `endTime` TEXT NOT NULL, `color` TEXT, `templateId` TEXT, `templateOverrideId` TEXT, PRIMARY KEY(`id`), FOREIGN KEY(`templateId`) REFERENCES `templates`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`templateOverrideId`) REFERENCES `template_overrides`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "startTime", - "columnName": "startTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "endTime", - "columnName": "endTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "color", - "columnName": "color", - "affinity": "TEXT" - }, - { - "fieldPath": "templateId", - "columnName": "templateId", - "affinity": "TEXT" - }, - { - "fieldPath": "templateOverrideId", - "columnName": "templateOverrideId", - "affinity": "TEXT" - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_zones_templateId", - "unique": false, - "columnNames": [ - "templateId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_zones_templateId` ON `${TABLE_NAME}` (`templateId`)" - }, - { - "name": "index_zones_templateOverrideId", - "unique": false, - "columnNames": [ - "templateOverrideId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_zones_templateOverrideId` ON `${TABLE_NAME}` (`templateOverrideId`)" - } - ], - "foreignKeys": [ - { - "table": "templates", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateId" - ], - "referencedColumns": [ - "id" - ] - }, - { - "table": "template_overrides", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "templateOverrideId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "categories", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `colorHex` TEXT, `icon` TEXT, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "colorHex", - "columnName": "colorHex", - "affinity": "TEXT" - }, - { - "fieldPath": "icon", - "columnName": "icon", - "affinity": "TEXT" - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - } - }, - { - "tableName": "sessions", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `taskId` TEXT NOT NULL, `zoneId` TEXT, `date` TEXT NOT NULL, `startTime` TEXT NOT NULL, `endTime` TEXT NOT NULL, `status` TEXT NOT NULL, `locked` INTEGER NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`taskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "taskId", - "columnName": "taskId", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "zoneId", - "columnName": "zoneId", - "affinity": "TEXT" - }, - { - "fieldPath": "date", - "columnName": "date", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "startTime", - "columnName": "startTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "endTime", - "columnName": "endTime", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "status", - "columnName": "status", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "locked", - "columnName": "locked", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "id" - ] - }, - "indices": [ - { - "name": "index_sessions_taskId", - "unique": false, - "columnNames": [ - "taskId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_taskId` ON `${TABLE_NAME}` (`taskId`)" - }, - { - "name": "index_sessions_zoneId", - "unique": false, - "columnNames": [ - "zoneId" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_zoneId` ON `${TABLE_NAME}` (`zoneId`)" - }, - { - "name": "index_sessions_date", - "unique": false, - "columnNames": [ - "date" - ], - "orders": [], - "createSql": "CREATE INDEX IF NOT EXISTS `index_sessions_date` ON `${TABLE_NAME}` (`date`)" - } - ], - "foreignKeys": [ - { - "table": "tasks", - "onDelete": "CASCADE", - "onUpdate": "NO ACTION", - "columns": [ - "taskId" - ], - "referencedColumns": [ - "id" - ] - } - ] - }, - { - "tableName": "cached_schedule_dates", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`date` TEXT NOT NULL, `lastSyncedAt` TEXT NOT NULL, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`date`))", - "fields": [ - { - "fieldPath": "date", - "columnName": "date", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "lastSyncedAt", - "columnName": "lastSyncedAt", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "date" - ] - } - }, - { - "tableName": "marketplace_items", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` TEXT NOT NULL, `name` TEXT NOT NULL, `description` TEXT NOT NULL, `image` TEXT NOT NULL, `info` TEXT, `price` INTEGER NOT NULL, `version` TEXT NOT NULL, `type` TEXT NOT NULL, `isOwned` INTEGER NOT NULL, `isEquipped` INTEGER NOT NULL, `boughtAt` TEXT, `equippedAt` TEXT, `ownershipId` TEXT, `expiryTime` INTEGER NOT NULL, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "id", - "columnName": "id", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "name", - "columnName": "name", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "description", - "columnName": "description", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "image", - "columnName": "image", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "info", - "columnName": "info", - "affinity": "TEXT" - }, - { - "fieldPath": "price", - "columnName": "price", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "version", - "columnName": "version", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "type", - "columnName": "type", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "isOwned", - "columnName": "isOwned", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "isEquipped", - "columnName": "isEquipped", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "boughtAt", - "columnName": "boughtAt", - "affinity": "TEXT" - }, - { - "fieldPath": "equippedAt", - "columnName": "equippedAt", - "affinity": "TEXT" - }, - { - "fieldPath": "ownershipId", - "columnName": "ownershipId", - "affinity": "TEXT" - }, - { - "fieldPath": "expiryTime", - "columnName": "expiryTime", - "affinity": "INTEGER", - "notNull": true - } - ], - "primaryKey": { - "autoGenerate": false, - "columnNames": [ - "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, 'c4a9fea5c05ca9915cd5fcb3aef378fe')" - ] - } -} \ No newline at end of file diff --git a/core/database/src/androidTest/kotlin/com/awan/app/core/database/Migration4To5InstrumentedTest.kt b/core/database/src/androidTest/kotlin/com/awan/app/core/database/Migration4To5InstrumentedTest.kt deleted file mode 100644 index adf6fb7f..00000000 --- a/core/database/src/androidTest/kotlin/com/awan/app/core/database/Migration4To5InstrumentedTest.kt +++ /dev/null @@ -1,38 +0,0 @@ -package com.awan.app.core.database - -import androidx.room.testing.MigrationTestHelper -import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.test.platform.app.InstrumentationRegistry -import org.junit.Assert.assertTrue -import org.junit.Rule -import org.junit.Test -import org.junit.runner.RunWith - -@RunWith(AndroidJUnit4::class) -class Migration4To5InstrumentedTest { - @get:Rule - val migrationHelper = MigrationTestHelper( - InstrumentationRegistry.getInstrumentation(), - AwanDatabase::class.java, - ) - - @Test - fun migratesFrom4To5() { - migrationHelper.createDatabase(TEST_DATABASE, 4).close() - - val migrated = migrationHelper.runMigrationsAndValidate( - TEST_DATABASE, - 5, - true, - AwanDatabase.MIGRATION_4_5, - ) - migrated.query("SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'owned_customizations'").use { - assertTrue(it.moveToFirst()) - } - migrated.close() - } - - private companion object { - const val TEST_DATABASE = "migration-test" - } -} diff --git a/core/database/src/main/kotlin/com/awan/app/core/database/AwanDatabase.kt b/core/database/src/main/kotlin/com/awan/app/core/database/AwanDatabase.kt index f688b922..0695d6bc 100644 --- a/core/database/src/main/kotlin/com/awan/app/core/database/AwanDatabase.kt +++ b/core/database/src/main/kotlin/com/awan/app/core/database/AwanDatabase.kt @@ -2,8 +2,6 @@ package com.awan.app.core.database import androidx.room.Database import androidx.room.RoomDatabase -import androidx.room.migration.Migration -import androidx.sqlite.db.SupportSQLiteDatabase import com.awan.app.core.database.dao.CachedScheduleDateDao import com.awan.app.core.database.dao.CategoryDao import com.awan.app.core.database.dao.GoalDao @@ -55,7 +53,7 @@ import com.awan.app.core.database.model.ZoneEntity OwnedItemEntity::class, EquippedItemEntity::class, ], - version = 5, + version = 1, exportSchema = true, ) abstract class AwanDatabase : RoomDatabase() { @@ -79,255 +77,4 @@ abstract class AwanDatabase : RoomDatabase() { abstract fun cachedScheduleDateDao(): CachedScheduleDateDao abstract fun storeDao(): StoreDao - - companion object { - val MIGRATION_1_2 = object : Migration(1, 2) { - override fun migrate(db: SupportSQLiteDatabase) { - // 1. Create categories table - db.execSQL( - """ - CREATE TABLE IF NOT EXISTS `categories` ( - `id` TEXT NOT NULL, - `name` TEXT NOT NULL, - `colorHex` TEXT, - `icon` TEXT, - PRIMARY KEY(`id`) - ) - """.trimIndent() - ) - - // 2. Recreate tasks table with nullable goalId and optional categoryId - db.execSQL( - """ - CREATE TABLE IF NOT EXISTS `tasks_new` ( - `id` TEXT NOT NULL, - `title` TEXT NOT NULL, - `description` TEXT, - `estimatedDuration` INTEGER NOT NULL, - `status` TEXT NOT NULL, - `mandatory` INTEGER NOT NULL, - `estimatedPoints` INTEGER NOT NULL, - `allowTaskSplitting` INTEGER NOT NULL, - `goalId` TEXT, - `categoryId` TEXT, - PRIMARY KEY(`id`), - FOREIGN KEY(`goalId`) REFERENCES `goals`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION, - FOREIGN KEY(`categoryId`) REFERENCES `categories`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION - ) - """.trimIndent() - ) - - db.execSQL( - """ - INSERT INTO `tasks_new` ( - `id`, `title`, `description`, `estimatedDuration`, `status`, - `mandatory`, `estimatedPoints`, `allowTaskSplitting`, `goalId`, `categoryId` - ) - SELECT - `id`, `title`, `description`, `estimatedDuration`, `status`, - `mandatory`, `estimatedPoints`, `allowTaskSplitting`, `goalId`, NULL - FROM `tasks` - """.trimIndent() - ) - - db.execSQL("DROP TABLE `tasks`") - db.execSQL("ALTER TABLE `tasks_new` RENAME TO `tasks`") - - db.execSQL("CREATE INDEX IF NOT EXISTS `index_tasks_goalId` ON `tasks` (`goalId`)") - db.execSQL("CREATE INDEX IF NOT EXISTS `index_tasks_categoryId` ON `tasks` (`categoryId`)") - - // 3. Create sessions table - db.execSQL( - """ - CREATE TABLE IF NOT EXISTS `sessions` ( - `id` TEXT NOT NULL, - `taskId` TEXT NOT NULL, - `zoneId` TEXT, - `date` TEXT NOT NULL, - `startTime` TEXT NOT NULL, - `endTime` TEXT NOT NULL, - `status` TEXT NOT NULL, - `locked` INTEGER NOT NULL, - PRIMARY KEY(`id`), - FOREIGN KEY(`taskId`) REFERENCES `tasks`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE - ) - """.trimIndent() - ) - - db.execSQL("CREATE INDEX IF NOT EXISTS `index_sessions_taskId` ON `sessions` (`taskId`)") - db.execSQL("CREATE INDEX IF NOT EXISTS `index_sessions_zoneId` ON `sessions` (`zoneId`)") - db.execSQL("CREATE INDEX IF NOT EXISTS `index_sessions_date` ON `sessions` (`date`)") - - // 4. Create cached_schedule_dates table - db.execSQL( - """ - CREATE TABLE IF NOT EXISTS `cached_schedule_dates` ( - `date` TEXT NOT NULL, - `lastSyncedAt` TEXT NOT NULL, - PRIMARY KEY(`date`) - ) - """.trimIndent() - ) - } - } - - val MIGRATION_2_3 = object : Migration(2, 3) { - override fun migrate(db: SupportSQLiteDatabase) { - val existingColumns = mutableSetOf() - try { - val cursor = db.query("PRAGMA table_info(`users`)") - cursor.use { - val nameIndex = it.getColumnIndex("name") - while (it.moveToNext()) { - if (nameIndex != -1) { - existingColumns.add(it.getString(nameIndex)) - } - } - } - } catch (_: Exception) { - } - if (!existingColumns.contains("expiryTime")) { - db.execSQL("ALTER TABLE `users` ADD COLUMN `expiryTime` INTEGER NOT NULL DEFAULT 0") - } - if (!existingColumns.contains("profilePictureUrl")) { - db.execSQL("ALTER TABLE `users` ADD COLUMN `profilePictureUrl` TEXT") - } - if (!existingColumns.contains("isNew")) { - db.execSQL("ALTER TABLE `users` ADD COLUMN `isNew` INTEGER NOT NULL DEFAULT 0") - } - db.execSQL("ALTER TABLE `categories` ADD COLUMN `expiryTime` INTEGER NOT NULL DEFAULT 0") - db.execSQL("ALTER TABLE `goals` ADD COLUMN `expiryTime` INTEGER NOT NULL DEFAULT 0") - db.execSQL("ALTER TABLE `tasks` ADD COLUMN `expiryTime` INTEGER NOT NULL DEFAULT 0") - db.execSQL("ALTER TABLE `sessions` ADD COLUMN `expiryTime` INTEGER NOT NULL DEFAULT 0") - db.execSQL("ALTER TABLE `templates` ADD COLUMN `expiryTime` INTEGER NOT NULL DEFAULT 0") - db.execSQL("ALTER TABLE `cached_schedule_dates` ADD COLUMN `expiryTime` INTEGER NOT NULL DEFAULT 0") - } - } - - val MIGRATION_3_4 = object : Migration(3, 4) { - override fun migrate(db: SupportSQLiteDatabase) { - // 1. Ensure users table columns exist - val existingColumns = mutableSetOf() - try { - val cursor = db.query("PRAGMA table_info(`users`)") - cursor.use { - val nameIndex = it.getColumnIndex("name") - while (it.moveToNext()) { - if (nameIndex != -1) { - existingColumns.add(it.getString(nameIndex)) - } - } - } - } catch (_: Exception) { - } - if (!existingColumns.contains("expiryTime")) { - db.execSQL("ALTER TABLE `users` ADD COLUMN `expiryTime` INTEGER NOT NULL DEFAULT 0") - } - if (!existingColumns.contains("profilePictureUrl")) { - db.execSQL("ALTER TABLE `users` ADD COLUMN `profilePictureUrl` TEXT") - } - if (!existingColumns.contains("isNew")) { - db.execSQL("ALTER TABLE `users` ADD COLUMN `isNew` INTEGER NOT NULL DEFAULT 0") - } - - // 2. Recreate tasks table without goalId FK - db.execSQL( - """ - CREATE TABLE IF NOT EXISTS `tasks_v4` ( - `id` TEXT NOT NULL, - `title` TEXT NOT NULL, - `description` TEXT, - `estimatedDuration` INTEGER NOT NULL, - `status` TEXT NOT NULL, - `mandatory` INTEGER NOT NULL, - `estimatedPoints` INTEGER NOT NULL, - `allowTaskSplitting` INTEGER NOT NULL, - `goalId` TEXT, - `categoryId` TEXT, - `expiryTime` INTEGER NOT NULL DEFAULT 0, - PRIMARY KEY(`id`), - FOREIGN KEY(`categoryId`) REFERENCES `categories`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION - ) - """.trimIndent() - ) - - val taskColumns = mutableSetOf() - try { - val cursor = db.query("PRAGMA table_info(`tasks`)") - cursor.use { - val nameIndex = it.getColumnIndex("name") - while (it.moveToNext()) { - if (nameIndex != -1) { - taskColumns.add(it.getString(nameIndex)) - } - } - } - } catch (_: Exception) { - } - - val selectExpiry = if (taskColumns.contains("expiryTime")) "`expiryTime`" else "0 AS `expiryTime`" - - db.execSQL( - """ - INSERT INTO `tasks_v4` ( - `id`, `title`, `description`, `estimatedDuration`, `status`, - `mandatory`, `estimatedPoints`, `allowTaskSplitting`, `goalId`, `categoryId`, `expiryTime` - ) - SELECT - `id`, `title`, `description`, `estimatedDuration`, `status`, - `mandatory`, `estimatedPoints`, `allowTaskSplitting`, `goalId`, `categoryId`, $selectExpiry - FROM `tasks` - """.trimIndent() - ) - - db.execSQL("DROP TABLE `tasks`") - db.execSQL("ALTER TABLE `tasks_v4` RENAME TO `tasks`") - db.execSQL("CREATE INDEX IF NOT EXISTS `index_tasks_goalId` ON `tasks` (`goalId`)") - db.execSQL("CREATE INDEX IF NOT EXISTS `index_tasks_categoryId` ON `tasks` (`categoryId`)") - } - } - - val MIGRATION_4_5 = object : Migration(4, 5) { - override fun migrate(db: SupportSQLiteDatabase) { - db.execSQL( - """ - CREATE TABLE IF NOT EXISTS `store_items` ( - `id` TEXT NOT NULL, - `name` TEXT NOT NULL, - `description` TEXT NOT NULL, - `image` TEXT NOT NULL, - `info` TEXT, - `price` INTEGER NOT NULL, - `version` TEXT NOT NULL, - `type` TEXT NOT NULL, - `expiryTime` INTEGER NOT NULL DEFAULT 0, - PRIMARY KEY(`id`) - ) - """.trimIndent() - ) - db.execSQL( - """ - CREATE TABLE IF NOT EXISTS `owned_items` ( - `id` TEXT NOT NULL, - `itemId` TEXT NOT NULL, - `boughtAt` TEXT NOT NULL, - `expiryTime` INTEGER NOT NULL DEFAULT 0, - PRIMARY KEY(`id`) - ) - """.trimIndent() - ) - db.execSQL( - """ - CREATE TABLE IF NOT EXISTS `equipped_items` ( - `type` TEXT NOT NULL, - `itemId` TEXT NOT NULL, - `equippedAt` TEXT NOT NULL, - `expiryTime` INTEGER NOT NULL DEFAULT 0, - PRIMARY KEY(`type`) - ) - """.trimIndent() - ) - } - } - } } diff --git a/core/database/src/main/kotlin/com/awan/app/core/database/di/DatabaseModule.kt b/core/database/src/main/kotlin/com/awan/app/core/database/di/DatabaseModule.kt index f9fcdcf5..27889191 100644 --- a/core/database/src/main/kotlin/com/awan/app/core/database/di/DatabaseModule.kt +++ b/core/database/src/main/kotlin/com/awan/app/core/database/di/DatabaseModule.kt @@ -39,10 +39,6 @@ object DatabaseModule { AwanDatabase::class.java, "awan-database", ) - .addMigrations(AwanDatabase.MIGRATION_1_2) - .addMigrations(AwanDatabase.MIGRATION_2_3) - .addMigrations(AwanDatabase.MIGRATION_3_4) - .addMigrations(AwanDatabase.MIGRATION_4_5) .fallbackToDestructiveMigration(dropAllTables = true) .build() diff --git a/core/database/src/test/java/com/awan/app/core/database/Migration1To2Test.kt b/core/database/src/test/java/com/awan/app/core/database/Migration1To2Test.kt deleted file mode 100644 index 9778f3c8..00000000 --- a/core/database/src/test/java/com/awan/app/core/database/Migration1To2Test.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.awan.app.core.database - -import androidx.sqlite.db.SupportSQLiteDatabase -import org.junit.Assert.assertTrue -import org.junit.Test -import java.lang.reflect.Proxy - -class Migration1To2Test { - - @Test - fun migration1To2_executesExpectedSqlStatements() { - val sqlExecuted = mutableListOf() - - val dbProxy = Proxy.newProxyInstance( - SupportSQLiteDatabase::class.java.classLoader, - arrayOf(SupportSQLiteDatabase::class.java) - ) { _, method, args -> - if (method.name == "execSQL" && args != null && args.isNotEmpty()) { - sqlExecuted.add(args[0] as String) - } - null - } as SupportSQLiteDatabase - - AwanDatabase.MIGRATION_1_2.migrate(dbProxy) - - assertTrue(sqlExecuted.any { it.contains("CREATE TABLE IF NOT EXISTS `categories`") }) - assertTrue(sqlExecuted.any { it.contains("CREATE TABLE IF NOT EXISTS `tasks_new`") }) - assertTrue(sqlExecuted.any { it.contains("CREATE TABLE IF NOT EXISTS `sessions`") }) - assertTrue(sqlExecuted.any { it.contains("CREATE TABLE IF NOT EXISTS `cached_schedule_dates`") }) - } -} diff --git a/core/database/src/test/java/com/awan/app/core/database/Migration3To4Test.kt b/core/database/src/test/java/com/awan/app/core/database/Migration3To4Test.kt deleted file mode 100644 index 76781905..00000000 --- a/core/database/src/test/java/com/awan/app/core/database/Migration3To4Test.kt +++ /dev/null @@ -1,32 +0,0 @@ -package com.awan.app.core.database - -import androidx.sqlite.db.SupportSQLiteDatabase -import org.junit.Test -import java.lang.reflect.Proxy - -import org.junit.Assert.assertTrue - -class Migration3To4Test { - - @Test - fun migration3To4_executesExpectedColumnAdditions() { - val sqlExecuted = mutableListOf() - - val dbProxy = Proxy.newProxyInstance( - SupportSQLiteDatabase::class.java.classLoader, - arrayOf(SupportSQLiteDatabase::class.java) - ) { _, method, args -> - if (method.name == "execSQL" && args != null && args.isNotEmpty()) { - sqlExecuted.add(args[0] as String) - } - null - } as SupportSQLiteDatabase - - AwanDatabase.MIGRATION_3_4.migrate(dbProxy) - - assertTrue(sqlExecuted.any { it.contains("ALTER TABLE `users` ADD COLUMN `profilePictureUrl` TEXT") }) - assertTrue(sqlExecuted.any { it.contains("ALTER TABLE `users` ADD COLUMN `isNew` INTEGER NOT NULL DEFAULT 0") }) - assertTrue(sqlExecuted.any { it.contains("CREATE TABLE IF NOT EXISTS `tasks_v4`") }) - assertTrue(sqlExecuted.any { it.contains("DROP TABLE `tasks`") }) - } -} diff --git a/core/database/src/test/java/com/awan/app/core/database/Migration4To5Test.kt b/core/database/src/test/java/com/awan/app/core/database/Migration4To5Test.kt deleted file mode 100644 index a4378fc4..00000000 --- a/core/database/src/test/java/com/awan/app/core/database/Migration4To5Test.kt +++ /dev/null @@ -1,27 +0,0 @@ -package com.awan.app.core.database - -import androidx.sqlite.db.SupportSQLiteDatabase -import org.junit.Assert.assertTrue -import org.junit.Test -import java.lang.reflect.Proxy - -class Migration4To5Test { - - @Test - fun `migration creates the owned customizations table`() { - val sqlExecuted = mutableListOf() - val database = Proxy.newProxyInstance( - SupportSQLiteDatabase::class.java.classLoader, - arrayOf(SupportSQLiteDatabase::class.java), - ) { _, method, args -> - if (method.name == "execSQL" && args?.isNotEmpty() == true) sqlExecuted += args[0] as String - null - } as SupportSQLiteDatabase - - AwanDatabase.MIGRATION_4_5.migrate(database) - - assertTrue(sqlExecuted.any { it.contains("CREATE TABLE IF NOT EXISTS `store_items`") }) - assertTrue(sqlExecuted.any { it.contains("CREATE TABLE IF NOT EXISTS `owned_items`") }) - assertTrue(sqlExecuted.any { it.contains("CREATE TABLE IF NOT EXISTS `equipped_items`") }) - } -} diff --git a/core/design-system/src/main/java/com/awan/app/core/designsystem/AwanRemoteImage.kt b/core/design-system/src/main/java/com/awan/app/core/designsystem/AwanRemoteImage.kt index 786d4b48..1bebb730 100644 --- a/core/design-system/src/main/java/com/awan/app/core/designsystem/AwanRemoteImage.kt +++ b/core/design-system/src/main/java/com/awan/app/core/designsystem/AwanRemoteImage.kt @@ -15,6 +15,8 @@ fun AwanRemoteImage( contentDescription: String? = null, contentScale: ContentScale = ContentScale.Crop, ) { + if (url.isNullOrBlank()) return + AsyncImage( model = ImageRequest.Builder(LocalContext.current) .data(url)