mirror of
https://github.com/nextcloud/android.git
synced 2024-11-27 17:46:37 +03:00
fix db upgrade logic after rebase
This commit is contained in:
parent
245bebf71a
commit
cd4f6c59e4
1 changed files with 17 additions and 35 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue