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