Fix map markers database upgrade

This commit is contained in:
PavelRatushny 2017-09-21 15:17:09 +03:00
parent a9e539e339
commit a689841497

View file

@ -122,10 +122,10 @@ public class MapMarkersDbHelper {
} }
private void onUpgrade(SQLiteConnection db, int oldVersion, int newVersion) { private void onUpgrade(SQLiteConnection db, int oldVersion, int newVersion) {
// When the DB_VERSION will increase from 7, DROP TABLE must be removed. Existing markers should not be deleted. if (oldVersion < 8) {
db.execSQL("DROP TABLE IF EXISTS " + MARKERS_TABLE_NAME); db.execSQL("ALTER TABLE " + MARKERS_TABLE_NAME + " ADD " + MARKERS_COL_DISABLED + " int");
db.execSQL("DROP TABLE IF EXISTS " + GROUPS_TABLE_NAME); db.execSQL("ALTER TABLE " + GROUPS_TABLE_NAME + " ADD " + GROUPS_COL_DISABLED + " int");
onCreate(db); }
} }
private void saveExistingMarkersToDb() { private void saveExistingMarkersToDb() {