pull/1251/head
gedoor 3 years ago
parent ed3ea2207f
commit 2d059e66f2
  1. 2
      app/src/main/java/io/legado/app/data/AppDatabase.kt
  2. 2
      app/src/main/java/io/legado/app/data/DatabaseMigrations.kt

@ -51,7 +51,7 @@ abstract class AppDatabase : RoomDatabase() {
fun createDatabase(context: Context) =
Room.databaseBuilder(context, AppDatabase::class.java, DATABASE_NAME)
.fallbackToDestructiveMigration()
.addMigrations(*DatabaseMigration.migrations)
.addMigrations(*DatabaseMigrations.migrations)
.allowMainThreadQueries()
.addCallback(dbCallback)
.build()

@ -4,7 +4,7 @@ import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase
import io.legado.app.constant.AppConst
object DatabaseMigration {
object DatabaseMigrations {
val migrations: Array<Migration> by lazy {
arrayOf(
Loading…
Cancel
Save