Add SongAlbumMap

This commit is contained in:
vfsfitvnm
2022-06-30 13:49:05 +02:00
parent 58f821534e
commit d07d3f23b2
8 changed files with 810 additions and 49 deletions

View File

@@ -0,0 +1,31 @@
package it.vfsfitvnm.vimusic.models
import androidx.compose.runtime.Immutable
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.ForeignKey
@Immutable
@Entity(
primaryKeys = ["songId", "albumId"],
foreignKeys = [
ForeignKey(
entity = Song::class,
parentColumns = ["id"],
childColumns = ["songId"],
onDelete = ForeignKey.CASCADE
),
ForeignKey(
entity = Album::class,
parentColumns = ["id"],
childColumns = ["albumId"],
onDelete = ForeignKey.CASCADE
)
]
)
data class SongAlbumMap(
@ColumnInfo(index = true) val songId: String,
@ColumnInfo(index = true) val albumId: String,
val position: Int?
)