Archived
Removed redundant dependencies for WorkManager and EasyPreferences, TaskDescription colour changed to colorAccent
This commit is contained in:
@@ -5,7 +5,7 @@ import androidx.room.Database
|
||||
import androidx.room.Room
|
||||
import androidx.room.RoomDatabase
|
||||
|
||||
@Database(entities = [Subst::class], version = 3, exportSchema = false)
|
||||
@Database(entities = [Subst::class, Food::class], version = 4, exportSchema = false)
|
||||
public abstract class SubstDatabase : RoomDatabase() {
|
||||
|
||||
abstract fun substDao(): SubstDao
|
||||
@@ -26,5 +26,18 @@ public abstract class SubstDatabase : RoomDatabase() {
|
||||
}
|
||||
return instance
|
||||
}
|
||||
|
||||
fun getFoodInstance(context: Context): SubstDatabase? {
|
||||
if (instance == null) {
|
||||
synchronized (SubstDatabase::class) {
|
||||
instance = Room.databaseBuilder(context.applicationContext,
|
||||
SubstDatabase::class.java,
|
||||
"food_database")
|
||||
.fallbackToDestructiveMigration()
|
||||
.build()
|
||||
}
|
||||
}
|
||||
return instance
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user