From a0d6c9942d48b06ae67c3eb4623cd2659be77e99 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 13 Feb 2022 22:53:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/data/AppDatabase.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/AppDatabase.kt b/app/src/main/java/io/legado/app/data/AppDatabase.kt index 2da9d066a..0311a821d 100644 --- a/app/src/main/java/io/legado/app/data/AppDatabase.kt +++ b/app/src/main/java/io/legado/app/data/AppDatabase.kt @@ -50,13 +50,13 @@ abstract class AppDatabase : RoomDatabase() { private const val DATABASE_NAME = "legado.db" - fun createDatabase(context: Context) = - Room.databaseBuilder(context, AppDatabase::class.java, DATABASE_NAME) - .fallbackToDestructiveMigrationFrom(1, 2, 3, 4, 5, 6, 7, 8, 9) - .addMigrations(*DatabaseMigrations.migrations) - .allowMainThreadQueries() - .addCallback(dbCallback) - .build() + fun createDatabase(context: Context) = Room + .databaseBuilder(context, AppDatabase::class.java, DATABASE_NAME) + .fallbackToDestructiveMigrationFrom(1, 2, 3, 4, 5, 6, 7, 8, 9) + .addMigrations(*DatabaseMigrations.migrations) + .allowMainThreadQueries() + .addCallback(dbCallback) + .build() private val dbCallback = object : Callback() {