forked from agzam/vyatsu-schedule
28 lines
822 B
Kotlin
28 lines
822 B
Kotlin
package agzam.vyatsu.data.local
|
|
|
|
import agzam.vyatsu.domain.model.Season
|
|
import androidx.room.Entity
|
|
import androidx.room.ForeignKey
|
|
import androidx.room.Index
|
|
import androidx.room.PrimaryKey
|
|
|
|
// Все опубликованные на сайте 2-недельные периоды группы, включая ещё не начавшиеся.
|
|
@Entity(
|
|
tableName = "group_periods",
|
|
foreignKeys = [
|
|
ForeignKey(
|
|
entity = GroupEntity::class,
|
|
parentColumns = ["id"],
|
|
childColumns = ["groupId"],
|
|
onDelete = ForeignKey.CASCADE
|
|
)
|
|
],
|
|
indices = [Index("groupId")]
|
|
)
|
|
data class GroupPeriodEntity(
|
|
@PrimaryKey(autoGenerate = true) val id: Long = 0,
|
|
val groupId: String,
|
|
val season: Season,
|
|
val weekStart: Long,
|
|
val weekEnd: Long
|
|
) |