1 -- unit_tests --gtest_filter=ThumbnailDatabaseTest.WildSchema
3 -- Based on version 3 schema found in the wild by error diagnostics.
4 -- The schema was failing to migrate because the current-version
5 -- tables were being created before the migration code was called,
6 -- resulting in the migration code attempting to add columns which
7 -- already existed (see http://crbug.com/273203 ).
9 -- Should be razed by the deprecation code.
12 -- [meta] is expected.
13 CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY,value LONGVARCHAR);
14 INSERT INTO "meta" VALUES('version','3');
15 INSERT INTO "meta" VALUES('last_compatible_version','3');
17 -- [thumbnails] is optional for v3, but was not seen in any diagnostic
20 -- [favicons] was present in v3, but [icon_type] is a v4 column.
21 CREATE TABLE favicons(id INTEGER PRIMARY KEY,url LONGVARCHAR NOT NULL,last_updated INTEGER DEFAULT 0,image_data BLOB,icon_type INTEGER DEFAULT 1);
22 CREATE INDEX favicons_url ON favicons(url);
24 -- [icon_mapping] is a v4 table. Some cases didn't have the indices,
25 -- possibly because the migration code didn't create indices (they
26 -- were created optimistically on next run).
27 CREATE TABLE icon_mapping(id INTEGER PRIMARY KEY,page_url LONGVARCHAR NOT NULL,icon_id INTEGER);
28 CREATE INDEX icon_mapping_icon_id_idx ON icon_mapping(icon_id);
29 CREATE INDEX icon_mapping_page_url_idx ON icon_mapping(page_url);
31 -- [favicon_bitmaps] is a v6 table. Some diagnostic results did not
32 -- contain this table.
33 CREATE TABLE favicon_bitmaps(id INTEGER PRIMARY KEY,icon_id INTEGER NOT NULL,last_updated INTEGER DEFAULT 0,image_data BLOB,width INTEGER DEFAULT 0,height INTEGER DEFAULT 0);
34 CREATE INDEX favicon_bitmaps_icon_id ON favicon_bitmaps(icon_id);