package com.joyful.euphoria.board.database

import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.joyful.euphoria.board.EuphoriaBoard
import com.joyful.euphoria.board.beaned.BeanDetails
import androidx.room.TypeConverters


@Database(
    entities = [BeanDetails::class],
    version = EuphoriaBoard.Companion.DB_VERSION,
    exportSchema = false
)
@TypeConverters(TypeTransform::class)
abstract class BoardDataBase : RoomDatabase() {

    abstract fun ThemesDao(): DetailsDao



    companion object {
        val boardDataBase: BoardDataBase by lazy {
            Room.databaseBuilder(
                EuphoriaBoard.Companion.euphoriaBoardInstance,
                BoardDataBase::class.java,
                EuphoriaBoard.Companion.DB_NAME
            ).fallbackToDestructiveMigration().build()
        }
    }

}