feat(db): add teacher schedule tables and Room v4 migration

This commit is contained in:
2026-09-19 14:47:35 +03:00
parent a5ea516713
commit 1a4bff73d0
11 changed files with 1198 additions and 2 deletions
@@ -0,0 +1,41 @@
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 = "teacher_lessons",
foreignKeys = [
ForeignKey(
entity = TeacherDayEntity::class,
parentColumns = ["id"],
childColumns = ["dayId"],
onDelete = ForeignKey.CASCADE
)
],
indices = [
Index("dayId"),
Index("teacher"),
Index("room"),
Index("subject")
]
)
data class TeacherLessonEntity(
@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
)