fix db upgrade logic after rebase

This commit is contained in:
AndyScherzinger 2017-05-29 22:48:54 +02:00
parent 245bebf71a
commit cd4f6c59e4
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -377,10 +377,8 @@ public class FileContentProvider extends ContentProvider {
ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILESYSTEM, filesystedId);
} else {
throw new SQLException("ERROR " + uri);
}
return insertedFilesystemUri;
default:
throw new IllegalArgumentException("Unknown uri id: " + uri);
}
@ -1026,7 +1024,23 @@ public class FileContentProvider extends ContentProvider {
}
if (oldVersion < 21 && newVersion >= 21) {
Log_OC.i(SQL, "Entering in the #21 ADD in onUpgrade");
Log_OC.i(SQL, "Entering in the #21 Adding virtual table");
db.beginTransaction();
try {
createVirtualTable(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 < 22 && newVersion >= 22) {
Log_OC.i(SQL, "Entering in the #22 adding type colum for synced folders, Create filesystem table");
db.beginTransaction();
try {
// add type column default being CUSTOM (0)
@ -1054,38 +1068,6 @@ public class FileContentProvider extends ContentProvider {
}
}
if (oldVersion < 20 && newVersion >= 20) {
Log_OC.i(SQL, "Entering in the #20 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 Adding virtual table");
db.beginTransaction();
try {
createVirtualTable(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 < 22 && newVersion >= 22) {
Log_OC.i(SQL, "Entering in the #22 Adding user theming to capabilities table");
db.beginTransaction();