main.com.sceyt.chatuikit.persistence.entity.messages.ReactionEntity.kt Maven / Gradle / Ivy
package com.sceyt.chatuikit.persistence.entity.messages
import androidx.room.*
@Entity(foreignKeys = [
ForeignKey(
entity = MessageEntity::class,
parentColumns = ["message_id"],
childColumns = ["messageId"],
onDelete = ForeignKey.CASCADE,
deferred = true
)
], indices = [Index("messageId", "reaction_key", "fromId", unique = true)])
data class ReactionEntity(
@PrimaryKey
val id: Long,
@ColumnInfo(index = true)
val messageId: Long,
@ColumnInfo(name = "reaction_key", index = true)
val key: String,
val score: Int,
val reason: String,
val createdAt: Long,
@ColumnInfo(index = true)
val fromId: String?
)