package cz.muni.sutralog.database

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.PrimaryKey
import java.time.LocalDate


@Entity(foreignKeys = [ForeignKey(entity = CategoryEntity::class, parentColumns = ["id"], childColumns = ["categoryId"], onDelete = ForeignKey.CASCADE)])
class RockEntity(
    @PrimaryKey(autoGenerate = true)
    val id: Long = 0,
    var pictureName: String? = null,
    @ColumnInfo(name = "categoryId")
    var categoryId: Long,

    var name: String,
    var count: Int? = null,
    var locality: String = "",
    var latitude: Double? = null,
    var longitude: Double? = null,
    var from: String = "",
    var date: LocalDate? = null,
    var where: String = "",
    var description: String = "",
    var comment: String = "",
    var color: Int
)