set up foreign keys at event repetitions and repetition exceptions
This commit is contained in:
parent
c76d1db104
commit
b00d7366d9
|
@ -1,11 +1,9 @@
|
|||
package com.simplemobiletools.calendar.pro.models
|
||||
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Index
|
||||
import androidx.room.PrimaryKey
|
||||
import androidx.room.*
|
||||
|
||||
@Entity(tableName = "event_repetitions", indices = [(Index(value = ["id"], unique = true))])
|
||||
@Entity(tableName = "event_repetitions", indices = [(Index(value = ["id"], unique = true))],
|
||||
foreignKeys = [ForeignKey(entity = Event::class, onDelete = ForeignKey.CASCADE, parentColumns = ["id"], childColumns = ["event_id"])])
|
||||
data class EventRepetition(
|
||||
@PrimaryKey(autoGenerate = true) var id: Long?,
|
||||
@ColumnInfo(name = "event_id") val eventId: Long,
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
package com.simplemobiletools.calendar.pro.models
|
||||
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Index
|
||||
import androidx.room.PrimaryKey
|
||||
import androidx.room.*
|
||||
|
||||
@Entity(tableName = "event_repetition_exceptions", indices = [(Index(value = ["id"], unique = true))])
|
||||
@Entity(tableName = "event_repetition_exceptions", indices = [(Index(value = ["id"], unique = true))],
|
||||
foreignKeys = [ForeignKey(entity = Event::class, onDelete = ForeignKey.CASCADE, parentColumns = ["id"], childColumns = ["event_id"])])
|
||||
data class EventRepetitionException(
|
||||
@PrimaryKey(autoGenerate = true) var id: Long?,
|
||||
@ColumnInfo(name = "occurrence_daycode") val daycode: String,
|
||||
|
|
Loading…
Reference in New Issue