Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Unified Diff: chrome/browser/history/history_database.cc

Issue 9789001: Changes to add duration into history database. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/history_database.cc
diff --git a/chrome/browser/history/history_database.cc b/chrome/browser/history/history_database.cc
index 25e8bdadf8be73cd526f843b67077614300bcf79..30484f7bde804a640afb910bff6d1961dd21cc12 100644
--- a/chrome/browser/history/history_database.cc
+++ b/chrome/browser/history/history_database.cc
@@ -28,7 +28,7 @@ namespace {
// Current version number. We write databases at the "current" version number,
// but any previous version that can read the "compatible" one can make do with
// or database without *too* many bad effects.
-static const int kCurrentVersionNumber = 20;
+static const int kCurrentVersionNumber = 21;
static const int kCompatibleVersionNumber = 16;
static const char kEarlyExpirationThresholdKey[] = "early_expiration_threshold";
@@ -307,6 +307,13 @@ sql::InitStatus HistoryDatabase::EnsureCurrentVersion(
meta_table_.SetValue(kNeedsThumbnailMigrationKey, 1);
}
+ if (cur_version == 20) {
+ // This is the version prior to adding visit_details table. We need to
+ // migrate the database.
+ ++cur_version;
+ meta_table_.SetVersionNumber(cur_version);
+ }
+
// When the version is too old, we just try to continue anyway, there should
// not be a released product that makes a database too old for us to handle.
LOG_IF(WARNING, cur_version < GetCurrentVersion()) <<

Powered by Google App Engine
This is Rietveld 408576698