forked from upstream-mirrors/quik
Add default value for Message.sendAsGroup and restore compactOnLaunch optimization
Co-authored-by: octoshrimpy <7097172+octoshrimpy@users.noreply.github.com>
This commit is contained in:
@@ -9,6 +9,7 @@ object RealmConfig {
|
|||||||
|
|
||||||
private val config: RealmConfiguration by lazy {
|
private val config: RealmConfiguration by lazy {
|
||||||
RealmConfiguration.Builder()
|
RealmConfiguration.Builder()
|
||||||
|
.compactOnLaunch()
|
||||||
.schemaVersion(AppRealmMigration.SCHEMA_VERSION)
|
.schemaVersion(AppRealmMigration.SCHEMA_VERSION)
|
||||||
.migration(AppRealmMigration())
|
.migration(AppRealmMigration())
|
||||||
.build()
|
.build()
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ class AppRealmMigration : RealmMigration {
|
|||||||
|
|
||||||
realm.schema.get("Message")
|
realm.schema.get("Message")
|
||||||
?.addField("sendAsGroup", Boolean::class.java, FieldAttribute.REQUIRED)
|
?.addField("sendAsGroup", Boolean::class.java, FieldAttribute.REQUIRED)
|
||||||
|
?.transform { obj ->
|
||||||
|
obj.setBoolean("sendAsGroup", false)
|
||||||
|
}
|
||||||
|
|
||||||
version = 11L
|
version = 11L
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user