package com.taf.waf.db import android.content.Context import androidx.room.Database import androidx.room.Room import androidx.room.RoomDatabase @Database( entities = [PendingOhsIncident::class, PendingSafetyIncident::class], version = 1 ) abstract class WafDatabase : RoomDatabase() { abstract fun pendingOhsIncidentDao(): PendingOhsIncidentDao abstract fun pendingSafetyIncidentDao(): PendingSafetyIncidentDao companion object { @Volatile private var INSTANCE: WafDatabase? = null fun get(context: Context): WafDatabase = INSTANCE ?: synchronized(this) { INSTANCE ?: Room.databaseBuilder( context.applicationContext, WafDatabase::class.java, "waf.db" ).fallbackToDestructiveMigration().build().also { INSTANCE = it } } } }