Changes migration to be realm list field
This commit is contained in:
parent
e003bc973a
commit
98d195c010
@ -24,7 +24,7 @@ internal class MigrateSessionTo032(realm: DynamicRealm) : RealmMigrator(realm, 3
|
|||||||
|
|
||||||
override fun doMigrate(realm: DynamicRealm) {
|
override fun doMigrate(realm: DynamicRealm) {
|
||||||
realm.schema.get("RoomSummaryEntity")
|
realm.schema.get("RoomSummaryEntity")
|
||||||
?.addField(RoomSummaryEntityFields.DIRECT_PARENT_NAMES.`$`, String::class.java)
|
?.addRealmListField(RoomSummaryEntityFields.DIRECT_PARENT_NAMES.`$`, String::class.java)
|
||||||
?.transform { it.setString(RoomSummaryEntityFields.DIRECT_PARENT_NAMES.`$`, "") }
|
?.transform { it.setString(RoomSummaryEntityFields.DIRECT_PARENT_NAMES.`$`, "") }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,8 @@ internal open class RoomSummaryEntity(
|
|||||||
@PrimaryKey var roomId: String = "",
|
@PrimaryKey var roomId: String = "",
|
||||||
var roomType: String? = null,
|
var roomType: String? = null,
|
||||||
var parents: RealmList<SpaceParentSummaryEntity> = RealmList(),
|
var parents: RealmList<SpaceParentSummaryEntity> = RealmList(),
|
||||||
var children: RealmList<SpaceChildSummaryEntity> = RealmList()
|
var children: RealmList<SpaceChildSummaryEntity> = RealmList(),
|
||||||
|
var directParentNames: RealmList<String> = RealmList(),
|
||||||
) : RealmObject() {
|
) : RealmObject() {
|
||||||
|
|
||||||
private var displayName: String? = ""
|
private var displayName: String? = ""
|
||||||
@ -235,8 +236,6 @@ internal open class RoomSummaryEntity(
|
|||||||
if (value != field) field = value
|
if (value != field) field = value
|
||||||
}
|
}
|
||||||
|
|
||||||
var directParentNames: RealmList<String> = RealmList()
|
|
||||||
|
|
||||||
var flattenParentIds: String? = null
|
var flattenParentIds: String? = null
|
||||||
set(value) {
|
set(value) {
|
||||||
if (value != field) field = value
|
if (value != field) field = value
|
||||||
|
Loading…
Reference in New Issue
Block a user