db v20 is also on master, v21 now has to be used so development doesn't break

This commit is contained in:
AndyScherzinger 2017-05-05 18:01:27 +02:00
parent 20b05e7ce2
commit b02d4378fa
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -985,7 +985,23 @@ public class FileContentProvider extends ContentProvider {
}
if (oldVersion < 20 && newVersion >= 20) {
Log_OC.i(SQL, "Entering in the #20 ADD in onUpgrade");
Log_OC.i(SQL, "Adding arbitrary data table");
db.beginTransaction();
try {
createArbitraryData(db);
upgraded = true;
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
}
if (!upgraded) {
Log_OC.i(SQL, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
}
if (oldVersion < 21 && newVersion >= 21) {
Log_OC.i(SQL, "Entering in the #21 ADD in onUpgrade");
db.beginTransaction();
try {
// add type column default being CUSTOM (0)
@ -994,10 +1010,6 @@ public class FileContentProvider extends ContentProvider {
ADD_COLUMN + ProviderTableMeta.SYNCED_FOLDER_TYPE +
" INTEGER " + " DEFAULT 0");
// create arbitrary data table
Log_OC.i(SQL, "Create arbitrary_data table");
createArbitraryData(db);
// magic to split out existing synced folders in two when needed
// otherwise, we migrate them to their proper type (image or video)
Log_OC.i(SQL, "Migrate synced_folders records for image/video split");