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-14 20:40:23 +0300
committerStefan Niedermann <info@niedermann.it>2020-10-14 20:40:23 +0300
commitf9cf63d9497804dca721ad7892167ffe201f4735 (patch)
tree11245a2f47a162588cb0936ba5fb6bc9312ff6c7 /app/src/main/java/it/niedermann/owncloud/notes/persistence/migration
parent84b84729fa5efeeaa53a682b4abeabb77e2a2b35 (diff)
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.java2
1 files changed, 2 insertions, 0 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 ca42803d..bff6f181 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
@@ -63,6 +63,8 @@ public class Migration_19_20 extends Migration {
db.execSQL("CREATE INDEX `IDX_SINGLENOTEWIDGETDATA_ACCOUNTID` ON `SingleNoteWidgetData` (`accountId`)");
db.execSQL("CREATE INDEX `IDX_SINGLENOTEWIDGETDATA_NOTEID` ON `SingleNoteWidgetData` (`noteId`)");
+ db.execSQL("CREATE UNIQUE INDEX `IDX_UNIQUE_ACCOUNT_TITLE` ON `Category` (`accountId`, `title`)");
+
db.execSQL("CREATE TRIGGER TRG_CLEANUP_CATEGORIES_DEL AFTER DELETE ON Note BEGIN DELETE FROM Category WHERE Category.id NOT IN (SELECT Note.categoryId FROM Note); END;");
db.execSQL("CREATE TRIGGER TRG_CLEANUP_CATEGORIES_UPD AFTER UPDATE ON Note BEGIN DELETE FROM Category WHERE Category.id NOT IN (SELECT Note.categoryId FROM Note); END;");