Show blocking reason if available

This commit is contained in:
moezbhatti
2019-10-10 19:15:38 -04:00
parent 56d13dfe3e
commit d46193abba
16 changed files with 182 additions and 80 deletions
@@ -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")
}
}
}
}