mirror of
https://github.com/bleackstorm/satiea.git
synced 2026-12-03 07:41:56 +01:00
- Add `photoUris` field to `MealEntry` and update Firestore rules. - Implement `UiEvent` handling in `MainActivity` for navigation/links. - Remove sensitive email data from error logs and clean up manifest.
32 lines
869 B
Kotlin
32 lines
869 B
Kotlin
package com.example.data.local
|
|
|
|
import android.content.Context
|
|
import androidx.room.Database
|
|
import androidx.room.Room
|
|
import androidx.room.RoomDatabase
|
|
|
|
@Database(
|
|
entities = [LocalMealEntity::class, LocalCustomFoodEntity::class],
|
|
version = 2,
|
|
exportSchema = false
|
|
)
|
|
abstract class AppDatabase : RoomDatabase() {
|
|
|
|
abstract fun mealDao(): LocalMealDao
|
|
|
|
companion object {
|
|
@Volatile
|
|
private var INSTANCE: AppDatabase? = null
|
|
|
|
fun getInstance(context: Context): AppDatabase {
|
|
return INSTANCE ?: synchronized(this) {
|
|
INSTANCE ?: Room.databaseBuilder(
|
|
context.applicationContext,
|
|
AppDatabase::class.java,
|
|
"satiea_local.db"
|
|
).fallbackToDestructiveMigration(true).build().also { INSTANCE = it }
|
|
}
|
|
}
|
|
}
|
|
}
|