From 91410b838f1607fc1b937e5a65ee811b9ce4a404 Mon Sep 17 00:00:00 2001 From: alperozturk Date: Wed, 25 Jun 2025 13:07:37 +0200 Subject: [PATCH 1/3] add missing migration Signed-off-by: alperozturk --- .../owncloud/notes/persistence/NotesDatabase.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesDatabase.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesDatabase.java index 1df1c22d1..b1fae2161 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesDatabase.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/NotesDatabase.java @@ -10,6 +10,7 @@ import android.util.Log; import androidx.annotation.NonNull; +import androidx.room.AutoMigration; import androidx.room.Database; import androidx.room.Room; import androidx.room.RoomDatabase; @@ -57,7 +58,8 @@ NotesListWidgetData.class, ShareEntity.class, Capabilities.class - }, version = 26 + }, version = 26, + autoMigrations = { @AutoMigration(from = 25, to = 26) } ) @TypeConverters({Converters.class}) public abstract class NotesDatabase extends RoomDatabase { @@ -96,8 +98,6 @@ private static NotesDatabase create(final Context context) { new Migration_23_24(context), new Migration_24_25() ) - .fallbackToDestructiveMigrationOnDowngrade() - .fallbackToDestructiveMigration() .addCallback(new RoomDatabase.Callback() { @Override public void onCreate(@NonNull SupportSQLiteDatabase db) { From b351c4274f3ab8b2a0f49c33f02bd0ca6fa06636 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 25 Jun 2025 13:27:52 +0200 Subject: [PATCH 2/3] add schema Signed-off-by: tobiasKaminsky --- .../23.json | 552 +++++++++++++ .../25.json | 558 +++++++++++++ .../26.json | 736 ++++++++++++++++++ 3 files changed, 1846 insertions(+) create mode 100644 app/schemas/it.niedermann.owncloud.notes.persistence.NotesDatabase/23.json create mode 100644 app/schemas/it.niedermann.owncloud.notes.persistence.NotesDatabase/25.json create mode 100644 app/schemas/it.niedermann.owncloud.notes.persistence.NotesDatabase/26.json diff --git a/app/schemas/it.niedermann.owncloud.notes.persistence.NotesDatabase/23.json b/app/schemas/it.niedermann.owncloud.notes.persistence.NotesDatabase/23.json new file mode 100644 index 000000000..06a2734ce --- /dev/null +++ b/app/schemas/it.niedermann.owncloud.notes.persistence.NotesDatabase/23.json @@ -0,0 +1,552 @@ +{ + "formatVersion": 1, + "database": { + "version": 23, + "identityHash": "5fc7181c6704e064e93b6eed8671aebb", + "entities": [ + { + "tableName": "Account", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `url` TEXT NOT NULL DEFAULT '', `userName` TEXT NOT NULL DEFAULT '', `accountName` TEXT NOT NULL DEFAULT '', `eTag` TEXT, `modified` INTEGER, `apiVersion` TEXT, `color` INTEGER NOT NULL DEFAULT -16743735, `textColor` INTEGER NOT NULL DEFAULT -16777216, `capabilitiesETag` TEXT, `displayName` TEXT)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "url", + "columnName": "url", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "userName", + "columnName": "userName", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "accountName", + "columnName": "accountName", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "eTag", + "columnName": "eTag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "modified", + "columnName": "modified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "apiVersion", + "columnName": "apiVersion", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "color", + "columnName": "color", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "-16743735" + }, + { + "fieldPath": "textColor", + "columnName": "textColor", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "-16777216" + }, + { + "fieldPath": "capabilitiesETag", + "columnName": "capabilitiesETag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "displayName", + "columnName": "displayName", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "IDX_ACCOUNT_MODIFIED", + "unique": false, + "columnNames": [ + "modified" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_MODIFIED` ON `${TABLE_NAME}` (`modified`)" + }, + { + "name": "IDX_ACCOUNT_URL", + "unique": false, + "columnNames": [ + "url" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_URL` ON `${TABLE_NAME}` (`url`)" + }, + { + "name": "IDX_ACCOUNT_USERNAME", + "unique": false, + "columnNames": [ + "userName" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_USERNAME` ON `${TABLE_NAME}` (`userName`)" + }, + { + "name": "IDX_ACCOUNT_ACCOUNTNAME", + "unique": false, + "columnNames": [ + "accountName" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_ACCOUNTNAME` ON `${TABLE_NAME}` (`accountName`)" + }, + { + "name": "IDX_ACCOUNT_ETAG", + "unique": false, + "columnNames": [ + "eTag" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_ETAG` ON `${TABLE_NAME}` (`eTag`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "Note", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `remoteId` INTEGER, `accountId` INTEGER NOT NULL, `status` TEXT NOT NULL, `title` TEXT NOT NULL DEFAULT '', `category` TEXT NOT NULL DEFAULT '', `modified` INTEGER, `content` TEXT NOT NULL DEFAULT '', `favorite` INTEGER NOT NULL DEFAULT 0, `eTag` TEXT, `excerpt` TEXT NOT NULL DEFAULT '', `scrollY` INTEGER NOT NULL DEFAULT 0, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "remoteId", + "columnName": "remoteId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "title", + "columnName": "title", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "modified", + "columnName": "modified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "favorite", + "columnName": "favorite", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "eTag", + "columnName": "eTag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "excerpt", + "columnName": "excerpt", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "scrollY", + "columnName": "scrollY", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "IDX_NOTE_ACCOUNTID", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_ACCOUNTID` ON `${TABLE_NAME}` (`accountId`)" + }, + { + "name": "IDX_NOTE_CATEGORY", + "unique": false, + "columnNames": [ + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_CATEGORY` ON `${TABLE_NAME}` (`category`)" + }, + { + "name": "IDX_NOTE_FAVORITE", + "unique": false, + "columnNames": [ + "favorite" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_FAVORITE` ON `${TABLE_NAME}` (`favorite`)" + }, + { + "name": "IDX_NOTE_MODIFIED", + "unique": false, + "columnNames": [ + "modified" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_MODIFIED` ON `${TABLE_NAME}` (`modified`)" + }, + { + "name": "IDX_NOTE_REMOTEID", + "unique": false, + "columnNames": [ + "remoteId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_REMOTEID` ON `${TABLE_NAME}` (`remoteId`)" + }, + { + "name": "IDX_NOTE_STATUS", + "unique": false, + "columnNames": [ + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_STATUS` ON `${TABLE_NAME}` (`status`)" + } + ], + "foreignKeys": [ + { + "table": "Account", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "accountId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "CategoryOptions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `category` TEXT NOT NULL, `sortingMethod` INTEGER, PRIMARY KEY(`accountId`, `category`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sortingMethod", + "columnName": "sortingMethod", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "accountId", + "category" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "IDX_CATEGORIYOPTIONS_ACCOUNTID", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_CATEGORIYOPTIONS_ACCOUNTID` ON `${TABLE_NAME}` (`accountId`)" + }, + { + "name": "IDX_CATEGORIYOPTIONS_CATEGORY", + "unique": false, + "columnNames": [ + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_CATEGORIYOPTIONS_CATEGORY` ON `${TABLE_NAME}` (`category`)" + }, + { + "name": "IDX_CATEGORIYOPTIONS_SORTING_METHOD", + "unique": false, + "columnNames": [ + "sortingMethod" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_CATEGORIYOPTIONS_SORTING_METHOD` ON `${TABLE_NAME}` (`sortingMethod`)" + }, + { + "name": "IDX_UNIQUE_CATEGORYOPTIONS_ACCOUNT_CATEGORY", + "unique": true, + "columnNames": [ + "accountId", + "category" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `IDX_UNIQUE_CATEGORYOPTIONS_ACCOUNT_CATEGORY` ON `${TABLE_NAME}` (`accountId`, `category`)" + } + ], + "foreignKeys": [ + { + "table": "Account", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "accountId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "SingleNoteWidgetData", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`noteId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `accountId` INTEGER NOT NULL, `themeMode` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`noteId`) REFERENCES `Note`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "noteId", + "columnName": "noteId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "themeMode", + "columnName": "themeMode", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "IDX_SINGLENOTEWIDGETDATA_ACCOUNTID", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_SINGLENOTEWIDGETDATA_ACCOUNTID` ON `${TABLE_NAME}` (`accountId`)" + }, + { + "name": "IDX_SINGLENOTEWIDGETDATA_NOTEID", + "unique": false, + "columnNames": [ + "noteId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_SINGLENOTEWIDGETDATA_NOTEID` ON `${TABLE_NAME}` (`noteId`)" + } + ], + "foreignKeys": [ + { + "table": "Account", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "accountId" + ], + "referencedColumns": [ + "id" + ] + }, + { + "table": "Note", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "noteId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "NotesListWidgetData", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`mode` INTEGER NOT NULL, `category` TEXT, `id` INTEGER NOT NULL, `accountId` INTEGER NOT NULL, `themeMode` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "mode", + "columnName": "mode", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "themeMode", + "columnName": "themeMode", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [ + { + "name": "IDX_NOTESLISTWIDGETDATA_ACCOUNTID", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTESLISTWIDGETDATA_ACCOUNTID` ON `${TABLE_NAME}` (`accountId`)" + }, + { + "name": "IDX_NOTESLISTWIDGETDATA_CATEGORY", + "unique": false, + "columnNames": [ + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTESLISTWIDGETDATA_CATEGORY` ON `${TABLE_NAME}` (`category`)" + }, + { + "name": "IDX_NOTESLISTWIDGETDATA_ACCOUNT_CATEGORY", + "unique": false, + "columnNames": [ + "accountId", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTESLISTWIDGETDATA_ACCOUNT_CATEGORY` ON `${TABLE_NAME}` (`accountId`, `category`)" + } + ], + "foreignKeys": [ + { + "table": "Account", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "accountId" + ], + "referencedColumns": [ + "id" + ] + } + ] + } + ], + "views": [], + "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, '5fc7181c6704e064e93b6eed8671aebb')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/it.niedermann.owncloud.notes.persistence.NotesDatabase/25.json b/app/schemas/it.niedermann.owncloud.notes.persistence.NotesDatabase/25.json new file mode 100644 index 000000000..f58e822f4 --- /dev/null +++ b/app/schemas/it.niedermann.owncloud.notes.persistence.NotesDatabase/25.json @@ -0,0 +1,558 @@ +{ + "formatVersion": 1, + "database": { + "version": 25, + "identityHash": "9b00e53dea304e4935e248d285676d72", + "entities": [ + { + "tableName": "Account", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `url` TEXT NOT NULL DEFAULT '', `userName` TEXT NOT NULL DEFAULT '', `accountName` TEXT NOT NULL DEFAULT '', `eTag` TEXT, `modified` INTEGER, `apiVersion` TEXT, `color` INTEGER NOT NULL DEFAULT -16743735, `textColor` INTEGER NOT NULL DEFAULT -16777216, `capabilitiesETag` TEXT, `displayName` TEXT, `directEditingAvailable` INTEGER NOT NULL)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "url", + "columnName": "url", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "userName", + "columnName": "userName", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "accountName", + "columnName": "accountName", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "eTag", + "columnName": "eTag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "modified", + "columnName": "modified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "apiVersion", + "columnName": "apiVersion", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "color", + "columnName": "color", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "-16743735" + }, + { + "fieldPath": "textColor", + "columnName": "textColor", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "-16777216" + }, + { + "fieldPath": "capabilitiesETag", + "columnName": "capabilitiesETag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "displayName", + "columnName": "displayName", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "directEditingAvailable", + "columnName": "directEditingAvailable", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "IDX_ACCOUNT_MODIFIED", + "unique": false, + "columnNames": [ + "modified" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_MODIFIED` ON `${TABLE_NAME}` (`modified`)" + }, + { + "name": "IDX_ACCOUNT_URL", + "unique": false, + "columnNames": [ + "url" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_URL` ON `${TABLE_NAME}` (`url`)" + }, + { + "name": "IDX_ACCOUNT_USERNAME", + "unique": false, + "columnNames": [ + "userName" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_USERNAME` ON `${TABLE_NAME}` (`userName`)" + }, + { + "name": "IDX_ACCOUNT_ACCOUNTNAME", + "unique": false, + "columnNames": [ + "accountName" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_ACCOUNTNAME` ON `${TABLE_NAME}` (`accountName`)" + }, + { + "name": "IDX_ACCOUNT_ETAG", + "unique": false, + "columnNames": [ + "eTag" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_ETAG` ON `${TABLE_NAME}` (`eTag`)" + } + ], + "foreignKeys": [] + }, + { + "tableName": "Note", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `remoteId` INTEGER, `accountId` INTEGER NOT NULL, `status` TEXT NOT NULL, `title` TEXT NOT NULL DEFAULT '', `category` TEXT NOT NULL DEFAULT '', `modified` INTEGER, `content` TEXT NOT NULL DEFAULT '', `favorite` INTEGER NOT NULL DEFAULT 0, `eTag` TEXT, `excerpt` TEXT NOT NULL DEFAULT '', `scrollY` INTEGER NOT NULL DEFAULT 0, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "remoteId", + "columnName": "remoteId", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "title", + "columnName": "title", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "modified", + "columnName": "modified", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "favorite", + "columnName": "favorite", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "eTag", + "columnName": "eTag", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "excerpt", + "columnName": "excerpt", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "scrollY", + "columnName": "scrollY", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "IDX_NOTE_ACCOUNTID", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_ACCOUNTID` ON `${TABLE_NAME}` (`accountId`)" + }, + { + "name": "IDX_NOTE_CATEGORY", + "unique": false, + "columnNames": [ + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_CATEGORY` ON `${TABLE_NAME}` (`category`)" + }, + { + "name": "IDX_NOTE_FAVORITE", + "unique": false, + "columnNames": [ + "favorite" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_FAVORITE` ON `${TABLE_NAME}` (`favorite`)" + }, + { + "name": "IDX_NOTE_MODIFIED", + "unique": false, + "columnNames": [ + "modified" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_MODIFIED` ON `${TABLE_NAME}` (`modified`)" + }, + { + "name": "IDX_NOTE_REMOTEID", + "unique": false, + "columnNames": [ + "remoteId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_REMOTEID` ON `${TABLE_NAME}` (`remoteId`)" + }, + { + "name": "IDX_NOTE_STATUS", + "unique": false, + "columnNames": [ + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_STATUS` ON `${TABLE_NAME}` (`status`)" + } + ], + "foreignKeys": [ + { + "table": "Account", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "accountId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "CategoryOptions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `category` TEXT NOT NULL, `sortingMethod` INTEGER, PRIMARY KEY(`accountId`, `category`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sortingMethod", + "columnName": "sortingMethod", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "accountId", + "category" + ] + }, + "indices": [ + { + "name": "IDX_CATEGORIYOPTIONS_ACCOUNTID", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_CATEGORIYOPTIONS_ACCOUNTID` ON `${TABLE_NAME}` (`accountId`)" + }, + { + "name": "IDX_CATEGORIYOPTIONS_CATEGORY", + "unique": false, + "columnNames": [ + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_CATEGORIYOPTIONS_CATEGORY` ON `${TABLE_NAME}` (`category`)" + }, + { + "name": "IDX_CATEGORIYOPTIONS_SORTING_METHOD", + "unique": false, + "columnNames": [ + "sortingMethod" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_CATEGORIYOPTIONS_SORTING_METHOD` ON `${TABLE_NAME}` (`sortingMethod`)" + }, + { + "name": "IDX_UNIQUE_CATEGORYOPTIONS_ACCOUNT_CATEGORY", + "unique": true, + "columnNames": [ + "accountId", + "category" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `IDX_UNIQUE_CATEGORYOPTIONS_ACCOUNT_CATEGORY` ON `${TABLE_NAME}` (`accountId`, `category`)" + } + ], + "foreignKeys": [ + { + "table": "Account", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "accountId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "SingleNoteWidgetData", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`noteId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `accountId` INTEGER NOT NULL, `themeMode` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`noteId`) REFERENCES `Note`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "noteId", + "columnName": "noteId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "themeMode", + "columnName": "themeMode", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "IDX_SINGLENOTEWIDGETDATA_ACCOUNTID", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_SINGLENOTEWIDGETDATA_ACCOUNTID` ON `${TABLE_NAME}` (`accountId`)" + }, + { + "name": "IDX_SINGLENOTEWIDGETDATA_NOTEID", + "unique": false, + "columnNames": [ + "noteId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_SINGLENOTEWIDGETDATA_NOTEID` ON `${TABLE_NAME}` (`noteId`)" + } + ], + "foreignKeys": [ + { + "table": "Account", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "accountId" + ], + "referencedColumns": [ + "id" + ] + }, + { + "table": "Note", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "noteId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "NotesListWidgetData", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`mode` INTEGER NOT NULL, `category` TEXT, `id` INTEGER NOT NULL, `accountId` INTEGER NOT NULL, `themeMode` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "mode", + "columnName": "mode", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "themeMode", + "columnName": "themeMode", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "IDX_NOTESLISTWIDGETDATA_ACCOUNTID", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTESLISTWIDGETDATA_ACCOUNTID` ON `${TABLE_NAME}` (`accountId`)" + }, + { + "name": "IDX_NOTESLISTWIDGETDATA_CATEGORY", + "unique": false, + "columnNames": [ + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTESLISTWIDGETDATA_CATEGORY` ON `${TABLE_NAME}` (`category`)" + }, + { + "name": "IDX_NOTESLISTWIDGETDATA_ACCOUNT_CATEGORY", + "unique": false, + "columnNames": [ + "accountId", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTESLISTWIDGETDATA_ACCOUNT_CATEGORY` ON `${TABLE_NAME}` (`accountId`, `category`)" + } + ], + "foreignKeys": [ + { + "table": "Account", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "accountId" + ], + "referencedColumns": [ + "id" + ] + } + ] + } + ], + "views": [], + "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, '9b00e53dea304e4935e248d285676d72')" + ] + } +} \ No newline at end of file diff --git a/app/schemas/it.niedermann.owncloud.notes.persistence.NotesDatabase/26.json b/app/schemas/it.niedermann.owncloud.notes.persistence.NotesDatabase/26.json new file mode 100644 index 000000000..986f130f5 --- /dev/null +++ b/app/schemas/it.niedermann.owncloud.notes.persistence.NotesDatabase/26.json @@ -0,0 +1,736 @@ +{ + "formatVersion": 1, + "database": { + "version": 26, + "identityHash": "4c7952bc0b0f34aa3a01390340a91eb7", + "entities": [ + { + "tableName": "Account", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `url` TEXT NOT NULL DEFAULT '', `userName` TEXT NOT NULL DEFAULT '', `accountName` TEXT NOT NULL DEFAULT '', `eTag` TEXT, `modified` INTEGER, `apiVersion` TEXT, `color` INTEGER NOT NULL DEFAULT -16743735, `textColor` INTEGER NOT NULL DEFAULT -16777216, `capabilitiesETag` TEXT, `displayName` TEXT, `directEditingAvailable` INTEGER NOT NULL)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "url", + "columnName": "url", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "userName", + "columnName": "userName", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "accountName", + "columnName": "accountName", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "eTag", + "columnName": "eTag", + "affinity": "TEXT" + }, + { + "fieldPath": "modified", + "columnName": "modified", + "affinity": "INTEGER" + }, + { + "fieldPath": "apiVersion", + "columnName": "apiVersion", + "affinity": "TEXT" + }, + { + "fieldPath": "color", + "columnName": "color", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "-16743735" + }, + { + "fieldPath": "textColor", + "columnName": "textColor", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "-16777216" + }, + { + "fieldPath": "capabilitiesETag", + "columnName": "capabilitiesETag", + "affinity": "TEXT" + }, + { + "fieldPath": "displayName", + "columnName": "displayName", + "affinity": "TEXT" + }, + { + "fieldPath": "directEditingAvailable", + "columnName": "directEditingAvailable", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "IDX_ACCOUNT_MODIFIED", + "unique": false, + "columnNames": [ + "modified" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_MODIFIED` ON `${TABLE_NAME}` (`modified`)" + }, + { + "name": "IDX_ACCOUNT_URL", + "unique": false, + "columnNames": [ + "url" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_URL` ON `${TABLE_NAME}` (`url`)" + }, + { + "name": "IDX_ACCOUNT_USERNAME", + "unique": false, + "columnNames": [ + "userName" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_USERNAME` ON `${TABLE_NAME}` (`userName`)" + }, + { + "name": "IDX_ACCOUNT_ACCOUNTNAME", + "unique": false, + "columnNames": [ + "accountName" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_ACCOUNTNAME` ON `${TABLE_NAME}` (`accountName`)" + }, + { + "name": "IDX_ACCOUNT_ETAG", + "unique": false, + "columnNames": [ + "eTag" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_ACCOUNT_ETAG` ON `${TABLE_NAME}` (`eTag`)" + } + ] + }, + { + "tableName": "Note", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `remoteId` INTEGER, `accountId` INTEGER NOT NULL, `status` TEXT NOT NULL, `title` TEXT NOT NULL DEFAULT '', `category` TEXT NOT NULL DEFAULT '', `modified` INTEGER, `content` TEXT NOT NULL DEFAULT '', `favorite` INTEGER NOT NULL DEFAULT 0, `isShared` INTEGER NOT NULL DEFAULT 0, `readonly` INTEGER NOT NULL DEFAULT 0, `eTag` TEXT, `excerpt` TEXT NOT NULL DEFAULT '', `scrollY` INTEGER NOT NULL DEFAULT 0, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "remoteId", + "columnName": "remoteId", + "affinity": "INTEGER" + }, + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "status", + "columnName": "status", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "title", + "columnName": "title", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "modified", + "columnName": "modified", + "affinity": "INTEGER" + }, + { + "fieldPath": "content", + "columnName": "content", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "favorite", + "columnName": "favorite", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "isShared", + "columnName": "isShared", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "readonly", + "columnName": "readonly", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + }, + { + "fieldPath": "eTag", + "columnName": "eTag", + "affinity": "TEXT" + }, + { + "fieldPath": "excerpt", + "columnName": "excerpt", + "affinity": "TEXT", + "notNull": true, + "defaultValue": "''" + }, + { + "fieldPath": "scrollY", + "columnName": "scrollY", + "affinity": "INTEGER", + "notNull": true, + "defaultValue": "0" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "IDX_NOTE_ACCOUNTID", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_ACCOUNTID` ON `${TABLE_NAME}` (`accountId`)" + }, + { + "name": "IDX_NOTE_CATEGORY", + "unique": false, + "columnNames": [ + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_CATEGORY` ON `${TABLE_NAME}` (`category`)" + }, + { + "name": "IDX_NOTE_FAVORITE", + "unique": false, + "columnNames": [ + "favorite" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_FAVORITE` ON `${TABLE_NAME}` (`favorite`)" + }, + { + "name": "IDX_NOTE_IS_SHARED", + "unique": false, + "columnNames": [ + "isShared" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_IS_SHARED` ON `${TABLE_NAME}` (`isShared`)" + }, + { + "name": "IDX_READONLY", + "unique": false, + "columnNames": [ + "readonly" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_READONLY` ON `${TABLE_NAME}` (`readonly`)" + }, + { + "name": "IDX_NOTE_MODIFIED", + "unique": false, + "columnNames": [ + "modified" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_MODIFIED` ON `${TABLE_NAME}` (`modified`)" + }, + { + "name": "IDX_NOTE_REMOTEID", + "unique": false, + "columnNames": [ + "remoteId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_REMOTEID` ON `${TABLE_NAME}` (`remoteId`)" + }, + { + "name": "IDX_NOTE_STATUS", + "unique": false, + "columnNames": [ + "status" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTE_STATUS` ON `${TABLE_NAME}` (`status`)" + } + ], + "foreignKeys": [ + { + "table": "Account", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "accountId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "CategoryOptions", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`accountId` INTEGER NOT NULL, `category` TEXT NOT NULL, `sortingMethod` INTEGER, PRIMARY KEY(`accountId`, `category`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "sortingMethod", + "columnName": "sortingMethod", + "affinity": "INTEGER" + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "accountId", + "category" + ] + }, + "indices": [ + { + "name": "IDX_CATEGORIYOPTIONS_ACCOUNTID", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_CATEGORIYOPTIONS_ACCOUNTID` ON `${TABLE_NAME}` (`accountId`)" + }, + { + "name": "IDX_CATEGORIYOPTIONS_CATEGORY", + "unique": false, + "columnNames": [ + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_CATEGORIYOPTIONS_CATEGORY` ON `${TABLE_NAME}` (`category`)" + }, + { + "name": "IDX_CATEGORIYOPTIONS_SORTING_METHOD", + "unique": false, + "columnNames": [ + "sortingMethod" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_CATEGORIYOPTIONS_SORTING_METHOD` ON `${TABLE_NAME}` (`sortingMethod`)" + }, + { + "name": "IDX_UNIQUE_CATEGORYOPTIONS_ACCOUNT_CATEGORY", + "unique": true, + "columnNames": [ + "accountId", + "category" + ], + "orders": [], + "createSql": "CREATE UNIQUE INDEX IF NOT EXISTS `IDX_UNIQUE_CATEGORYOPTIONS_ACCOUNT_CATEGORY` ON `${TABLE_NAME}` (`accountId`, `category`)" + } + ], + "foreignKeys": [ + { + "table": "Account", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "accountId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "SingleNoteWidgetData", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`noteId` INTEGER NOT NULL, `id` INTEGER NOT NULL, `accountId` INTEGER NOT NULL, `themeMode` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`noteId`) REFERENCES `Note`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "noteId", + "columnName": "noteId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "themeMode", + "columnName": "themeMode", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "IDX_SINGLENOTEWIDGETDATA_ACCOUNTID", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_SINGLENOTEWIDGETDATA_ACCOUNTID` ON `${TABLE_NAME}` (`accountId`)" + }, + { + "name": "IDX_SINGLENOTEWIDGETDATA_NOTEID", + "unique": false, + "columnNames": [ + "noteId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_SINGLENOTEWIDGETDATA_NOTEID` ON `${TABLE_NAME}` (`noteId`)" + } + ], + "foreignKeys": [ + { + "table": "Account", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "accountId" + ], + "referencedColumns": [ + "id" + ] + }, + { + "table": "Note", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "noteId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "NotesListWidgetData", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`mode` INTEGER NOT NULL, `category` TEXT, `id` INTEGER NOT NULL, `accountId` INTEGER NOT NULL, `themeMode` INTEGER NOT NULL, PRIMARY KEY(`id`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "mode", + "columnName": "mode", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "category", + "columnName": "category", + "affinity": "TEXT" + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountId", + "columnName": "accountId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "themeMode", + "columnName": "themeMode", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "autoGenerate": false, + "columnNames": [ + "id" + ] + }, + "indices": [ + { + "name": "IDX_NOTESLISTWIDGETDATA_ACCOUNTID", + "unique": false, + "columnNames": [ + "accountId" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTESLISTWIDGETDATA_ACCOUNTID` ON `${TABLE_NAME}` (`accountId`)" + }, + { + "name": "IDX_NOTESLISTWIDGETDATA_CATEGORY", + "unique": false, + "columnNames": [ + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTESLISTWIDGETDATA_CATEGORY` ON `${TABLE_NAME}` (`category`)" + }, + { + "name": "IDX_NOTESLISTWIDGETDATA_ACCOUNT_CATEGORY", + "unique": false, + "columnNames": [ + "accountId", + "category" + ], + "orders": [], + "createSql": "CREATE INDEX IF NOT EXISTS `IDX_NOTESLISTWIDGETDATA_ACCOUNT_CATEGORY` ON `${TABLE_NAME}` (`accountId`, `category`)" + } + ], + "foreignKeys": [ + { + "table": "Account", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "accountId" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "share_table", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `note` TEXT, `path` TEXT, `file_target` TEXT, `share_with` TEXT, `share_with_displayname` TEXT, `uid_file_owner` TEXT, `displayname_file_owner` TEXT, `uid_owner` TEXT, `displayname_owner` TEXT, `url` TEXT)", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER" + }, + { + "fieldPath": "note", + "columnName": "note", + "affinity": "TEXT" + }, + { + "fieldPath": "path", + "columnName": "path", + "affinity": "TEXT" + }, + { + "fieldPath": "file_target", + "columnName": "file_target", + "affinity": "TEXT" + }, + { + "fieldPath": "share_with", + "columnName": "share_with", + "affinity": "TEXT" + }, + { + "fieldPath": "share_with_displayname", + "columnName": "share_with_displayname", + "affinity": "TEXT" + }, + { + "fieldPath": "uid_file_owner", + "columnName": "uid_file_owner", + "affinity": "TEXT" + }, + { + "fieldPath": "displayname_file_owner", + "columnName": "displayname_file_owner", + "affinity": "TEXT" + }, + { + "fieldPath": "uid_owner", + "columnName": "uid_owner", + "affinity": "TEXT" + }, + { + "fieldPath": "displayname_owner", + "columnName": "displayname_owner", + "affinity": "TEXT" + }, + { + "fieldPath": "url", + "columnName": "url", + "affinity": "TEXT" + } + ], + "primaryKey": { + "autoGenerate": true, + "columnNames": [ + "id" + ] + } + }, + { + "tableName": "capabilities", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `nextcloudMajorVersion` TEXT, `nextcloudMinorVersion` TEXT, `nextcloudMicroVersion` TEXT, `federationShare` INTEGER NOT NULL, `apiVersion` TEXT, `color` INTEGER NOT NULL, `textColor` INTEGER NOT NULL, `eTag` TEXT, `directEditingAvailable` INTEGER NOT NULL, `publicPasswordEnforced` INTEGER NOT NULL, `askForOptionalPassword` INTEGER NOT NULL, `isReSharingAllowed` INTEGER NOT NULL, `defaultPermission` INTEGER NOT NULL, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "nextcloudMajorVersion", + "columnName": "nextcloudMajorVersion", + "affinity": "TEXT" + }, + { + "fieldPath": "nextcloudMinorVersion", + "columnName": "nextcloudMinorVersion", + "affinity": "TEXT" + }, + { + "fieldPath": "nextcloudMicroVersion", + "columnName": "nextcloudMicroVersion", + "affinity": "TEXT" + }, + { + "fieldPath": "federationShare", + "columnName": "federationShare", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "apiVersion", + "columnName": "apiVersion", + "affinity": "TEXT" + }, + { + "fieldPath": "color", + "columnName": "color", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "textColor", + "columnName": "textColor", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "eTag", + "columnName": "eTag", + "affinity": "TEXT" + }, + { + "fieldPath": "directEditingAvailable", + "columnName": "directEditingAvailable", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "publicPasswordEnforced", + "columnName": "publicPasswordEnforced", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "askForOptionalPassword", + "columnName": "askForOptionalPassword", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isReSharingAllowed", + "columnName": "isReSharingAllowed", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "defaultPermission", + "columnName": "defaultPermission", + "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, '4c7952bc0b0f34aa3a01390340a91eb7')" + ] + } +} \ No newline at end of file From e6e867588d783eb3cf5c10e9524bf434e8a4df32 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 25 Jun 2025 13:30:41 +0200 Subject: [PATCH 3/3] fix REUSE.toml Signed-off-by: tobiasKaminsky --- REUSE.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REUSE.toml b/REUSE.toml index 024e62513..3233039e9 100644 --- a/REUSE.toml +++ b/REUSE.toml @@ -6,7 +6,7 @@ SPDX-PackageSupplier = "Nextcloud Android team " SPDX-PackageDownloadLocation = "https://github.com/nextcloud/notes-android" [[annotations]] -path = ["app/src/main/res/values-**/strings.xml", "renovate.json5", "**/.gitignore", ".idea/**", "scripts/analysis/findbugs-results.txt", "scripts/analysis/lint-results.txt", "app/src/test/resources/robolectric.properties", "app/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker", "fastlane/metadata/**", "app/src/main/res/mipmap-**dpi/ic_launcher.png", "app/src/main/ic_launcher-web.png", ".bundle/config", "app/src/main/res/drawable-**dpi/ic_widget_create.png", "app/src/main/res/drawable-mdpi/context_based_formatting.png", "app/src/main/res/drawable/note_list_widget_preview.webp", "app/src/main/res/drawable/single_note_widget.webp"] +path = ["app/schemas/it.niedermann.owncloud.notes.persistence.NotesDatabase/**.json", "app/src/main/res/values-**/strings.xml", "renovate.json5", "**/.gitignore", ".idea/**", "scripts/analysis/findbugs-results.txt", "scripts/analysis/lint-results.txt", "app/src/test/resources/robolectric.properties", "app/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker", "fastlane/metadata/**", "app/src/main/res/mipmap-**dpi/ic_launcher.png", "app/src/main/ic_launcher-web.png", ".bundle/config", "app/src/main/res/drawable-**dpi/ic_widget_create.png", "app/src/main/res/drawable-mdpi/context_based_formatting.png", "app/src/main/res/drawable/note_list_widget_preview.webp", "app/src/main/res/drawable/single_note_widget.webp"] precedence = "aggregate" SPDX-FileCopyrightText = "2016-2024 Nextcloud GmbH and Nextcloud contributors" SPDX-License-Identifier = "GPL-3.0-or-later"