28 lines
607 B
Kotlin
28 lines
607 B
Kotlin
package agzam.vyatsu.data.local
|
|
|
|
import androidx.room.Entity
|
|
import androidx.room.ForeignKey
|
|
import androidx.room.Index
|
|
import androidx.room.PrimaryKey
|
|
|
|
@Entity(
|
|
tableName = "days",
|
|
foreignKeys = [
|
|
ForeignKey(
|
|
entity = ScheduleEntity::class,
|
|
parentColumns = ["id"],
|
|
childColumns = ["scheduleId"],
|
|
onDelete = ForeignKey.CASCADE
|
|
)
|
|
],
|
|
indices = [
|
|
Index("scheduleId"),
|
|
Index("date")
|
|
]
|
|
)
|
|
data class DayEntity(
|
|
@PrimaryKey(autoGenerate = true) val id: Long = 0,
|
|
val scheduleId: Long,
|
|
val date: Long
|
|
)
|