mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Making eventId as primary key
This commit is contained in:
parent
a2aafb9b6b
commit
61b1e84e61
2 changed files with 3 additions and 2 deletions
|
@ -17,6 +17,7 @@
|
|||
package org.matrix.android.sdk.internal.database.model.livelocation
|
||||
|
||||
import io.realm.RealmObject
|
||||
import io.realm.annotations.PrimaryKey
|
||||
|
||||
/**
|
||||
* Aggregation info concerning a live location share.
|
||||
|
@ -25,6 +26,7 @@ internal open class LiveLocationAggregatedSummaryEntity(
|
|||
/**
|
||||
* Event id of the event that started the live.
|
||||
*/
|
||||
@PrimaryKey
|
||||
var eventId: String = "",
|
||||
|
||||
var roomId: String = "",
|
||||
|
|
|
@ -38,8 +38,7 @@ internal fun LiveLocationAggregatedSummaryEntity.Companion.create(
|
|||
roomId: String,
|
||||
eventId: String,
|
||||
): LiveLocationAggregatedSummaryEntity {
|
||||
val obj = realm.createObject(LiveLocationAggregatedSummaryEntity::class.java).apply {
|
||||
this.eventId = eventId
|
||||
val obj = realm.createObject(LiveLocationAggregatedSummaryEntity::class.java, eventId).apply {
|
||||
this.roomId = roomId
|
||||
}
|
||||
val annotationSummary = EventAnnotationsSummaryEntity.getOrCreate(realm, roomId = roomId, eventId = eventId)
|
||||
|
|
Loading…
Reference in a new issue