From a6898414973ac019721fd4fe71a1dcfa7dbe3974 Mon Sep 17 00:00:00 2001 From: PavelRatushny Date: Thu, 21 Sep 2017 15:17:09 +0300 Subject: [PATCH] Fix map markers database upgrade --- .../net/osmand/plus/mapmarkers/MapMarkersDbHelper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java index 244c5ac385..deda71e17e 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/MapMarkersDbHelper.java @@ -122,10 +122,10 @@ public class MapMarkersDbHelper { } 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. - db.execSQL("DROP TABLE IF EXISTS " + MARKERS_TABLE_NAME); - db.execSQL("DROP TABLE IF EXISTS " + GROUPS_TABLE_NAME); - onCreate(db); + if (oldVersion < 8) { + db.execSQL("ALTER TABLE " + MARKERS_TABLE_NAME + " ADD " + MARKERS_COL_DISABLED + " int"); + db.execSQL("ALTER TABLE " + GROUPS_TABLE_NAME + " ADD " + GROUPS_COL_DISABLED + " int"); + } } private void saveExistingMarkersToDb() {