#965 - Add ability to pin conversations

This commit is contained in:
Moez Bhatti
2018-07-23 14:37:42 -04:00
parent fbd7c7b3a1
commit cb62bcee1d
15 changed files with 215 additions and 31 deletions
@@ -26,7 +26,7 @@ import io.realm.RealmMigration
class QkRealmMigration : RealmMigration {
companion object {
const val SCHEMA_VERSION: Long = 4
const val SCHEMA_VERSION: Long = 5
}
override fun migrate(realm: DynamicRealm, oldVersion: Long, newVersion: Long) {
@@ -66,6 +66,13 @@ class QkRealmMigration : RealmMigration {
version++
}
if (version == 4L) {
realm.schema.get("Conversation")
?.addField("pinned", Boolean::class.java, FieldAttribute.REQUIRED, FieldAttribute.INDEXED)
version++
}
if (version < newVersion) {
throw IllegalStateException("Migration missing from v$oldVersion to v$newVersion")
}