Skip to content

Commit

Permalink
Clear database from CLT 2023.
Browse files Browse the repository at this point in the history
+ Related commit: fe74720
  • Loading branch information
johnjohndoe committed Feb 10, 2025
1 parent c8284e5 commit cf74dcf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ internal class AlarmsDBOpenHelper(context: Context) : SQLiteOpenHelper(
onCreate(this)
}
if (oldVersion < 7) {
// Clear database from Camp 2023 & 37C3 2023.
// Clear database from Camp 2023 & 37C3 2023 & CLT 2023.
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 Camp 2023 & 37C3 2023.
// Clear database from Camp 2023 & 37C3 2023 & CLT 2023.
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 = 10
const val DATABASE_VERSION = 9
const val DATABASE_NAME = "meta"

// language=sql
Expand Down Expand Up @@ -71,12 +71,7 @@ internal class MetaDBOpenHelper(context: Context) : SQLiteOpenHelper(
onCreate(this)
}
if (oldVersion < 9) {
if (!columnExists(NAME, SCHEDULE_LAST_MODIFIED)) {
addTextColumn(SCHEDULE_LAST_MODIFIED, default = "")
}
}
if (oldVersion < 10) {
// Clear database from Camp 2023 & 37C3 2023.
// Clear database from CLT 2023.
dropTableIfExist(NAME)
onCreate(this)
}
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 = 17
const val DATABASE_VERSION = 14
const val DATABASE_NAME = "lectures" // Keep table name to avoid database migration.

// language=sql
Expand Down Expand Up @@ -286,20 +286,7 @@ internal class SessionsDBOpenHelper(context: Context) : SQLiteOpenHelper(
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)
}
if (oldVersion < 17) {
// Clear database from Camp 2023 & 37C3 2023.
// Clear database from CLT 2023
dropTableIfExist(SessionsTable.NAME)
dropTableIfExist(SessionByNotificationIdTable.NAME)
onCreate(this)
Expand Down

0 comments on commit cf74dcf

Please sign in to comment.