|
|
@ -10,6 +10,7 @@ import io.legado.app.App |
|
|
|
import io.legado.app.constant.AppConst |
|
|
|
import io.legado.app.constant.AppConst |
|
|
|
import io.legado.app.data.dao.* |
|
|
|
import io.legado.app.data.dao.* |
|
|
|
import io.legado.app.data.entities.* |
|
|
|
import io.legado.app.data.entities.* |
|
|
|
|
|
|
|
import java.util.* |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Database( |
|
|
|
@Database( |
|
|
@ -46,7 +47,14 @@ abstract class AppDatabase: RoomDatabase() { |
|
|
|
.build() |
|
|
|
.build() |
|
|
|
|
|
|
|
|
|
|
|
private val dbCallback = object : Callback() { |
|
|
|
private val dbCallback = object : Callback() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onCreate(db: SupportSQLiteDatabase) { |
|
|
|
|
|
|
|
super.onCreate(db) |
|
|
|
|
|
|
|
db.setLocale(Locale.CHINESE) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onOpen(db: SupportSQLiteDatabase) { |
|
|
|
override fun onOpen(db: SupportSQLiteDatabase) { |
|
|
|
|
|
|
|
db.setLocale(Locale.CHINESE) |
|
|
|
db.execSQL( |
|
|
|
db.execSQL( |
|
|
|
""" |
|
|
|
""" |
|
|
|
insert into book_groups(groupId, groupName, 'order', show) select ${AppConst.bookGroupAllId}, '全部', -10, 1 |
|
|
|
insert into book_groups(groupId, groupName, 'order', show) select ${AppConst.bookGroupAllId}, '全部', -10, 1 |
|
|
|