From aaf61f1e7b043f1c936225e175fed2d4ba4edc8f Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Tue, 5 Jun 2012 11:32:14 +0200 Subject: Move caches from the ALL_CACHES list to the default list This fixes the aftermath of issues #1702 and #1711. --- main/src/cgeo/geocaching/cgData.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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(); -- cgit v1.1