From 65e52ed5cdfc7aecd8c45602cddc4564e36bb92a Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 15 Jun 2019 13:50:26 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/data/AppDatabase.kt | 16 +++++++++------- 1 file changed, 9 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 6b1c46817..eb3855e49 100644 --- a/app/src/main/java/io/legado/app/data/AppDatabase.kt +++ b/app/src/main/java/io/legado/app/data/AppDatabase.kt @@ -6,15 +6,12 @@ import androidx.room.Room import androidx.room.RoomDatabase import androidx.room.migration.Migration import androidx.sqlite.db.SupportSQLiteDatabase -import io.legado.app.data.dao.BookDao -import io.legado.app.data.dao.BookGroupDao -import io.legado.app.data.dao.BookSourceDao -import io.legado.app.data.dao.ReplaceRuleDao +import io.legado.app.data.dao.* import io.legado.app.data.entities.* @Database( - entities = [Book::class, BookGroup::class, BookSource::class, Chapter::class, ReplaceRule::class], + entities = [Book::class, BookGroup::class, BookSource::class, Chapter::class, ReplaceRule::class, SearchBook::class, SearchKeyword::class], version = 1, exportSchema = true ) @@ -35,7 +32,11 @@ abstract class AppDatabase : RoomDatabase() { } fun createDatabase(context: Context): AppDatabase { - return Room.databaseBuilder(context.applicationContext, AppDatabase::class.java, DATABASE_NAME) + return Room.databaseBuilder( + context.applicationContext, + AppDatabase::class.java, + DATABASE_NAME + ) // .addMigrations(MIGRATION_1_2) // .addMigrations(MIGRATION_2_3) // .addMigrations(MIGRATION_3_4) @@ -50,5 +51,6 @@ abstract class AppDatabase : RoomDatabase() { abstract fun bookGroupDao(): BookGroupDao abstract fun bookSourceDao(): BookSourceDao abstract fun replaceRuleDao(): ReplaceRuleDao - + abstract fun searchBookDao(): SearchBookDao + abstract fun searchKeywordDao(): SearchKeywordDao } \ No newline at end of file