AppDatabase.kt: Modify function with assigning method

Signed-off-by: 1552980358 <1552980358@qq.com>
pull/369/head
1552980358 4 years ago
parent 763bc1585e
commit ab7babd253
  1. 5
      app/src/main/java/io/legado/app/data/AppDatabase.kt

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

Loading…
Cancel
Save