From 0bdd968d2b6eb0a12c5f2879a6a8801c96a35d85 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Tue, 13 Sep 2016 23:39:40 -0400 Subject: [PATCH] [core] Remove schema v4 migration path --- platform/default/mbgl/storage/offline_database.cpp | 12 ++++++------ platform/default/mbgl/storage/offline_database.hpp | 1 - 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 50e2bdfbc..40296307c 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 5e9a19057..6873bc74d 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 {