Skip to content

Commit a9ac038

Browse files
committed
Clear database from FOSSGIS 2025.
+ Related database state: bbf6ef4
1 parent b0f2681 commit a9ac038

4 files changed

Lines changed: 17 additions & 20 deletions

File tree

database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/AlarmsDBOpenHelper.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal class AlarmsDBOpenHelper(context: Context) : SQLiteOpenHelper(
1919
) {
2020

2121
private companion object {
22-
const val DATABASE_VERSION = 8
22+
const val DATABASE_VERSION = 13
2323
const val DATABASE_NAME = "alarms"
2424

2525
// language=sql
@@ -67,6 +67,12 @@ internal class AlarmsDBOpenHelper(context: Context) : SQLiteOpenHelper(
6767
dropTableIfExist(NAME)
6868
onCreate(this)
6969
}
70+
if (oldVersion < 13) {
71+
// Clear database from FOSSGIS 2025.
72+
dropTableIfExist(NAME)
73+
onCreate(this)
74+
}
75+
7076
}
7177

7278
}

database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/HighlightDBOpenHelper.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ internal class HighlightDBOpenHelper(context: Context) : SQLiteOpenHelper(
1717
) {
1818

1919
private companion object {
20-
const val DATABASE_VERSION = 7
20+
const val DATABASE_VERSION = 12
2121
const val DATABASE_NAME = "highlight"
2222

2323
// language=sql
@@ -33,7 +33,7 @@ internal class HighlightDBOpenHelper(context: Context) : SQLiteOpenHelper(
3333
}
3434

3535
override fun onUpgrade(db: SQLiteDatabase, oldVersion: Int, newVersion: Int) = with(db) {
36-
// Clear database from Camp 2023 & 38C3 2024.
36+
// Clear database from Camp 2023 & 38C3 2024 & FOSSGIS 2025.
3737
dropTableIfExist(NAME)
3838
onCreate(this)
3939
}

database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/MetaDBOpenHelper.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal class MetaDBOpenHelper(context: Context) : SQLiteOpenHelper(
2626
) {
2727

2828
private companion object {
29-
const val DATABASE_VERSION = 12
29+
const val DATABASE_VERSION = 14
3030
const val DATABASE_NAME = "meta"
3131

3232
// language=sql
@@ -97,6 +97,11 @@ internal class MetaDBOpenHelper(context: Context) : SQLiteOpenHelper(
9797
dropTableIfExist(NAME)
9898
onCreate(this)
9999
}
100+
if (oldVersion < 14) {
101+
// Clear database from FOSSGIS 2025.
102+
dropTableIfExist(NAME)
103+
onCreate(this)
104+
}
100105
}
101106

102107
}

database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/SessionsDBOpenHelper.kt

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ internal class SessionsDBOpenHelper(context: Context) : SQLiteOpenHelper(
110110
) {
111111

112112
private companion object {
113-
const val DATABASE_VERSION = 19
113+
const val DATABASE_VERSION = 16
114114
const val DATABASE_NAME = "lectures" // Keep table name to avoid database migration.
115115

116116
// language=sql
@@ -298,25 +298,11 @@ internal class SessionsDBOpenHelper(context: Context) : SQLiteOpenHelper(
298298
}
299299
}
300300
if (oldVersion < 16) {
301-
execSQL(SCHEDULE_STATISTIC_VIEW_CREATE)
302-
}
303-
if (oldVersion < 17) {
304-
// Clear database from Camp 2023 & 37C3 2023.
305-
dropTableIfExist(SessionsTable.NAME)
306-
dropTableIfExist(SessionByNotificationIdTable.NAME)
307-
onCreate(this)
308-
}
309-
if (oldVersion < 18) {
310-
// Clear database from 38C3 2024.
301+
// Clear database from FOSSGIS 2025.
311302
dropTableIfExist(SessionsTable.NAME)
312303
dropTableIfExist(SessionByNotificationIdTable.NAME)
313304
onCreate(this)
314305
}
315-
if (oldVersion < 19) {
316-
if (!columnExists(SessionsTable.NAME, SESSION_GUID)) {
317-
addTextColumn(SESSION_GUID, default = null)
318-
}
319-
}
320306
}
321307

322308
}

0 commit comments

Comments
 (0)