|
|
|
@ -25,8 +25,8 @@ abstract class AppDatabase : RoomDatabase() { |
|
|
|
|
|
|
|
|
|
private const val DATABASE_NAME = "legado.db" |
|
|
|
|
|
|
|
|
|
fun createDatabase(context: Context): AppDatabase { |
|
|
|
|
return Room.databaseBuilder(context, AppDatabase::class.java, DATABASE_NAME) |
|
|
|
|
fun createDatabase(context: Context) = |
|
|
|
|
Room.databaseBuilder(context, AppDatabase::class.java, DATABASE_NAME) |
|
|
|
|
.fallbackToDestructiveMigration() |
|
|
|
|
.addMigrations( |
|
|
|
|
migration_10_11, |
|
|
|
@ -41,7 +41,6 @@ abstract class AppDatabase : RoomDatabase() { |
|
|
|
|
) |
|
|
|
|
.allowMainThreadQueries() |
|
|
|
|
.build() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private val migration_10_11 = object: Migration(10, 11) { |
|
|
|
|
override fun migrate(database: SupportSQLiteDatabase) { |
|
|
|
|