forked from upstream-mirrors/quik
Indicate in UI when scheduled messages are present
Added a new property to scheduled messages to save which conversation the scheduled message belongs to.
This commit is contained in:
@@ -36,7 +36,7 @@ class QkRealmMigration @Inject constructor(
|
||||
) : RealmMigration {
|
||||
|
||||
companion object {
|
||||
const val SchemaVersion: Long = 11
|
||||
const val SchemaVersion: Long = 12
|
||||
}
|
||||
|
||||
@SuppressLint("ApplySharedPref")
|
||||
@@ -233,6 +233,14 @@ class QkRealmMigration @Inject constructor(
|
||||
|
||||
version++
|
||||
}
|
||||
if (version == 11L) {
|
||||
realm.schema.get("ScheduledMessage")
|
||||
?.addField("conversationId", Long::class.java, FieldAttribute.REQUIRED)
|
||||
// Because there was never any property associated with which conversation/recipients a scheduled message was for,
|
||||
// we can't update this field on a realm migration. It will be set to a default of 0
|
||||
|
||||
version++
|
||||
}
|
||||
|
||||
check(version >= newVersion) { "Migration missing from v$oldVersion to v$newVersion" }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user