summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wray <jason@mapbox.com>2016-09-13 23:39:40 -0400
committerJason Wray <jason@mapbox.com>2016-09-14 15:49:00 -0400
commit0bdd968d2b6eb0a12c5f2879a6a8801c96a35d85 (patch)
tree8ead0d74e1d396ec0eb0c18a2209a4cc10ec0306
parent9237ad3c5894ef1fd68e3a37505b12e2b4fad978 (diff)
downloadqtlocation-mapboxgl-0bdd968d2b6eb0a12c5f2879a6a8801c96a35d85.tar.gz
[core] Remove schema v4 migration path
-rw-r--r--platform/default/mbgl/storage/offline_database.cpp12
-rw-r--r--platform/default/mbgl/storage/offline_database.hpp1
2 files changed, 6 insertions, 7 deletions
diff --git a/platform/default/mbgl/storage/offline_database.cpp b/platform/default/mbgl/storage/offline_database.cpp
index 50e2bdfbc4..40296307cc 100644
--- a/platform/default/mbgl/storage/offline_database.cpp
+++ b/platform/default/mbgl/storage/offline_database.cpp
@@ -48,7 +48,7 @@ void OfflineDatabase::ensureSchema() {
case 0: break; // cache-only database; ok to delete
case 1: break; // cache-only database; ok to delete
case 2: migrateToVersion3(); // fall through
- case 3: migrateToVersion4(); // fall through
+ case 3: // no-op and fall through
case 4: migrateToVersion5(); // fall through
case 5: return;
default: throw std::runtime_error("unknown schema version");
@@ -115,11 +115,11 @@ void OfflineDatabase::migrateToVersion3() {
db->exec("PRAGMA user_version = 3");
}
-void OfflineDatabase::migrateToVersion4() {
- db->exec("PRAGMA journal_mode = WAL");
- db->exec("PRAGMA synchronous = NORMAL");
- db->exec("PRAGMA user_version = 4");
-}
+// Schema version 4 was WAL journal + NORMAL sync. It was reverted during pre-
+// release development and the migration was removed entirely to avoid potential
+// conflicts from quickly (and needlessly) switching journal and sync modes.
+//
+// See: https://github.com/mapbox/mapbox-gl-native/pull/6320
void OfflineDatabase::migrateToVersion5() {
db->exec("PRAGMA journal_mode = DELETE");
diff --git a/platform/default/mbgl/storage/offline_database.hpp b/platform/default/mbgl/storage/offline_database.hpp
index 5e9a190578..6873bc74dc 100644
--- a/platform/default/mbgl/storage/offline_database.hpp
+++ b/platform/default/mbgl/storage/offline_database.hpp
@@ -60,7 +60,6 @@ private:
void ensureSchema();
void removeExisting();
void migrateToVersion3();
- void migrateToVersion4();
void migrateToVersion5();
class Statement {