|
@@ -76,458 +76,6 @@ public class LegacyMigrationHelper {
|
|
public void onUpgrade(SupportSQLiteDatabase db, int oldVersion, int newVersion) {
|
|
public void onUpgrade(SupportSQLiteDatabase db, int oldVersion, int newVersion) {
|
|
Log_OC.i(TAG, "Entering in onUpgrade");
|
|
Log_OC.i(TAG, "Entering in onUpgrade");
|
|
boolean upgraded = false;
|
|
boolean upgraded = false;
|
|
- if (oldVersion == 1 && newVersion >= 2) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #2 ADD in onUpgrade");
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.FILE_KEEP_IN_SYNC + " INTEGER " +
|
|
|
|
- " DEFAULT 0");
|
|
|
|
- upgraded = true;
|
|
|
|
- }
|
|
|
|
- if (oldVersion < 3 && newVersion >= 3) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #3 ADD in onUpgrade");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA +
|
|
|
|
- " INTEGER " + " DEFAULT 0");
|
|
|
|
-
|
|
|
|
- // assume there are not local changes pending to upload
|
|
|
|
- db.execSQL("UPDATE " + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- " SET " + ProviderMeta.ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA + " = "
|
|
|
|
- + System.currentTimeMillis() +
|
|
|
|
- " WHERE " + ProviderMeta.ProviderTableMeta.FILE_STORAGE_PATH + " IS NOT NULL");
|
|
|
|
-
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (oldVersion < 4 && newVersion >= 4) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #4 ADD in onUpgrade");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA +
|
|
|
|
- " INTEGER " + " DEFAULT 0");
|
|
|
|
-
|
|
|
|
- db.execSQL("UPDATE " + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- " SET " + ProviderMeta.ProviderTableMeta.FILE_MODIFIED_AT_LAST_SYNC_FOR_DATA + " = " +
|
|
|
|
- ProviderMeta.ProviderTableMeta.FILE_MODIFIED +
|
|
|
|
- " WHERE " + ProviderMeta.ProviderTableMeta.FILE_STORAGE_PATH + " IS NOT NULL");
|
|
|
|
-
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 5 && newVersion >= 5) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #5 ADD in onUpgrade");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.FILE_ETAG + " TEXT " +
|
|
|
|
- " DEFAULT NULL");
|
|
|
|
-
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 6 && newVersion >= 6) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #6 ADD in onUpgrade");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.FILE_SHARED_VIA_LINK + " INTEGER " +
|
|
|
|
- " DEFAULT 0");
|
|
|
|
-
|
|
|
|
- // Create table OCShares
|
|
|
|
- createOCSharesTable(db);
|
|
|
|
-
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 7 && newVersion >= 7) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #7 ADD in onUpgrade");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.FILE_PERMISSIONS + " TEXT " +
|
|
|
|
- " DEFAULT NULL");
|
|
|
|
-
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.FILE_REMOTE_ID + " TEXT " +
|
|
|
|
- " DEFAULT NULL");
|
|
|
|
-
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 8 && newVersion >= 8) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #8 ADD in onUpgrade");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.FILE_UPDATE_THUMBNAIL + " INTEGER " +
|
|
|
|
- " DEFAULT 0");
|
|
|
|
-
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 9 && newVersion >= 9) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #9 ADD in onUpgrade");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.FILE_IS_DOWNLOADING + " INTEGER " +
|
|
|
|
- " DEFAULT 0");
|
|
|
|
-
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 10 && newVersion >= 10) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #10 ADD in onUpgrade");
|
|
|
|
- updateAccountName(db);
|
|
|
|
- upgraded = true;
|
|
|
|
- }
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 11 && newVersion >= 11) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #11 ADD in onUpgrade");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.FILE_ETAG_IN_CONFLICT + " TEXT " +
|
|
|
|
- " DEFAULT NULL");
|
|
|
|
-
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 12 && newVersion >= 12) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #12 ADD in onUpgrade");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.FILE_SHARED_WITH_SHAREE + " INTEGER " +
|
|
|
|
- " DEFAULT 0");
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 13 && newVersion >= 13) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #13 ADD in onUpgrade");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- // Create capabilities table
|
|
|
|
- createCapabilitiesTable(db);
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 14 && newVersion >= 14) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #14 ADD in onUpgrade");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- // drop old instant_upload table
|
|
|
|
- db.execSQL("DROP TABLE IF EXISTS " + "instant_upload" + ";");
|
|
|
|
- // Create uploads table
|
|
|
|
- createUploadsTable(db);
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 15 && newVersion >= 15) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #15 ADD in onUpgrade");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- // drop old capabilities table
|
|
|
|
- db.execSQL("DROP TABLE IF EXISTS " + "capabilities" + ";");
|
|
|
|
- // Create uploads table
|
|
|
|
- createCapabilitiesTable(db);
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 16 && newVersion >= 16) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #16 ADD synced folders table");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- // Create synced folders table
|
|
|
|
- createSyncedFoldersTable(db);
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 17 && newVersion >= 17) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #17 ADD in onUpgrade");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.FILE_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.FILE_FAVORITE +
|
|
|
|
- " INTEGER " + " DEFAULT 0");
|
|
|
|
-
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 18 && newVersion >= 18) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #18 Adding external link column to capabilities");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.CAPABILITIES_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.CAPABILITIES_EXTERNAL_LINKS +
|
|
|
|
- " INTEGER " + " DEFAULT -1");
|
|
|
|
-
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 19 && newVersion >= 19) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #19 Adding external link column to capabilities");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- createExternalLinksTable(db);
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 20 && newVersion >= 20) {
|
|
|
|
- Log_OC.i(TAG, "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(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 21 && newVersion >= 21) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #21 Adding virtual table");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- createVirtualTable(db);
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 22 && newVersion >= 22) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #22 Adding user theming to capabilities table");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.CAPABILITIES_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.CAPABILITIES_SERVER_NAME + " TEXT ");
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.CAPABILITIES_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.CAPABILITIES_SERVER_COLOR + " TEXT ");
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.CAPABILITIES_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.CAPABILITIES_SERVER_BACKGROUND_URL + " TEXT ");
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.CAPABILITIES_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.CAPABILITIES_SERVER_SLOGAN + " TEXT ");
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 23 && newVersion >= 23) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #23 adding type column for synced folders, Create filesystem table");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- // add type column default being CUSTOM (0)
|
|
|
|
- if (!checkIfColumnExists(db, ProviderMeta.ProviderTableMeta.SYNCED_FOLDERS_TABLE_NAME,
|
|
|
|
- ProviderMeta.ProviderTableMeta.SYNCED_FOLDER_TYPE)) {
|
|
|
|
- Log_OC.i(TAG, "Add type column and default value 0 (CUSTOM) to synced_folders table");
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.SYNCED_FOLDERS_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.SYNCED_FOLDER_TYPE +
|
|
|
|
- " INTEGER " + " DEFAULT 0");
|
|
|
|
- } else {
|
|
|
|
- Log_OC.i(TAG, "Type column of synced_folders table already exists");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!checkIfColumnExists(db, ProviderMeta.ProviderTableMeta.UPLOADS_TABLE_NAME,
|
|
|
|
- ProviderMeta.ProviderTableMeta.UPLOADS_IS_WIFI_ONLY)) {
|
|
|
|
- Log_OC.i(TAG, "Add charging and wifi columns to uploads");
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.UPLOADS_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.UPLOADS_IS_WIFI_ONLY +
|
|
|
|
- " INTEGER " + " DEFAULT 0");
|
|
|
|
- } else {
|
|
|
|
- Log_OC.i(TAG, "Wifi column of uploads table already exists");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!checkIfColumnExists(db, ProviderMeta.ProviderTableMeta.UPLOADS_TABLE_NAME,
|
|
|
|
- ProviderMeta.ProviderTableMeta.UPLOADS_IS_WHILE_CHARGING_ONLY)) {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.UPLOADS_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.UPLOADS_IS_WHILE_CHARGING_ONLY +
|
|
|
|
- " INTEGER " + " DEFAULT 0");
|
|
|
|
- } else {
|
|
|
|
- Log_OC.i(TAG, "Charging column of uploads table already exists");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // create Filesystem table
|
|
|
|
- Log_OC.i(TAG, "Create filesystem table");
|
|
|
|
- createFileSystemTable(db);
|
|
|
|
-
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
-
|
|
|
|
- } catch (Throwable t) {
|
|
|
|
- Log_OC.e(TAG, "ERROR!", t);
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (oldVersion < 24 && newVersion >= 24) {
|
|
|
|
- Log_OC.i(TAG, "Entering in the #24 Re-adding user theming to capabilities table");
|
|
|
|
- db.beginTransaction();
|
|
|
|
- try {
|
|
|
|
- if (!checkIfColumnExists(db, ProviderMeta.ProviderTableMeta.CAPABILITIES_TABLE_NAME,
|
|
|
|
- ProviderMeta.ProviderTableMeta.CAPABILITIES_SERVER_NAME)) {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.CAPABILITIES_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.CAPABILITIES_SERVER_NAME + " TEXT ");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!checkIfColumnExists(db, ProviderMeta.ProviderTableMeta.CAPABILITIES_TABLE_NAME,
|
|
|
|
- ProviderMeta.ProviderTableMeta.CAPABILITIES_SERVER_COLOR)) {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.CAPABILITIES_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.CAPABILITIES_SERVER_COLOR + " TEXT ");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!checkIfColumnExists(db, ProviderMeta.ProviderTableMeta.CAPABILITIES_TABLE_NAME,
|
|
|
|
- ProviderMeta.ProviderTableMeta.CAPABILITIES_SERVER_BACKGROUND_URL)) {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.CAPABILITIES_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.CAPABILITIES_SERVER_BACKGROUND_URL + " TEXT ");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!checkIfColumnExists(db, ProviderMeta.ProviderTableMeta.CAPABILITIES_TABLE_NAME,
|
|
|
|
- ProviderMeta.ProviderTableMeta.CAPABILITIES_SERVER_SLOGAN)) {
|
|
|
|
- db.execSQL(ALTER_TABLE + ProviderMeta.ProviderTableMeta.CAPABILITIES_TABLE_NAME +
|
|
|
|
- ADD_COLUMN + ProviderMeta.ProviderTableMeta.CAPABILITIES_SERVER_SLOGAN + " TEXT ");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- upgraded = true;
|
|
|
|
- db.setTransactionSuccessful();
|
|
|
|
- } finally {
|
|
|
|
- db.endTransaction();
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (!upgraded) {
|
|
|
|
- Log_OC.i(TAG, String.format(Locale.ENGLISH, UPGRADE_VERSION_MSG, oldVersion, newVersion));
|
|
|
|
- }
|
|
|
|
|
|
|
|
if (oldVersion < 25 && newVersion >= 25) {
|
|
if (oldVersion < 25 && newVersion >= 25) {
|
|
Log_OC.i(TAG, "Entering in the #25 Adding encryption flag to file");
|
|
Log_OC.i(TAG, "Entering in the #25 Adding encryption flag to file");
|