1 PRAGMA foreign_keys=OFF;
3 CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR);
4 INSERT INTO "meta" VALUES('last_compatible_version','16');
5 INSERT INTO "meta" VALUES('version','22');
6 INSERT INTO "meta" VALUES('next_download_id','2');
7 INSERT INTO "meta" VALUES('early_expiration_threshold','12995946566765618');
8 CREATE TABLE urls(id INTEGER PRIMARY KEY,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,favicon_id INTEGER DEFAULT 0 NOT NULL);
9 CREATE TABLE visits(id INTEGER PRIMARY KEY,url INTEGER NOT NULL,visit_time INTEGER NOT NULL,from_visit INTEGER,transition INTEGER DEFAULT 0 NOT NULL,segment_id INTEGER,is_indexed BOOLEAN,visit_duration INTEGER DEFAULT 0 NOT NULL);
10 CREATE TABLE visit_source(id INTEGER PRIMARY KEY,source INTEGER NOT NULL);
11 CREATE TABLE keyword_search_terms (keyword_id INTEGER NOT NULL,url_id INTEGER NOT NULL,lower_term LONGVARCHAR NOT NULL,term LONGVARCHAR NOT NULL);
12 CREATE TABLE downloads (id INTEGER PRIMARY KEY,full_path LONGVARCHAR NOT NULL,url LONGVARCHAR NOT NULL,start_time INTEGER NOT NULL,received_bytes INTEGER NOT NULL,total_bytes INTEGER NOT NULL,state INTEGER NOT NULL,end_time INTEGER NOT NULL,opened INTEGER NOT NULL);
13 CREATE TABLE segments (id INTEGER PRIMARY KEY,name VARCHAR,url_id INTEGER NON NULL,pres_index INTEGER DEFAULT -1 NOT NULL);
14 CREATE TABLE segment_usage (id INTEGER PRIMARY KEY,segment_id INTEGER NOT NULL,time_slot INTEGER NOT NULL,visit_count INTEGER DEFAULT 0 NOT NULL);
15 CREATE TABLE presentation(url_id INTEGER PRIMARY KEY,pres_index INTEGER NOT NULL);
16 CREATE INDEX visits_url_index ON visits (url);
17 CREATE INDEX visits_from_index ON visits (from_visit);
18 CREATE INDEX visits_time_index ON visits (visit_time);
19 CREATE INDEX segments_name ON segments(name);
20 CREATE INDEX segments_url_id ON segments(url_id);
21 CREATE INDEX segment_usage_time_slot_segment_id ON segment_usage(time_slot, segment_id);
22 CREATE INDEX segments_usage_seg_id ON segment_usage(segment_id);
23 CREATE INDEX urls_url_index ON urls (url);
24 CREATE INDEX keyword_search_terms_index1 ON keyword_search_terms (keyword_id, lower_term);
25 CREATE INDEX keyword_search_terms_index2 ON keyword_search_terms (url_id);
26 CREATE INDEX keyword_search_terms_index3 ON keyword_search_terms (term);