Resolve realm migration conflicts
This commit is contained in:
parent
deb86d2e87
commit
9953d0d0ed
|
@ -28,7 +28,7 @@ internal class ThreadSummaryMapper @Inject constructor() {
|
|||
roomId = threadSummary.room?.firstOrNull()?.roomId.orEmpty(),
|
||||
rootEvent = threadSummary.rootThreadEventEntity?.asDomain(),
|
||||
latestEvent = threadSummary.latestThreadEventEntity?.asDomain(),
|
||||
rootEventId = threadSummary.rootThreadEventId,
|
||||
rootEventId = threadSummary.rootThreadEventId.orEmpty(),
|
||||
rootThreadSenderInfo = SenderInfo(
|
||||
userId = threadSummary.rootThreadEventEntity?.sender ?: "",
|
||||
displayName = threadSummary.rootThreadSenderName,
|
||||
|
|
|
@ -45,10 +45,10 @@ class MigrateSessionTo026(realm: DynamicRealm) : RealmMigrator(realm, 26) {
|
|||
.addField(ThreadSummaryEntityFields.ROOT_THREAD_EVENT_ID, String::class.java, FieldAttribute.INDEXED)
|
||||
.addField(ThreadSummaryEntityFields.ROOT_THREAD_SENDER_NAME, String::class.java)
|
||||
.addField(ThreadSummaryEntityFields.ROOT_THREAD_SENDER_AVATAR, String::class.java)
|
||||
.addField(ThreadSummaryEntityFields.ROOT_THREAD_IS_UNIQUE_DISPLAY_NAME, String::class.java)
|
||||
.addField(ThreadSummaryEntityFields.ROOT_THREAD_IS_UNIQUE_DISPLAY_NAME, Boolean::class.java)
|
||||
.addField(ThreadSummaryEntityFields.LATEST_THREAD_SENDER_NAME, String::class.java)
|
||||
.addField(ThreadSummaryEntityFields.LATEST_THREAD_SENDER_AVATAR, String::class.java)
|
||||
.addField(ThreadSummaryEntityFields.LATEST_THREAD_IS_UNIQUE_DISPLAY_NAME, String::class.java)
|
||||
.addField(ThreadSummaryEntityFields.LATEST_THREAD_IS_UNIQUE_DISPLAY_NAME, Boolean::class.java)
|
||||
.addField(ThreadSummaryEntityFields.NUMBER_OF_THREADS, Int::class.java)
|
||||
.addField(ThreadSummaryEntityFields.IS_USER_PARTICIPATING, Boolean::class.java)
|
||||
.addRealmObjectField(ThreadSummaryEntityFields.ROOT_THREAD_EVENT_ENTITY.`$`, eventEntity)
|
||||
|
@ -58,6 +58,6 @@ class MigrateSessionTo026(realm: DynamicRealm) : RealmMigrator(realm, 26) {
|
|||
?.addRealmListField(RoomEntityFields.THREAD_SUMMARIES.`$`, threadSummaryEntity)
|
||||
|
||||
realm.schema.get("HomeServerCapabilitiesEntity")
|
||||
?.addRealmListField(HomeServerCapabilitiesEntityFields.CAN_USE_THREADING, Boolean::class.java)
|
||||
?.addField(HomeServerCapabilitiesEntityFields.CAN_USE_THREADING, Boolean::class.java)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import io.realm.annotations.LinkingObjects
|
|||
import org.matrix.android.sdk.internal.database.model.EventEntity
|
||||
import org.matrix.android.sdk.internal.database.model.RoomEntity
|
||||
|
||||
internal open class ThreadSummaryEntity(@Index var rootThreadEventId: String = "",
|
||||
internal open class ThreadSummaryEntity(@Index var rootThreadEventId: String? = "",
|
||||
var rootThreadEventEntity: EventEntity? = null,
|
||||
var latestThreadEventEntity: EventEntity? = null,
|
||||
var rootThreadSenderName: String? = null,
|
||||
|
|
Loading…
Reference in New Issue