mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 07:05:49 +03:00
on downgrading upload db, delete and re-create
This commit is contained in:
parent
0df8f178de
commit
1077a6de29
1 changed files with 8 additions and 1 deletions
|
@ -114,7 +114,14 @@ public class DbHandler {
|
|||
db.execSQL("ALTER TABLE " + TABLE_INSTANT_UPLOAD + " ADD COLUMN attempt INTEGER;");
|
||||
}
|
||||
db.execSQL("ALTER TABLE " + TABLE_INSTANT_UPLOAD + " ADD COLUMN message TEXT;");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
//downgrading is the exception, so deleting and re-creating is acceptable.
|
||||
//otherwise exception will be thrown (cannot downgrade) and oc app will crash.
|
||||
db.execSQL("DROP TABLE IF EXISTS " + TABLE_INSTANT_UPLOAD + ";");
|
||||
onCreate(db);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue