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"
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) {

Loading…
Cancel
Save