X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/34923cf74ba9a09e10276bc919f05ddadc7ab6f7..d0cee8be8556d1db46ec6193b209f9ffdae104d0:/src/com/owncloud/android/db/DbHandler.java diff --git a/src/com/owncloud/android/db/DbHandler.java b/src/com/owncloud/android/db/DbHandler.java index 89864fea..3682a7b2 100644 --- a/src/com/owncloud/android/db/DbHandler.java +++ b/src/com/owncloud/android/db/DbHandler.java @@ -18,7 +18,7 @@ package com.owncloud.android.db; import com.owncloud.android.MainApp; -import com.owncloud.android.utils.Log_OC; +import com.owncloud.android.lib.common.utils.Log_OC; import android.content.ContentValues; import android.content.Context; @@ -114,7 +114,14 @@ public class DbHandler { db.execSQL("ALTER TABLE " + TABLE_INSTANT_UPLOAD + " ADD COLUMN attempt INTEGER;"); } db.execSQL("ALTER TABLE " + TABLE_INSTANT_UPLOAD + " ADD COLUMN message TEXT;"); - + } + + @Override + public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) { + //downgrading is the exception, so deleting and re-creating is acceptable. + //otherwise exception will be thrown (cannot downgrade) and oc app will crash. + db.execSQL("DROP TABLE IF EXISTS " + TABLE_INSTANT_UPLOAD + ";"); + onCreate(db); } } }