Skip to content

Commit 959b3af

Browse files
neslihanturanmisaochan
authored andcommitted
Fixes commons-app#3231 "Nearby" always first puts me in Punta Arenas (commons-app#3271)
* Update tables from 10 to 11 * Remove unneeded changes
1 parent bf4b731 commit 959b3af

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

app/src/main/java/fr/free/nrw/commons/bookmarks/locations/BookmarkLocationsDao.java

+7
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import fr.free.nrw.commons.nearby.Label;
2020
import fr.free.nrw.commons.nearby.Place;
2121
import fr.free.nrw.commons.nearby.Sitelinks;
22+
import timber.log.Timber;
2223

2324
import static fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsContentProvider.BASE_URI;
2425

@@ -239,6 +240,7 @@ public static void onDelete(SQLiteDatabase db) {
239240
}
240241

241242
public static void onUpdate(SQLiteDatabase db, int from, int to) {
243+
Timber.d("bookmarksLocations db is updated from:"+from+", to:"+to);
242244
if (from == to) {
243245
return;
244246
}
@@ -260,6 +262,11 @@ public static void onUpdate(SQLiteDatabase db, int from, int to) {
260262
onUpdate(db, from, to);
261263
return;
262264
}
265+
if (from == 10 && to == 11) {
266+
from++;
267+
db.execSQL("ALTER TABLE bookmarksLocations ADD COLUMN location_pic STRING;");
268+
return;
269+
}
263270
}
264271
}
265272
}

app/src/main/java/fr/free/nrw/commons/data/DBOpenHelper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
public class DBOpenHelper extends SQLiteOpenHelper {
1414

1515
private static final String DATABASE_NAME = "commons.db";
16-
private static final int DATABASE_VERSION = 10;
16+
private static final int DATABASE_VERSION = 11;
1717

1818
/**
1919
* Do not use directly - @Inject an instance where it's needed and let

0 commit comments

Comments
 (0)