Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-notes.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Niedermann <info@niedermann.it>2020-10-09 15:50:52 +0300
committerStefan Niedermann <info@niedermann.it>2020-10-09 15:50:52 +0300
commit3d31b2f9b3ab0e4531588a4a7c2b53e53fe68202 (patch)
treedae92e8ce1d595d697198b31d822c8a37b776414 /app/src/main/java/it/niedermann/owncloud/notes/persistence/migration
parentebe02f72097578e06d5c76373cb9fa79796bb5aa (diff)
#831 Migrate from SQLiteOpenHelper to Room
Fix migration
Diffstat (limited to 'app/src/main/java/it/niedermann/owncloud/notes/persistence/migration')
-rw-r--r--app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_19_20.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_19_20.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_19_20.java
index 0fcf6b72..8ed7ae1a 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_19_20.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_19_20.java
@@ -37,9 +37,9 @@ public class Migration_19_20 extends Migration {
db.execSQL("DROP INDEX NOTES_CATEGORY_idx");
db.execSQL("DROP INDEX NOTES_MODIFIED_idx");
- db.execSQL("CREATE TABLE `Account` (`id` INTEGER, `url` TEXT, `userName` TEXT, `accountName` TEXT, `eTag` TEXT, `modified` INTEGER, `apiVersion` TEXT, `color` INTEGER DEFAULT -16743735, `textColor` INTEGER DEFAULT -16777216, `capabilitiesETag` TEXT, PRIMARY KEY(`id`))");
- db.execSQL("CREATE TABLE `Category` (`id` INTEGER NOT NULL, `accountId` INTEGER NOT NULL, `title` TEXT, `sortingMethod` INTEGER, PRIMARY KEY(`id`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )");
- db.execSQL("CREATE TABLE `Note` (`id` INTEGER, `remoteId` INTEGER, `accountId` INTEGER, `status` TEXT, `title` TEXT, `modified` INTEGER DEFAULT 0, `content` TEXT, `favorite` INTEGER DEFAULT 0, `categoryId` INTEGER, `eTag` TEXT, `excerpt` TEXT NOT NULL DEFAULT '', `scrollY` INTEGER DEFAULT 0, PRIMARY KEY(`id`), FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`categoryId`) REFERENCES `Category`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )");
+ db.execSQL("CREATE TABLE `Account` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `url` TEXT, `userName` TEXT, `accountName` TEXT, `eTag` TEXT, `modified` INTEGER, `apiVersion` TEXT, `color` INTEGER DEFAULT -16743735, `textColor` INTEGER DEFAULT -16777216, `capabilitiesETag` TEXT)");
+ db.execSQL("CREATE TABLE `Category` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `accountId` INTEGER NOT NULL, `title` TEXT, `sortingMethod` INTEGER, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )");
+ db.execSQL("CREATE TABLE `Note` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `remoteId` INTEGER, `accountId` INTEGER, `status` TEXT, `title` TEXT, `modified` INTEGER DEFAULT 0, `content` TEXT, `favorite` INTEGER DEFAULT 0, `categoryId` INTEGER, `eTag` TEXT, `excerpt` TEXT NOT NULL DEFAULT '', `scrollY` INTEGER DEFAULT 0, FOREIGN KEY(`accountId`) REFERENCES `Account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`categoryId`) REFERENCES `Category`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )");
db.execSQL("CREATE TABLE `NotesListWidgetData` (`mode` INTEGER NOT NULL, `categoryId` INTEGER, `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(`categoryId`) REFERENCES `Category`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )");
db.execSQL("CREATE TABLE `SingleNoteWidgetData` (`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 )");