|
|
@@ -169,12 +169,47 @@ abstract class AppDatabase : RoomDatabase() {
|
|
|
""".trimIndent()
|
|
|
db.execSQL(insertBookGroupLocalSql)
|
|
|
@Language("sql")
|
|
|
+ val insertBookGroupTextSql = """
|
|
|
+ insert into book_groups(groupId, groupName, 'order', show)
|
|
|
+ select ${BookGroup.IdText}, '小说', -26, 1
|
|
|
+ where not exists (select * from book_groups where groupId = ${BookGroup.IdText})
|
|
|
+ """.trimIndent()
|
|
|
+ db.execSQL(insertBookGroupTextSql)
|
|
|
+ @Language("sql")
|
|
|
+ val insertBookGroupMangaSql = """
|
|
|
+ insert into book_groups(groupId, groupName, 'order', show)
|
|
|
+ select ${BookGroup.IdManga}, '漫画', -25, 1
|
|
|
+ where not exists (select * from book_groups where groupId = ${BookGroup.IdManga})
|
|
|
+ """.trimIndent()
|
|
|
+ db.execSQL(insertBookGroupMangaSql)
|
|
|
+ @Language("sql")
|
|
|
val insertBookGroupMusicSql = """
|
|
|
insert into book_groups(groupId, groupName, 'order', show)
|
|
|
select ${BookGroup.IdAudio}, '音频', -8, 1
|
|
|
where not exists (select * from book_groups where groupId = ${BookGroup.IdAudio})
|
|
|
""".trimIndent()
|
|
|
db.execSQL(insertBookGroupMusicSql)
|
|
|
+ Language("sql")
|
|
|
+ val insertGroupReading = """
|
|
|
+ insert into book_groups(groupId, groupName, 'order', show)
|
|
|
+ select ${BookGroup.IdReading}, '在读', -30, 1
|
|
|
+ where not exists (select * from book_groups where groupId = ${BookGroup.IdReading})
|
|
|
+ """.trimIndent()
|
|
|
+ db.execSQL(insertGroupReading)
|
|
|
+ @Language("sql")
|
|
|
+ val insertGroupUnread = """
|
|
|
+ insert into book_groups(groupId, groupName, 'order', show)
|
|
|
+ select ${BookGroup.IdUnread}, '未读', -29, 1
|
|
|
+ where not exists (select * from book_groups where groupId = ${BookGroup.IdUnread})
|
|
|
+ """.trimIndent()
|
|
|
+ db.execSQL(insertGroupUnread)
|
|
|
+ @Language("sql")
|
|
|
+ val insertGroupReadFinished = """
|
|
|
+ insert into book_groups(groupId, groupName, 'order', show)
|
|
|
+ select ${BookGroup.IdReadFinished}, '已读', -28, 1
|
|
|
+ where not exists (select * from book_groups where groupId = ${BookGroup.IdReadFinished})
|
|
|
+ """.trimIndent()
|
|
|
+ db.execSQL(insertGroupReadFinished)
|
|
|
@Language("sql")
|
|
|
val insertBookGroupNetNoneGroupSql = """
|
|
|
insert into book_groups(groupId, groupName, 'order', show)
|