Split this PR db change in a separate migration

This commit is contained in:
Valere 2022-01-11 14:56:18 +01:00
parent 6798492cc3
commit 60ae416b36

View File

@ -56,7 +56,7 @@ internal class RealmSessionStoreMigration @Inject constructor(
) : RealmMigration { ) : RealmMigration {
companion object { companion object {
const val SESSION_STORE_SCHEMA_VERSION = 20L const val SESSION_STORE_SCHEMA_VERSION = 21L
} }
/** /**
@ -89,6 +89,7 @@ internal class RealmSessionStoreMigration @Inject constructor(
if (oldVersion <= 17) migrateTo18(realm) if (oldVersion <= 17) migrateTo18(realm)
if (oldVersion <= 18) migrateTo19(realm) if (oldVersion <= 18) migrateTo19(realm)
if (oldVersion <= 19) migrateTo20(realm) if (oldVersion <= 19) migrateTo20(realm)
if (oldVersion <= 20) migrateTo21(realm)
} }
private fun migrateTo1(realm: DynamicRealm) { private fun migrateTo1(realm: DynamicRealm) {
@ -415,6 +416,10 @@ internal class RealmSessionStoreMigration @Inject constructor(
chunkEntities.deleteAllFromRealm() chunkEntities.deleteAllFromRealm()
} }
} }
}
private fun migrateTo21(realm: DynamicRealm) {
Timber.d("Step 20 -> 21")
realm.schema.get("RoomSummaryEntity") realm.schema.get("RoomSummaryEntity")
?.addField(RoomSummaryEntityFields.E2E_ALGORITHM, String::class.java) ?.addField(RoomSummaryEntityFields.E2E_ALGORITHM, String::class.java)