Handled sqlitexception for adding existig column in app versions which already have COLUMN location_pic
This commit is contained in:
Ashish Kumar 2020-01-21 22:52:35 +05:30 committed by Josephine Lim
parent 53d3c37180
commit bae3fa8bbf

View file

@ -4,6 +4,7 @@ import android.content.ContentProviderClient;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.os.RemoteException;
import androidx.annotation.NonNull;
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
@ -264,7 +265,13 @@ public class BookmarkLocationsDao {
}
if (from == 10 && to == 11) {
from++;
//This is safe, and can be called clean, as we/I do not remember the appropriate version for this
//We are anyways switching to room, these things won't be nescessary then
try {
db.execSQL("ALTER TABLE bookmarksLocations ADD COLUMN location_pic STRING;");
}catch (SQLiteException exception){
Timber.e(exception);//
}
return;
}
}