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-06-13 14:15:16 +0300
committerStefan Niedermann <info@niedermann.it>2020-06-13 14:15:16 +0300
commite63eb19ce41f367895db4f5da4c811303d0153b4 (patch)
treefcb1f95aa91bdac10262a2a22d08f8fa14ba1339 /app/src/main/java/it/niedermann/owncloud/notes/persistence
parentbe0260950bdfc3e95267ddacf154aa6923e3e7a2 (diff)
Adjust icon style to master
Diffstat (limited to 'app/src/main/java/it/niedermann/owncloud/notes/persistence')
-rw-r--r--app/src/main/java/it/niedermann/owncloud/notes/persistence/AbstractNotesDatabase.java8
-rw-r--r--app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_17_18.java14
2 files changed, 17 insertions, 5 deletions
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/AbstractNotesDatabase.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/AbstractNotesDatabase.java
index 66635dd6..c97f4368 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/persistence/AbstractNotesDatabase.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/AbstractNotesDatabase.java
@@ -14,6 +14,7 @@ import it.niedermann.owncloud.notes.persistence.migration.Migration_13_14;
import it.niedermann.owncloud.notes.persistence.migration.Migration_14_15;
import it.niedermann.owncloud.notes.persistence.migration.Migration_15_16;
import it.niedermann.owncloud.notes.persistence.migration.Migration_16_17;
+import it.niedermann.owncloud.notes.persistence.migration.Migration_17_18;
import it.niedermann.owncloud.notes.persistence.migration.Migration_4_5;
import it.niedermann.owncloud.notes.persistence.migration.Migration_5_6;
import it.niedermann.owncloud.notes.persistence.migration.Migration_6_7;
@@ -60,7 +61,6 @@ abstract class AbstractNotesDatabase extends SQLiteOpenHelper {
protected static final String key_theme_mode = "THEME_MODE";
protected static final String key_mode = "MODE";
protected static final String key_scroll_y = "SCROLL_Y";
-
protected static final String key_category_sorting_method = "CATEGORY_SORTING_METHOD";
protected AbstractNotesDatabase(@NonNull Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory) {
@@ -189,10 +189,8 @@ abstract class AbstractNotesDatabase extends SQLiteOpenHelper {
new Migration_15_16(db, context, this::notifyWidgets);
case 16:
new Migration_16_17(db);
- case 17: {
- // add a new column to store the sorting method for a category note list
- db.execSQL("ALTER TABLE " + table_category + " ADD COLUMN " + key_category_sorting_method + " INTEGER DEFAULT 0");
- }
+ case 17:
+ new Migration_17_18(db);
}
}
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_17_18.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_17_18.java
new file mode 100644
index 00000000..6faa9016
--- /dev/null
+++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_17_18.java
@@ -0,0 +1,14 @@
+package it.niedermann.owncloud.notes.persistence.migration;
+
+import android.database.sqlite.SQLiteDatabase;
+
+import androidx.annotation.NonNull;
+
+public class Migration_17_18 {
+ /**
+ * Add a new column to store the sorting method for a category note list
+ */
+ public Migration_17_18(@NonNull SQLiteDatabase db) {
+ db.execSQL("ALTER TABLE CATEGORIES ADD COLUMN CATEGORY_SORTING_METHOD INTEGER DEFAULT 0");
+ }
+}