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:
Diffstat (limited to 'app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_6_7.java')
-rw-r--r--app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_6_7.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_6_7.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_6_7.java
new file mode 100644
index 00000000..399d6f40
--- /dev/null
+++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_6_7.java
@@ -0,0 +1,19 @@
+package it.niedermann.owncloud.notes.persistence.migration;
+
+import android.database.sqlite.SQLiteDatabase;
+
+import androidx.annotation.NonNull;
+
+import it.niedermann.owncloud.notes.util.DatabaseIndexUtil;
+
+public class Migration_6_7 {
+ /**
+ * Adds columns for category support and ETags
+ */
+ public Migration_6_7(@NonNull SQLiteDatabase db) {
+ DatabaseIndexUtil.dropIndexes(db);
+ db.execSQL("ALTER TABLE NOTES ADD COLUMN CATEGORY TEXT NOT NULL DEFAULT ''");
+ db.execSQL("ALTER TABLE NOTES ADD COLUMN ETAG TEXT");
+ DatabaseIndexUtil.createIndex(db, "NOTES", "REMOTEID", "STATUS", "FAVORITE", "CATEGORY", "MODIFIED");
+ }
+}