diff options
author | desperateCoder <echotodevnull@gmail.com> | 2020-12-15 13:23:05 +0300 |
---|---|---|
committer | desperateCoder <echotodevnull@gmail.com> | 2020-12-15 13:23:05 +0300 |
commit | 404c07f9086a19af47edc1037649790869347360 (patch) | |
tree | c491d74c1ff3aa59b6821ed3d6318e9d3a2ee6d0 /app/src/main | |
parent | 0e119e6e7e62855339b8416a85c9898400b116b0 (diff) |
reset etags to fix comment-loading bug
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabase.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabase.java b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabase.java index ce200bcc1..e65bfe9c1 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabase.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/persistence/sync/adapters/db/DeckDatabase.java @@ -98,7 +98,7 @@ import it.niedermann.nextcloud.deck.persistence.sync.adapters.db.dao.widgets.Sta UserInBoard.class, }, exportSchema = false, - version = 24 + version = 25 ) @TypeConverters({DateTypeConverter.class}) public abstract class DeckDatabase extends RoomDatabase { @@ -394,6 +394,16 @@ public abstract class DeckDatabase extends RoomDatabase { database.execSQL("ALTER TABLE `OcsProjectResource` ADD `etag` TEXT"); } }; + private static final Migration MIGRATION_24_25 = new Migration(24, 25) { + @Override + public void migrate(SupportSQLiteDatabase database) { + // Reset etags (comments weren't loading due to bug) + database.execSQL("UPDATE `Account` SET `boardsEtag` = NULL"); + database.execSQL("UPDATE `Board` SET `etag` = NULL"); + database.execSQL("UPDATE `Stack` SET `etag` = NULL"); + database.execSQL("UPDATE `Card` SET `etag` = NULL"); + } + }; public static final RoomDatabase.Callback ON_CREATE_CALLBACK = new RoomDatabase.Callback() { @Override @@ -471,6 +481,7 @@ public abstract class DeckDatabase extends RoomDatabase { } } }) + .addMigrations(MIGRATION_24_25) .fallbackToDestructiveMigration() .addCallback(ON_CREATE_CALLBACK) .build(); |