Move code below

This commit is contained in:
Victor Shcherb 2017-07-14 10:55:33 +02:00
parent 18c0f44ff6
commit 0411b3a335

View file

@ -177,15 +177,19 @@ public class GPXDatabase {
} }
if (oldVersion < 3) { if (oldVersion < 3) {
db.execSQL("ALTER TABLE " + GPX_TABLE_NAME + " ADD " + GPX_COL_FILE_LAST_MODIFIED_TIME + " long"); 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<GpxDataItem> items = getItems(); List<GpxDataItem> items = getItems();
for (GpxDataItem item : items) { for (GpxDataItem item : items) {
updateLastModifiedTime(item); 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) { private boolean updateLastModifiedTime(GpxDataItem item) {