diff --git a/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/AlarmsDBOpenHelper.java b/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/AlarmsDBOpenHelper.java index 4915eaa4d6..451cf0a105 100644 --- a/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/AlarmsDBOpenHelper.java +++ b/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/AlarmsDBOpenHelper.java @@ -10,7 +10,7 @@ public class AlarmsDBOpenHelper extends SQLiteOpenHelper { - private static final int DATABASE_VERSION = 6; + private static final int DATABASE_VERSION = 5; private static final String DATABASE_NAME = "alarms"; @@ -53,12 +53,7 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { onCreate(db); } if (oldVersion < 5) { - // Clear database from rC3 12/2020. - db.execSQL("DROP TABLE IF EXISTS " + AlarmsTable.NAME); - onCreate(db); - } - if (oldVersion < 6) { - // Clear database from rC3 NOWHERE 12/2021 & 36C3 2019. + // Clear database from rC3 12/2020 & KotlinConf 2023. db.execSQL("DROP TABLE IF EXISTS " + AlarmsTable.NAME); onCreate(db); } diff --git a/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/HighlightDBOpenHelper.java b/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/HighlightDBOpenHelper.java index 3a40abb3a9..22bb9557cd 100644 --- a/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/HighlightDBOpenHelper.java +++ b/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/HighlightDBOpenHelper.java @@ -11,7 +11,7 @@ public class HighlightDBOpenHelper extends SQLiteOpenHelper { - private static final int DATABASE_VERSION = 5; + private static final int DATABASE_VERSION = 4; private static final String DATABASE_NAME = "highlight"; diff --git a/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/MetaDBOpenHelper.java b/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/MetaDBOpenHelper.java index bbc1d5581f..bb14be9ded 100644 --- a/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/MetaDBOpenHelper.java +++ b/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/MetaDBOpenHelper.java @@ -13,7 +13,7 @@ public class MetaDBOpenHelper extends SQLiteOpenHelper { - private static final int DATABASE_VERSION = 9; + private static final int DATABASE_VERSION = 6; private static final String DATABASE_NAME = "meta"; @@ -42,10 +42,6 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL("ALTER TABLE " + MetasTable.NAME + " ADD COLUMN " + Columns.ETAG + " TEXT DEFAULT " + Defaults.ETAG_DEFAULT); } - if (oldVersion < 6 && newVersion >= 6) { - db.execSQL("ALTER TABLE " + MetasTable.NAME + " ADD COLUMN " + - Columns.TIME_ZONE_NAME + " TEXT"); - } if (oldVersion < 4) { // Clear database from 34C3. db.execSQL("DROP TABLE IF EXISTS " + MetasTable.NAME); @@ -56,22 +52,10 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL("DROP TABLE IF EXISTS " + MetasTable.NAME); onCreate(db); } - if (oldVersion < 7) { - // Clear database from rC3 12/2020. - db.execSQL("DROP TABLE IF EXISTS " + MetasTable.NAME); - onCreate(db); - } - if (oldVersion < 8) { - // Clear database from rC3 NOWHERE 12/2021 & 36C3 2019. + if (oldVersion < 6) { + // Clear database from KotlinConf 2023. db.execSQL("DROP TABLE IF EXISTS " + MetasTable.NAME); onCreate(db); } - if (oldVersion < 9) { - boolean columnExists = SQLiteDatabaseExtensions.columnExists(db, MetasTable.NAME, Columns.SCHEDULE_LAST_MODIFIED); - if (!columnExists) { - db.execSQL("ALTER TABLE " + MetasTable.NAME + " ADD COLUMN " + - Columns.SCHEDULE_LAST_MODIFIED + " TEXT DEFAULT ''"); - } - } } } diff --git a/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/SessionsDBOpenHelper.java b/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/SessionsDBOpenHelper.java index 5e76eedf67..9fd56eaa3a 100644 --- a/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/SessionsDBOpenHelper.java +++ b/database/src/main/java/info/metadude/android/eventfahrplan/database/sqliteopenhelper/SessionsDBOpenHelper.java @@ -16,7 +16,7 @@ public class SessionsDBOpenHelper extends SQLiteOpenHelper { - private static final int DATABASE_VERSION = 15; + private static final int DATABASE_VERSION = 10; private static final String DATABASE_NAME = "lectures"; // Keep table name to avoid database migration. @@ -131,40 +131,11 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL("DROP TABLE IF EXISTS " + SessionsTable.NAME); onCreate(db); } - if (oldVersion < 10 && newVersion >= 10) { - db.execSQL(SESSION_BY_NOTIFICATION_ID_TABLE_CREATE); - } - if (oldVersion < 11 && newVersion >= 11) { - boolean columnExists = SQLiteDatabaseExtensions.columnExists(db, SessionsTable.NAME, Columns.TIME_ZONE_OFFSET); - if (!columnExists) { - db.execSQL("ALTER TABLE " + SessionsTable.NAME + " ADD COLUMN " + Columns.TIME_ZONE_OFFSET + " INTEGER DEFAULT NULL"); - } - } - if (oldVersion < 12) { - // Clear database from rC3 12/2020. - db.execSQL("DROP TABLE IF EXISTS " + SessionsTable.NAME); - db.execSQL("DROP TABLE IF EXISTS " + SessionByNotificationIdTable.NAME); - onCreate(db); - } - if (oldVersion < 13) { - // Clear database from rC3 NOWHERE 12/2021 & 36C3 2019. + if (oldVersion < 10) { + // Clear database from KotlinConf 2023. db.execSQL("DROP TABLE IF EXISTS " + SessionsTable.NAME); - db.execSQL("DROP TABLE IF EXISTS " + SessionByNotificationIdTable.NAME); onCreate(db); } - if (oldVersion < 14) { - boolean columnExists = SQLiteDatabaseExtensions.columnExists(db, SessionsTable.NAME, Columns.ROOM_IDENTIFIER); - if (!columnExists) { - db.execSQL("ALTER TABLE " + SessionsTable.NAME + " ADD COLUMN " + Columns.ROOM_IDENTIFIER + " TEXT DEFAULT ''"); - } - } - if (oldVersion < 15) { - boolean columnExists = SQLiteDatabaseExtensions.columnExists(db, SessionsTable.NAME, Columns.FEEDBACK_URL); - if (!columnExists) { - db.execSQL("ALTER TABLE " + SessionsTable.NAME + " ADD COLUMN " + Columns.FEEDBACK_URL + " TEXT DEFAULT NULL"); - } - } - } }