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 84ace7663..71e6e453f 100644 --- a/app/src/main/java/io/legado/app/data/AppDatabase.kt +++ b/app/src/main/java/io/legado/app/data/AppDatabase.kt @@ -32,7 +32,8 @@ abstract class AppDatabase : RoomDatabase() { migration_11_12, migration_12_13, migration_13_14, - migration_14_15 + migration_14_15, + migration_15_17 ) .allowMainThreadQueries() .build() @@ -87,6 +88,12 @@ abstract class AppDatabase : RoomDatabase() { database.execSQL("ALTER TABLE bookmarks ADD bookAuthor TEXT NOT NULL DEFAULT ''") } } + + private val migration_15_17 = object : Migration(15, 17) { + override fun migrate(database: SupportSQLiteDatabase) { + database.execSQL("CREATE TABLE IF NOT EXISTS `readRecord` (`bookName` TEXT NOT NULL, `readTime` INTEGER NOT NULL, PRIMARY KEY(`bookName`))") + } + } } abstract fun bookDao(): BookDao