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

Side by Side 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 unified diff | Download patch
OLDNEW
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 "chrome/browser/history/android/android_urls_database.h" 5 #include "chrome/browser/history/android/android_urls_database.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace history { 9 namespace history {
10 10
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 return false; 137 return false;
138 } 138 }
139 139
140 return true; 140 return true;
141 } 141 }
142 142
143 bool AndroidURLsDatabase::ClearAndroidURLRows() { 143 bool AndroidURLsDatabase::ClearAndroidURLRows() {
144 return GetDB().Execute("DELETE FROM android_urls"); 144 return GetDB().Execute("DELETE FROM android_urls");
145 } 145 }
146 146
147 bool AndroidURLsDatabase::MigrateToVersion22() {
148 if (!GetDB().DoesTableExist("android_urls"))
149 return true;
150
151 if (!GetDB().Execute("ALTER TABLE android_urls RENAME TO android_urls_tmp"))
152 return false;
153
154 if (!CreateAndroidURLsTable())
155 return false;
156
157 if (!GetDB().Execute(
158 "INSERT INTO android_urls (id, raw_url, url_id) "
159 "SELECT id, raw_url, url_id FROM android_urls_tmp"))
160 return false;
161
162 if (!GetDB().Execute("DROP TABLE android_urls_tmp"))
163 return false;
164
165 return true;
166 }
167
147 } // namespace history 168 } // namespace history
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698