Skip to content

Commit

Permalink
Clear database from FOSDEM 2023.
Browse files Browse the repository at this point in the history
+ Related commit: a4d723f.
  • Loading branch information
johnjohndoe committed Jan 19, 2024
1 parent 73f8a5c commit 890ab43
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

public class AlarmsDBOpenHelper extends SQLiteOpenHelper {

private static final int DATABASE_VERSION = 6;
private static final int DATABASE_VERSION = 11;

private static final String DATABASE_NAME = "alarms";

Expand Down Expand Up @@ -62,5 +62,10 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
db.execSQL("DROP TABLE IF EXISTS " + AlarmsTable.NAME);
onCreate(db);
}
if (oldVersion < 11) {
// Clear database from FOSDEM 2023.
db.execSQL("DROP TABLE IF EXISTS " + AlarmsTable.NAME);
onCreate(db);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class HighlightDBOpenHelper extends SQLiteOpenHelper {

private static final int DATABASE_VERSION = 5;
private static final int DATABASE_VERSION = 10;

private static final String DATABASE_NAME = "highlight";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

public class MetaDBOpenHelper extends SQLiteOpenHelper {

private static final int DATABASE_VERSION = 9;
private static final int DATABASE_VERSION = 12;

private static final String DATABASE_NAME = "meta";

Expand Down Expand Up @@ -73,5 +73,10 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
Columns.SCHEDULE_LAST_MODIFIED + " TEXT DEFAULT ''");
}
}
if (oldVersion < 12) {
// Clear database from FOSDEM 2023.
db.execSQL("DROP TABLE IF EXISTS " + MetasTable.NAME);
onCreate(db);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
}
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");
}
// Clear database from FOSDEM 2023.
db.execSQL("DROP TABLE IF EXISTS " + SessionsTable.NAME);
db.execSQL("DROP TABLE IF EXISTS " + SessionByNotificationIdTable.NAME);
onCreate(db);
}


Expand Down

0 comments on commit 890ab43

Please sign in to comment.