Skip to content

Commit

Permalink
Database migration for downgrade from 24 to 23 (#1269, #1270)
Browse files Browse the repository at this point in the history
  • Loading branch information
Koitharu committed Feb 9, 2025
1 parent bb68869 commit 8a26587
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import org.koitharu.kotatsu.core.db.migrations.Migration1To2
import org.koitharu.kotatsu.core.db.migrations.Migration20To21
import org.koitharu.kotatsu.core.db.migrations.Migration21To22
import org.koitharu.kotatsu.core.db.migrations.Migration22To23
import org.koitharu.kotatsu.core.db.migrations.Migration24To23
import org.koitharu.kotatsu.core.db.migrations.Migration2To3
import org.koitharu.kotatsu.core.db.migrations.Migration3To4
import org.koitharu.kotatsu.core.db.migrations.Migration4To5
Expand Down Expand Up @@ -128,6 +129,7 @@ fun getDatabaseMigrations(context: Context): Array<Migration> = arrayOf(
Migration20To21(),
Migration21To22(),
Migration22To23(),
Migration24To23(),
)

fun MangaDatabase(context: Context): MangaDatabase = Room
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.koitharu.kotatsu.core.db.migrations

import androidx.room.migration.Migration
import androidx.sqlite.db.SupportSQLiteDatabase

class Migration24To23 : Migration(24, 23) {

override fun migrate(db: SupportSQLiteDatabase) {
db.execSQL("DROP TABLE IF EXISTS `chapters`")
}
}

1 comment on commit 8a26587

@kuflierl
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait a second, why are you dropping the chapters DB?

Please sign in to comment.