Skip to content

Commit

Permalink
Clear database from FOSDEM 2024.
Browse files Browse the repository at this point in the history
+ Related commit: e5d8e0e.
  • Loading branch information
johnjohndoe committed Jan 15, 2025
1 parent aa5a8d3 commit 669c6f9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ internal class AlarmsDBOpenHelper(context: Context) : SQLiteOpenHelper(
) {

private companion object {
const val DATABASE_VERSION = 7
const val DATABASE_VERSION = 12
const val DATABASE_NAME = "alarms"

// language=sql
Expand Down Expand Up @@ -73,6 +73,11 @@ internal class AlarmsDBOpenHelper(context: Context) : SQLiteOpenHelper(
dropTableIfExist(NAME)
onCreate(this)
}
if (oldVersion < 12) {
// Clear database from FOSDEM 2024.
dropTableIfExist(NAME)
onCreate(this)
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ internal class HighlightDBOpenHelper(context: Context) : SQLiteOpenHelper(
) {

private companion object {
const val DATABASE_VERSION = 6
const val DATABASE_VERSION = 11
const val DATABASE_NAME = "highlight"

// language=sql
Expand All @@ -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 & FOSDEM 2024.
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 = 13
const val DATABASE_NAME = "meta"

// language=sql
Expand Down Expand Up @@ -80,6 +80,11 @@ internal class MetaDBOpenHelper(context: Context) : SQLiteOpenHelper(
dropTableIfExist(NAME)
onCreate(this)
}
if (oldVersion < 13) {
// Clear database from FOSDEM 2024.
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 = 16
const val DATABASE_NAME = "lectures" // Keep table name to avoid database migration.

// language=sql
Expand Down Expand Up @@ -296,10 +296,7 @@ internal class SessionsDBOpenHelper(context: Context) : SQLiteOpenHelper(
}
}
if (oldVersion < 16) {
execSQL(SCHEDULE_STATISTIC_VIEW_CREATE)
}
if (oldVersion < 17) {
// Clear database from Camp 2023 & 37C3 2023.
// Clear database from FOSDEM 2024.
dropTableIfExist(SessionsTable.NAME)
dropTableIfExist(SessionByNotificationIdTable.NAME)
onCreate(this)
Expand Down

0 comments on commit 669c6f9

Please sign in to comment.