| Index: sync/syncable/directory_backing_store.cc
|
| diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc
|
| index 55a01e6c352830ee0f9d345c02c1f3c05b40f828..6d08b75c1bebe271c0da86ee2c5a1b7b0e490246 100644
|
| --- a/sync/syncable/directory_backing_store.cc
|
| +++ b/sync/syncable/directory_backing_store.cc
|
| @@ -35,7 +35,7 @@ namespace syncable {
|
| static const string::size_type kUpdateStatementBufferSize = 2048;
|
|
|
| // Increment this version whenever updating DB tables.
|
| -const int32 kCurrentDBVersion = 88;
|
| +const int32 kCurrentDBVersion = 89;
|
|
|
| // Iterate over the fields of |entry| and bind each to |statement| for
|
| // updating. Returns the number of args bound.
|
| @@ -443,6 +443,12 @@ bool DirectoryBackingStore::InitializeTables() {
|
| version_on_disk = 88;
|
| }
|
|
|
| + // Version 89 migration adds server attachment metadata to the metas table.
|
| + if (version_on_disk == 88) {
|
| + if (MigrateVersion88To89())
|
| + version_on_disk = 89;
|
| + }
|
| +
|
| // If one of the migrations requested it, drop columns that aren't current.
|
| // It's only safe to do this after migrating all the way to the current
|
| // version.
|
| @@ -1326,6 +1332,18 @@ bool DirectoryBackingStore::MigrateVersion87To88() {
|
| return true;
|
| }
|
|
|
| +bool DirectoryBackingStore::MigrateVersion88To89() {
|
| + // Version 89 adds server_attachment_metadata.
|
| + if (!db_->Execute(
|
| + "ALTER TABLE metas ADD COLUMN "
|
| + "server_attachment_metadata BLOB")) {
|
| + return false;
|
| + }
|
| + SetVersion(89);
|
| + needs_column_refresh_ = true;
|
| + return true;
|
| +}
|
| +
|
| bool DirectoryBackingStore::CreateTables() {
|
| DVLOG(1) << "First run, creating tables";
|
| // Create two little tables share_version and share_info
|
|
|