Skip to content

Commit

Permalink
Clear database from HOPE 2022 on upgrade.
Browse files Browse the repository at this point in the history
+ Related: 535e179.
  • Loading branch information
johnjohndoe committed Jul 1, 2024
1 parent 98c2cfb commit 8a5096d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ internal class AlarmsDBOpenHelper(context: Context) : SQLiteOpenHelper(
onCreate(this)
}
if (oldVersion < 6) {
// Clear database from rC3 NOWHERE 12/2021 & 36C3 2019.
// Clear database from rC3 NOWHERE 12/2021 & 36C3 2019 & HOPE 2022.
dropTableIfExist(NAME)
onCreate(this)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ internal class HighlightDBOpenHelper(context: Context) : SQLiteOpenHelper(
}

override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) = with(db) {
// Clear database from 36C3 2019.
// Clear database from 36C3 2019 & HOPE 2022.
dropTableIfExist(NAME)
onCreate(this)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal class MetaDBOpenHelper(context: Context) : SQLiteOpenHelper(
) {

private companion object {
const val DATABASE_VERSION = 9
const val DATABASE_VERSION = 8
const val DATABASE_NAME = "meta"

// language=sql
Expand Down Expand Up @@ -66,15 +66,10 @@ internal class MetaDBOpenHelper(context: Context) : SQLiteOpenHelper(
onCreate(this)
}
if (oldVersion < 8) {
// Clear database from rC3 NOWHERE 12/2021 & 36C3 2019.
// Clear database from rC3 NOWHERE 12/2021 & 36C3 2019 & HOPE 2022.
dropTableIfExist(NAME)
onCreate(this)
}
if (oldVersion < 9) {
if (!columnExists(NAME, SCHEDULE_LAST_MODIFIED)) {
addTextColumn(SCHEDULE_LAST_MODIFIED, default = "")
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ internal class SessionsDBOpenHelper(context: Context) : SQLiteOpenHelper(
) {

private companion object {
const val DATABASE_VERSION = 15
const val DATABASE_VERSION = 13
const val DATABASE_NAME = "lectures" // Keep table name to avoid database migration.

// language=sql
Expand Down Expand Up @@ -177,21 +177,11 @@ internal class SessionsDBOpenHelper(context: Context) : SQLiteOpenHelper(
onCreate(this)
}
if (oldVersion < 13) {
// Clear database from rC3 NOWHERE 12/2021 & 36C3 2019.
// Clear database from rC3 NOWHERE 12/2021 & 36C3 2019 & HOPE 2022.
dropTableIfExist(SessionsTable.NAME)
dropTableIfExist(SessionByNotificationIdTable.NAME)
onCreate(this)
}
if (oldVersion < 14) {
if (!columnExists(SessionsTable.NAME, ROOM_IDENTIFIER)) {
addTextColumn(ROOM_IDENTIFIER, default = "")
}
}
if (oldVersion < 15) {
if (!columnExists(SessionsTable.NAME, FEEDBACK_URL)) {
addTextColumn(FEEDBACK_URL, default = null)
}
}
}

}
Expand Down

0 comments on commit 8a5096d

Please sign in to comment.