Add foreign key constraint to Song

This commit is contained in:
vfsfitvnm
2022-06-29 15:26:01 +02:00
parent 95879e7a6e
commit 9103c30044
3 changed files with 441 additions and 9 deletions

View File

@@ -4,14 +4,14 @@ import androidx.room.*
@Entity(
// foreignKeys = [
// ForeignKey(
// entity = Album::class,
// parentColumns = ["id"],
// childColumns = ["albumId"],
// onDelete = ForeignKey.CASCADE
// ),
// ]
foreignKeys = [
ForeignKey(
entity = Album::class,
parentColumns = ["id"],
childColumns = ["albumId"],
onDelete = ForeignKey.SET_NULL
),
]
)
data class Song(
@PrimaryKey val id: String,