aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/persistance
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/persistance')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/persistance/DatabaseBackend.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/persistance/DatabaseBackend.java b/src/main/java/de/thedevstack/conversationsplus/persistance/DatabaseBackend.java
index 6442e909..7c2583ae 100644
--- a/src/main/java/de/thedevstack/conversationsplus/persistance/DatabaseBackend.java
+++ b/src/main/java/de/thedevstack/conversationsplus/persistance/DatabaseBackend.java
@@ -198,13 +198,13 @@ public class DatabaseBackend extends SQLiteOpenHelper {
protected void onUpgradeCPlusDatabase(SQLiteDatabase db, int oldVersion, int newVersion) {
Logging.d("db.upgrade.cplus", "Updating Conversations+ database from version '" + oldVersion + "' to '" + newVersion + "'");
if (oldVersion < newVersion) {
- if (oldVersion == 0 && newVersion == 1) {
+ if (oldVersion < 1 && newVersion >= 1) {
Logging.d("db.upgrade.cplus", "Creating additional parameters table for messages.");
db.execSQL(MessageDatabaseAccess.TABLE_ADDITIONAL_PARAMETERS_CREATE_V0);
db.execSQL("INSERT INTO " + MessageDatabaseAccess.TABLE_NAME_ADDITIONAL_PARAMETERS + "(" + MessageDatabaseAccess.COLUMN_NAME_MSG_PARAMS_MSGUUID + ") "
+ " SELECT " + Message.UUID + " FROM " + Message.TABLENAME);
}
- if (newVersion == 2) {
+ if (oldVersion < 2 && newVersion >= 2) {
Logging.d("db.upgrade.cplus", "Encrypt all passwords for the first time");
Cursor cursor = db.rawQuery("SELECT " + Account.UUID + ", " + Account.PASSWORD + " FROM " + Account.TABLENAME, new String[0]);
while (cursor.moveToNext()) {