mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
Fix draft being sorted at the bottom
In some cases, if no date was set, it would get sorted to the bottom
This commit is contained in:
@@ -36,7 +36,7 @@ class QkRealmMigration @Inject constructor(
|
||||
) : RealmMigration {
|
||||
|
||||
companion object {
|
||||
const val SchemaVersion: Long = 12
|
||||
const val SchemaVersion: Long = 13
|
||||
}
|
||||
|
||||
@SuppressLint("ApplySharedPref")
|
||||
@@ -239,10 +239,6 @@ class QkRealmMigration @Inject constructor(
|
||||
// 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++
|
||||
}
|
||||
|
||||
if (version == 11L) {
|
||||
realm.schema.create("MessageContentFilter")
|
||||
.addField("id", Long::class.java, FieldAttribute.PRIMARY_KEY, FieldAttribute.REQUIRED)
|
||||
.addField("value", String::class.java, FieldAttribute.REQUIRED)
|
||||
@@ -253,6 +249,12 @@ class QkRealmMigration @Inject constructor(
|
||||
version++
|
||||
}
|
||||
|
||||
if (version == 12L) {
|
||||
realm.schema.get("Conversation")
|
||||
?.addField("draftDate", Long::class.java, FieldAttribute.REQUIRED)
|
||||
version++
|
||||
}
|
||||
|
||||
check(version >= newVersion) { "Migration missing from v$oldVersion to v$newVersion" }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user