mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Enure that db migrations are done properly
This commit is contained in:
parent
408bb5bb70
commit
da2b77e4b0
1 changed files with 4 additions and 0 deletions
|
|
@ -295,6 +295,10 @@ public class Contribution extends Media {
|
||||||
}
|
}
|
||||||
if(from == 2) {
|
if(from == 2) {
|
||||||
db.execSQL("ALTER TABLE " + TABLE_NAME + " ADD COLUMN multiple INTEGER;");
|
db.execSQL("ALTER TABLE " + TABLE_NAME + " ADD COLUMN multiple INTEGER;");
|
||||||
|
db.execSQL("UPDATE " + TABLE_NAME + " SET multiple = 0");
|
||||||
|
from++;
|
||||||
|
onUpdate(db, from, to);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
|
db.execSQL("DROP TABLE IF EXISTS " + TABLE_NAME);
|
||||||
onCreate(db);
|
onCreate(db);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue