Skip to content

Commit

Permalink
fix db migration
Browse files Browse the repository at this point in the history
  • Loading branch information
ultranity committed Dec 6, 2024
1 parent ff2fa14 commit 3bf43fd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/src/main/java/com/perol/asdpl/pixivez/data/AppDatabase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ abstract class AppDatabase : RoomDatabase() {
}

private val migration7to8 = Migration(7, 8) {
it.execSQL("ALTER TABLE `user` ADD COLUMN IF NOT EXISTS `x_restrict` INTEGER NOT NULL DEFAULT 0")
it.execSQL("CREATE TABLE IF NOT EXISTS `blockUser` (`uid` INTEGER NOT NULL, `createdAt` INTEGER NOT NULL, PRIMARY KEY(`uid`))")
it.execSQL("ALTER TABLE `blockUser` ADD COLUMN IF NOT EXISTS `createdAt` INTEGER NOT NULL DEFAULT 0")
it.execSQL("ALTER TABLE `user` ADD COLUMN `x_restrict` INTEGER NOT NULL DEFAULT 0")
it.execSQL("CREATE TABLE IF NOT EXISTS `blockUser` (`uid` INTEGER NOT NULL, `createdAt` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`uid`))")
it.execSQL("CREATE UNIQUE INDEX IF NOT EXISTS `index_blockTag_name` ON `blockTag` (`name`)")
}
private fun buildDatabase(context: Context) =
Expand Down

0 comments on commit 3bf43fd

Please sign in to comment.