mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-19 12:28:53 +01:00
Fix default values for draftDate and EmojiSyncNeeded.createdAt fields
Co-authored-by: octoshrimpy <7097172+octoshrimpy@users.noreply.github.com>
This commit is contained in:
+6
-1
@@ -33,6 +33,9 @@ class AppRealmMigration : RealmMigration {
|
|||||||
if (version < 12L) {
|
if (version < 12L) {
|
||||||
realm.schema.get("Conversation")
|
realm.schema.get("Conversation")
|
||||||
?.addField("draftDate", Long::class.java, FieldAttribute.REQUIRED)
|
?.addField("draftDate", Long::class.java, FieldAttribute.REQUIRED)
|
||||||
|
?.transform { obj ->
|
||||||
|
obj.setLong("draftDate", 0L)
|
||||||
|
}
|
||||||
|
|
||||||
version = 12L
|
version = 12L
|
||||||
}
|
}
|
||||||
@@ -56,7 +59,9 @@ class AppRealmMigration : RealmMigration {
|
|||||||
realm.schema.create("EmojiSyncNeeded")
|
realm.schema.create("EmojiSyncNeeded")
|
||||||
.addField("createdAt", Long::class.java, FieldAttribute.REQUIRED)
|
.addField("createdAt", Long::class.java, FieldAttribute.REQUIRED)
|
||||||
|
|
||||||
realm.createObject("EmojiSyncNeeded")
|
realm.createObject("EmojiSyncNeeded").apply {
|
||||||
|
setLong("createdAt", System.currentTimeMillis())
|
||||||
|
}
|
||||||
|
|
||||||
version = 13L
|
version = 13L
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user