diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2012-06-05 11:32:14 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2012-06-05 11:32:45 +0200 |
| commit | aaf61f1e7b043f1c936225e175fed2d4ba4edc8f (patch) | |
| tree | 6157817e5d25c8133cadc59e9f695dcea40dd2ae | |
| parent | c33e0c4fa198b1a2934a6bc11066bc13bd2bc7f5 (diff) | |
| download | cgeo-aaf61f1e7b043f1c936225e175fed2d4ba4edc8f.zip cgeo-aaf61f1e7b043f1c936225e175fed2d4ba4edc8f.tar.gz cgeo-aaf61f1e7b043f1c936225e175fed2d4ba4edc8f.tar.bz2 | |
Move caches from the ALL_CACHES list to the default list
This fixes the aftermath of issues #1702 and #1711.
| -rw-r--r-- | main/src/cgeo/geocaching/cgData.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/cgData.java b/main/src/cgeo/geocaching/cgData.java index 37f8b7d..4831524 100644 --- a/main/src/cgeo/geocaching/cgData.java +++ b/main/src/cgeo/geocaching/cgData.java @@ -73,7 +73,7 @@ public class cgData { private static int[] cacheColumnIndex; private CacheCache cacheCache = new CacheCache(); private SQLiteDatabase database = null; - private static final int dbVersion = 63; + private static final int dbVersion = 64; public static final int customListIdOffset = 10; private static final String dbName = "data"; private static final String dbTableCaches = "cg_caches"; @@ -649,6 +649,17 @@ public class cgData { } } + + if (oldVersion < 64) { + try { + // No cache should ever be stored into the ALL_CACHES list. Here we use hardcoded list ids + // rather than symbolic ones because the fix must be applied with the values at the time + // of the problem. The problem was introduced in release 2012.06.01. + db.execSQL("update " + dbTableCaches + " set reason=1 where reason=2"); + } catch (Exception e) { + Log.e("Failed to upgrade to ver. 64", e); + } + } } db.setTransactionSuccessful(); |
