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>2021-05-11 17:17:54 +0300
committerNiedermann IT-Dienstleistungen <stefan-niedermann@users.noreply.github.com>2021-05-12 11:58:43 +0300
commit30e839de9dfb0ed05340d23aa8e9032095a717dc (patch)
treec9dc4abf2608213c8c460bdbda4ff163ab55a868 /app/src/main/java/it/niedermann/owncloud/notes/persistence/migration
parent02cb22dc1d0380043b10c84a2873af3e4c514098 (diff)
#1079 Database 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_22_23.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_22_23.java b/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_22_23.java
new file mode 100644
index 00000000..ceced7cf
--- /dev/null
+++ b/app/src/main/java/it/niedermann/owncloud/notes/persistence/migration/Migration_22_23.java
@@ -0,0 +1,28 @@
+package it.niedermann.owncloud.notes.persistence.migration;
+
+import android.content.SharedPreferences;
+
+import androidx.annotation.NonNull;
+import androidx.preference.PreferenceManager;
+import androidx.room.migration.Migration;
+import androidx.sqlite.db.SupportSQLiteDatabase;
+
+import it.niedermann.owncloud.notes.persistence.SyncWorker;
+import it.niedermann.owncloud.notes.persistence.entity.Account;
+
+/**
+ * Add <code>displayName</code> property to {@link Account}.
+ * <p>
+ * See: <a href="https://github.com/stefan-niedermann/nextcloud-notes/issues/1079">#1079 Show DisplayName instead of uid attribute for LDAP users</a>
+ */
+public class Migration_22_23 extends Migration {
+
+ public Migration_22_23() {
+ super(22, 23);
+ }
+
+ @Override
+ public void migrate(@NonNull SupportSQLiteDatabase db) {
+ db.execSQL("ALTER TABLE Account ADD COLUMN displayName TEXT");
+ }
+}