Merge branch 'little-db-fixes' into 'master'
Little db fixes See merge request fdroid/fdroidclient!729
This commit is contained in:
commit
10e275037b
@ -228,6 +228,9 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
* Only used for testing. Not quite sure how to mock a singleton variable like this.
|
||||
*/
|
||||
public static void clearDbHelperSingleton() {
|
||||
if (instance != null) {
|
||||
instance.close();
|
||||
}
|
||||
instance = null;
|
||||
}
|
||||
|
||||
@ -275,6 +278,12 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
super.onDowngrade(db, oldVersion, newVersion);
|
||||
resetTransient(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user