From 0411b3a335e673a50ce5c4848a9fddc62efef7e2 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Fri, 14 Jul 2017 10:55:33 +0200 Subject: [PATCH] Move code below --- OsmAnd/src/net/osmand/plus/GPXDatabase.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/GPXDatabase.java b/OsmAnd/src/net/osmand/plus/GPXDatabase.java index de16d07f8d..5799532663 100644 --- a/OsmAnd/src/net/osmand/plus/GPXDatabase.java +++ b/OsmAnd/src/net/osmand/plus/GPXDatabase.java @@ -177,15 +177,19 @@ public class GPXDatabase { } if (oldVersion < 3) { db.execSQL("ALTER TABLE " + GPX_TABLE_NAME + " ADD " + GPX_COL_FILE_LAST_MODIFIED_TIME + " long"); + } + + if (oldVersion < 4) { + db.execSQL("ALTER TABLE " + GPX_TABLE_NAME + " ADD " + GPX_COL_SPLIT_TYPE + " int"); + db.execSQL("ALTER TABLE " + GPX_TABLE_NAME + " ADD " + GPX_COL_SPLIT_INTERVAL + " double"); + } + + if (oldVersion < 3) { List items = getItems(); for (GpxDataItem item : items) { updateLastModifiedTime(item); } } - if (oldVersion < 4) { - db.execSQL("ALTER TABLE " + GPX_TABLE_NAME + " ADD " + GPX_COL_SPLIT_TYPE + " int"); - db.execSQL("ALTER TABLE " + GPX_TABLE_NAME + " ADD " + GPX_COL_SPLIT_INTERVAL + " double"); - } } private boolean updateLastModifiedTime(GpxDataItem item) {