package xyz.cottongin.radio247.data.model

import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.Index
import androidx.room.PrimaryKey

@Entity(
    tableName = "metadata_snapshots",
    foreignKeys = [ForeignKey(
        entity = Station::class,
        parentColumns = ["id"],
        childColumns = ["stationId"],
        onDelete = ForeignKey.CASCADE
    )],
    indices = [Index("stationId"), Index("timestamp")]
)
data class MetadataSnapshot(
    @PrimaryKey(autoGenerate = true) val id: Long = 0,
    val stationId: Long,
    val title: String? = null,
    val artist: String? = null,
    val artworkUrl: String? = null,
    val timestamp: Long
)
