Skip to content

Commit

Permalink
Clear database from LibreOffice 2022 on upgrade.
Browse files Browse the repository at this point in the history
+ Related database state: 9e9e418.
  • Loading branch information
johnjohndoe committed Sep 30, 2024
1 parent 570abc0 commit 5f55c33
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 24 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 & LibreOffice 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 & LibreOffice 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 & LibreOffice 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 @@ -109,7 +109,7 @@ internal class SessionsDBOpenHelper(context: Context) : SQLiteOpenHelper(
) {

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

// language=sql
Expand Down Expand Up @@ -280,24 +280,12 @@ 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 & LibreOffice 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)
}
}
if (oldVersion < 16) {
execSQL(SCHEDULE_STATISTIC_VIEW_CREATE)
}

}

}
Expand Down

0 comments on commit 5f55c33

Please sign in to comment.