// Copyright (c) 2025 Gleb Zaharov. License: GPLv3 (see LICENSE).

package ru.sweetbread.unn.db

import androidx.room.Database
import androidx.room.RoomDatabase
import splitties.arch.room.roomDb

val cacheDb = roomDb<AppDatabase>(name = "cache") {
    fallbackToDestructiveMigration(dropAllTables = true)
}

@Database(entities = [
    UserDB::class,
    BuildingDB::class,
    AuditoriumDB::class,
    DisciplineDB::class,
    KindOfWorkDB::class,
    LecturerDB::class,
    ScheduleUnitDB::class], version = 1)
abstract class AppDatabase : RoomDatabase() {
    abstract fun userDao(): UserDao
    abstract fun scheduleDao(): ScheduleItemDao
    abstract fun auditoriumDao(): AuditoriumDao
    abstract fun buildingDao(): BuildingDao
    abstract fun disciplineDao(): DisciplineDao
    abstract fun kindOfWorkDao(): KindOfWorkDao
    abstract fun lecturerDao(): LecturerDao
}
