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

Unified Diff: sync/syncable/directory_backing_store.cc

Issue 11341048: Populate versions on individual nodes in sync model and native bookmark model. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lock dir Created 8 years, 1 month 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: sync/syncable/directory_backing_store.cc
diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc
index 4f9febf3c4de725cb27aa0268bfa26947916a7f9..ed77464c59dd0a97559611a0a68df8c3f060a0e8 100644
--- a/sync/syncable/directory_backing_store.cc
+++ b/sync/syncable/directory_backing_store.cc
@@ -40,7 +40,7 @@ static const string::size_type kUpdateStatementBufferSize = 2048;
// Increment this version whenever updating DB tables.
extern const int32 kCurrentDBVersion; // Global visibility for our unittest.
-const int32 kCurrentDBVersion = 82;
+const int32 kCurrentDBVersion = 83;
// Iterate over the fields of |entry| and bind each to |statement| for
// updating. Returns the number of args bound.
@@ -1072,6 +1072,19 @@ bool DirectoryBackingStore::MigrateVersion81To82() {
return true;
}
+bool DirectoryBackingStore::MigrateVersion82To83() {
+ // Version 83 added transaction_version on sync node.
+ if (!db_->Execute(
+ "ALTER TABLE metas ADD COLUMN transaction_version BIGINT default 0"))
+ return false;
+ sql::Statement update(db_->GetUniqueStatement(
+ "UPDATE metas SET transaction_version = 0"));
+ if (!update.Run())
+ return false;
+ SetVersion(83);
+ return true;
+}
+
bool DirectoryBackingStore::CreateTables() {
DVLOG(1) << "First run, creating tables";
// Create two little tables share_version and share_info

Powered by Google App Engine
This is Rietveld 408576698