forked from upstream-mirrors/quik
Show blocking reason if available
This commit is contained in:
@@ -25,7 +25,7 @@ import io.realm.RealmMigration
|
||||
class QkRealmMigration : RealmMigration {
|
||||
|
||||
companion object {
|
||||
const val SCHEMA_VERSION: Long = 6
|
||||
const val SCHEMA_VERSION: Long = 7
|
||||
}
|
||||
|
||||
override fun migrate(realm: DynamicRealm, oldVersion: Long, newVersion: Long) {
|
||||
@@ -80,9 +80,17 @@ class QkRealmMigration : RealmMigration {
|
||||
version++
|
||||
}
|
||||
|
||||
if (version == 6L) {
|
||||
realm.schema.get("Conversation")
|
||||
?.addField("blockingClient", Integer::class.java)
|
||||
?.addField("blockReason", String::class.java)
|
||||
|
||||
version++
|
||||
}
|
||||
|
||||
if (version < newVersion) {
|
||||
throw IllegalStateException("Migration missing from v$oldVersion to v$newVersion")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user