This commit is contained in:
2 files changed
+78
-2
No files matched your search
@@ -4,11 +4,12 @@ import android.content.Context
|
||||
import androidx.room.Database
|
||||
import androidx.room.Room
|
||||
import androidx.room.RoomDatabase
|
||||
import com.m57.hermescontrol.BuildConfig
|
||||
|
||||
@Database(
|
||||
entities = [ChatMessageEntity::class],
|
||||
version = 1,
|
||||
exportSchema = false,
|
||||
exportSchema = true,
|
||||
)
|
||||
abstract class HermesDatabase : RoomDatabase() {
|
||||
abstract fun chatMessageDao(): ChatMessageDao
|
||||
@@ -24,7 +25,11 @@ abstract class HermesDatabase : RoomDatabase() {
|
||||
context.applicationContext,
|
||||
HermesDatabase::class.java,
|
||||
"hermes_control.db",
|
||||
).fallbackToDestructiveMigration(false)
|
||||
).apply {
|
||||
if (BuildConfig.DEBUG) {
|
||||
fallbackToDestructiveMigration(false)
|
||||
}
|
||||
}
|
||||
.build()
|
||||
.also { instance = it }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user