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

Unified Diff: components/history/core/browser/url_database.cc

Issue 2954593002: History init: add metrics and skip migration. (Closed)
Patch Set: Explicit enum values Created 3 years, 6 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
« no previous file with comments | « components/history/core/browser/in_memory_database.cc ('k') | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/history/core/browser/url_database.cc
diff --git a/components/history/core/browser/url_database.cc b/components/history/core/browser/url_database.cc
index 575e8504c3866769d6e865a60102666536f7efc6..4d8c5df41720037b5d0d69fc241ed275da8c34bc 100644
--- a/components/history/core/browser/url_database.cc
+++ b/components/history/core/browser/url_database.cc
@@ -586,19 +586,32 @@ bool URLDatabase::CreateURLTable(bool is_temporary) {
sql.append(name);
sql.append(
"("
- "id INTEGER PRIMARY KEY AUTOINCREMENT,"
- // Using AUTOINCREMENT is for sync propose. Sync uses this |id| as an
- // unique key to identify the URLs. If here did not use AUTOINCREMENT, and
- // Sync was not working somehow, a ROWID could be deleted and re-used
+ // The id uses AUTOINCREMENT is for sync propose. Sync uses this |id| as
+ // an unique key to identify the URLs. If here did not use AUTOINCREMENT,
+ // and Sync was not working somehow, a ROWID could be deleted and re-used
// during this period. Once Sync come back, Sync would use ROWIDs and
// timestamps to see if there are any updates need to be synced. And sync
- // will only see the new URL, but missed the deleted URL.
+ // will only see the new URL, but missed the deleted URL.
+ //
+ // IMPORTANT NOTE: Currently new tables are created with AUTOINCREMENT
+ // but the migration code is disabled. This means that you will not
+ // be able to count on AUTOINCREMENT behavior without adding
+ // additional migration steps.
+ //
+ // Along with this, an unused favicon_id column will exist for tables
+ // without AUTOINCREMENT. This should be removed everywhere.
+ //
+ // TODO(https://crbug.com/736136) figure out how to update users to use
+ // AUTOINCREMENT and remove the favicon_id column consistently.
+ "id INTEGER PRIMARY KEY AUTOINCREMENT,"
"url LONGVARCHAR,"
"title LONGVARCHAR,"
"visit_count INTEGER DEFAULT 0 NOT NULL,"
"typed_count INTEGER DEFAULT 0 NOT NULL,"
"last_visit_time INTEGER NOT NULL,"
"hidden INTEGER DEFAULT 0 NOT NULL)");
+ // IMPORTANT: If you change the colums, also update in_memory_database.cc
+ // where the values are copied (InitFromDisk).
return GetDB().Execute(sql.c_str());
}
« no previous file with comments | « components/history/core/browser/in_memory_database.cc ('k') | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698