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

Unified Diff: chrome/browser/history/android/android_urls_database.cc

Issue 10067030: Upgrade the history database to version 23 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Sync and update test data Created 8 years, 8 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/android/android_urls_database.cc
diff --git a/chrome/browser/history/android/android_urls_database.cc b/chrome/browser/history/android/android_urls_database.cc
index 1527b6ac415d54603f1c36e2952362943f8b9b04..b76703a4cb86ceddd9aaa455e4699a6c4f8ca63f 100644
--- a/chrome/browser/history/android/android_urls_database.cc
+++ b/chrome/browser/history/android/android_urls_database.cc
@@ -144,4 +144,25 @@ bool AndroidURLsDatabase::ClearAndroidURLRows() {
return GetDB().Execute("DELETE FROM android_urls");
}
+bool AndroidURLsDatabase::MigrateToVersion22() {
+ if (!GetDB().DoesTableExist("android_urls"))
+ return true;
+
+ if (!GetDB().Execute("ALTER TABLE android_urls RENAME TO android_urls_tmp"))
+ return false;
+
+ if (!CreateAndroidURLsTable())
+ return false;
+
+ if (!GetDB().Execute(
+ "INSERT INTO android_urls (id, raw_url, url_id) "
+ "SELECT id, raw_url, url_id FROM android_urls_tmp"))
+ return false;
+
+ if (!GetDB().Execute("DROP TABLE android_urls_tmp"))
+ return false;
+
+ return true;
+}
+
} // namespace history

Powered by Google App Engine
This is Rietveld 408576698