| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/webdata/common/web_database.h" | 5 #include "components/webdata/common/web_database.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "sql/statement.h" | 10 #include "sql/statement.h" |
| 11 #include "sql/transaction.h" | 11 #include "sql/transaction.h" |
| 12 | 12 |
| 13 // Current version number. Note: when changing the current version number, | 13 // Current version number. Note: when changing the current version number, |
| 14 // corresponding changes must happen in the unit tests, and new migration test | 14 // corresponding changes must happen in the unit tests, and new migration test |
| 15 // added. See |WebDatabaseMigrationTest::kCurrentTestedVersionNumber|. | 15 // added. See |WebDatabaseMigrationTest::kCurrentTestedVersionNumber|. |
| 16 // static | 16 // static |
| 17 const int WebDatabase::kCurrentVersionNumber = 63; | 17 const int WebDatabase::kCurrentVersionNumber = 64; |
| 18 | 18 |
| 19 const int WebDatabase::kDeprecatedVersionNumber = 51; | 19 const int WebDatabase::kDeprecatedVersionNumber = 51; |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 const int kCompatibleVersionNumber = 61; | 23 const int kCompatibleVersionNumber = 61; |
| 24 | 24 |
| 25 // Change the version number and possibly the compatibility version of | 25 // Change the version number and possibly the compatibility version of |
| 26 // |meta_table_|. | 26 // |meta_table_|. |
| 27 void ChangeVersion(sql::MetaTable* meta_table, | 27 void ChangeVersion(sql::MetaTable* meta_table, |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 185 |
| 186 bool WebDatabase::MigrateToVersion58DropWebAppsAndIntents() { | 186 bool WebDatabase::MigrateToVersion58DropWebAppsAndIntents() { |
| 187 sql::Transaction transaction(&db_); | 187 sql::Transaction transaction(&db_); |
| 188 return transaction.Begin() && | 188 return transaction.Begin() && |
| 189 db_.Execute("DROP TABLE IF EXISTS web_apps") && | 189 db_.Execute("DROP TABLE IF EXISTS web_apps") && |
| 190 db_.Execute("DROP TABLE IF EXISTS web_app_icons") && | 190 db_.Execute("DROP TABLE IF EXISTS web_app_icons") && |
| 191 db_.Execute("DROP TABLE IF EXISTS web_intents") && | 191 db_.Execute("DROP TABLE IF EXISTS web_intents") && |
| 192 db_.Execute("DROP TABLE IF EXISTS web_intents_defaults") && | 192 db_.Execute("DROP TABLE IF EXISTS web_intents_defaults") && |
| 193 transaction.Commit(); | 193 transaction.Commit(); |
| 194 } | 194 } |
| OLD | NEW |