- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / History / thumbnail_wild / Favicons.v6.init.sql
1 -- unit_tests --gtest_filter=ThumbnailDatabaseTest.WildSchema
2 --
3 -- Based on version 6 schema found in the wild by error diagnostics.
4 -- The schema failed migrations because of unexpected
5 -- [temp_favicons] table (see http://crbug.com/272519 ).
6 --
7 -- Init() has been modified to drop these tables.
8 -- TODO(shess): Should this case contain data?
9 BEGIN TRANSACTION;
10
11 -- [meta] is expected.
12 CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY,value LONGVARCHAR);
13 INSERT INTO "meta" VALUES('version','6');
14 INSERT INTO "meta" VALUES('last_compatible_version','6');
15
16 -- This version of [favicons] is consistent with v6.
17 CREATE TABLE "favicons"(id INTEGER PRIMARY KEY,url LONGVARCHAR NOT NULL,icon_type INTEGER DEFAULT 1,sizes LONGVARCHAR);
18 CREATE INDEX favicons_url ON favicons(url);
19
20 -- [icon_mapping] consistent with v6.
21 CREATE TABLE icon_mapping(id INTEGER PRIMARY KEY,page_url LONGVARCHAR NOT NULL,icon_id INTEGER);
22 CREATE INDEX icon_mapping_icon_id_idx ON icon_mapping(icon_id);
23 CREATE INDEX icon_mapping_page_url_idx ON icon_mapping(page_url);
24
25 -- [favicon_bitmaps] consistent with v6.
26 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);
27 CREATE INDEX favicon_bitmaps_icon_id ON favicon_bitmaps(icon_id);
28
29 -- Presence of these tables is consistent with an aborted attempt to
30 -- clear history.  Prior to r217993, that code was not contained in a
31 -- transaction (or possibly there was a non-atomic update).
32 CREATE TABLE temp_favicons(id INTEGER PRIMARY KEY,url LONGVARCHAR NOT NULL,icon_type INTEGER DEFAULT 1,sizes LONGVARCHAR);
33 CREATE TABLE temp_icon_mapping(id INTEGER PRIMARY KEY,page_url LONGVARCHAR NOT NULL,icon_id INTEGER);
34 CREATE TABLE temp_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);
35
36 COMMIT;