forked from agzam/vyatsu-schedule
42 lines
951 B
Kotlin
42 lines
951 B
Kotlin
package agzam.vyatsu.data.local
|
|
|
|
import agzam.vyatsu.domain.model.LessonType
|
|
import androidx.room.Entity
|
|
import androidx.room.ForeignKey
|
|
import androidx.room.Index
|
|
import androidx.room.PrimaryKey
|
|
|
|
@Entity(
|
|
tableName = "lessons",
|
|
foreignKeys = [
|
|
ForeignKey(
|
|
entity = DayEntity::class,
|
|
parentColumns = ["id"],
|
|
childColumns = ["dayId"],
|
|
onDelete = ForeignKey.CASCADE
|
|
)
|
|
],
|
|
indices = [
|
|
Index("dayId"),
|
|
Index("date"),
|
|
Index("subject"),
|
|
Index("room")
|
|
]
|
|
)
|
|
data class LessonEntity(
|
|
@PrimaryKey(autoGenerate = true) val id: Long = 0,
|
|
val dayId: Long,
|
|
val date: Long,
|
|
val slotIndex: Int,
|
|
val start: Int,
|
|
val end: Int,
|
|
val lessonIndex: Int,
|
|
val raw: String,
|
|
val room: String?,
|
|
val groupName: String?,
|
|
val subgroup: String?,
|
|
val subject: String?,
|
|
val type: LessonType,
|
|
val teacher: String?
|
|
)
|