Skip to content

Commit

Permalink
Remove mynote with verse 0
Browse files Browse the repository at this point in the history
  • Loading branch information
timbze committed Jun 7, 2020
1 parent 7a04470 commit 59b7d39
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion app/src/main/java/net/bible/service/db/DatabaseContainer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,15 @@ private val MIGRATION_30_31 = object : Migration(30, 31) {
}
}
}
private val MIGRATION_31_32 = object : Migration(31, 32) {
override fun migrate(db: SupportSQLiteDatabase) {
db.apply {
execSQL("DELETE FROM bookmark WHERE `key` LIKE '%.0-%'") // for key like Gen.1.0-Gen.1.1
execSQL("DELETE FROM mynote WHERE `key` LIKE '%.0'")
execSQL("DELETE FROM mynote WHERE `key` LIKE '%.0.%'")
}
}
}
object DatabaseContainer {
private var instance: AppDatabase? = null

Expand Down Expand Up @@ -555,7 +564,8 @@ object DatabaseContainer {
MIGRATION_27_28,
MIGRATION_28_29,
MIGRATION_29_30,
MIGRATION_30_31
MIGRATION_30_31,
MIGRATION_31_32
// When adding new migrations, remember to increment DATABASE_VERSION too
)
.build()
Expand Down
2 changes: 1 addition & 1 deletion db/src/main/java/net/bible/android/database/AppDatabase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import net.bible.android.database.readingplan.ReadingPlanEntities

import java.util.*

const val DATABASE_VERSION = 31
const val DATABASE_VERSION = 32

class Converters {
@TypeConverter
Expand Down

0 comments on commit 59b7d39

Please sign in to comment.