Migrate database (1)

This commit is contained in:
vfsfitvnm
2022-06-29 14:13:39 +02:00
parent ade78c8ecf
commit a7bdda074b
10 changed files with 1123 additions and 4 deletions

View File

@@ -0,0 +1,26 @@
package it.vfsfitvnm.vimusic.models
import androidx.room.Embedded
import androidx.room.Junction
import androidx.room.Relation
data class DetailedSong(
@Embedded val song: Song,
@Relation(
entity = Album::class,
parentColumn = "albumId",
entityColumn = "id"
) val album: Album?,
@Relation(
entity = Artist::class,
parentColumn = "id",
entityColumn = "id",
associateBy = Junction(
value = SongArtistMap::class,
parentColumn = "songId",
entityColumn = "artistId"
)
)
val artists: List<Artist>?
)