- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / History / thumbnail_wild / Favicons.v4.init.sql
1 -- unit_tests --gtest_filter=ThumbnailDatabaseTest.WildSchema
2 --
3 -- Based on version 3 and 4 schema found in the wild by error
4 -- diagnostics.  Combined because they were the same except for
5 -- version.  The schema was failing to migrate because the migration
6 -- code encountered a table which appeared to already be migrated.
7 --
8 -- Should be razed by the deprecation code.
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','4');
14 INSERT INTO "meta" VALUES('last_compatible_version','4');
15
16 -- This version of [favicons] implies v6 code.  Other versions are
17 -- missing [size], implying v7.  Either way, since v4 had the table,
18 -- migration must have run, but the atomic update of version somehow
19 -- failed.
20 CREATE TABLE "favicons"(id INTEGER PRIMARY KEY,url LONGVARCHAR NOT NULL,icon_type INTEGER DEFAULT 1,sizes LONGVARCHAR);
21 CREATE INDEX favicons_url ON favicons(url);
22
23 -- [icon_mapping] is a v4 table.
24 CREATE TABLE icon_mapping(id INTEGER PRIMARY KEY,page_url LONGVARCHAR NOT NULL,icon_id INTEGER);
25 CREATE INDEX icon_mapping_icon_id_idx ON icon_mapping(icon_id);
26 CREATE INDEX icon_mapping_page_url_idx ON icon_mapping(page_url);
27
28 -- [favicon_bitmaps] is a v6 table.
29 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);
30 CREATE INDEX favicon_bitmaps_icon_id ON favicon_bitmaps(icon_id);
31
32 COMMIT;