- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / test / data / History / thumbnail_wild / Favicons.v2.init.sql
1 -- unit_tests --gtest_filter=ThumbnailDatabaseTest.WildSchema
2 --
3 -- Based on version 2 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 ).
8 --
9 -- Should be razed by the deprecation code.
10 BEGIN TRANSACTION;
11
12 -- [meta] and [thumbnails] are expected tables.
13 CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR);
14 INSERT INTO "meta" VALUES('version','2');
15 INSERT INTO "meta" VALUES('last_compatible_version','2');
16 CREATE TABLE thumbnails (url LONGVARCHAR PRIMARY KEY,url_rank INTEGER ,title LONGVARCHAR,thumbnail BLOB,redirects LONGVARCHAR,boring_score DOUBLE DEFAULT 1.0, good_clipping INTEGER DEFAULT 0, at_top INTEGER DEFAULT 0, last_updated INTEGER DEFAULT 0, load_completed INTEGER DEFAULT 0);
17
18 -- Tables optimistically created by Init().
19 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);
20 CREATE TABLE favicons(id INTEGER PRIMARY KEY,url LONGVARCHAR NOT NULL,icon_type INTEGER DEFAULT 1);
21 CREATE TABLE icon_mapping(id INTEGER PRIMARY KEY,page_url LONGVARCHAR NOT NULL,icon_id INTEGER);
22 CREATE INDEX favicon_bitmaps_icon_id ON favicon_bitmaps(icon_id);
23 CREATE INDEX favicons_url ON favicons(url);
24 CREATE INDEX icon_mapping_icon_id_idx ON icon_mapping(icon_id);
25 CREATE INDEX icon_mapping_page_url_idx ON icon_mapping(page_url);
26
27 COMMIT;