1 PRAGMA foreign_keys=OFF;
3 CREATE TABLE meta(key LONGVARCHAR NOT NULL UNIQUE PRIMARY KEY, value LONGVARCHAR);
4 INSERT INTO "meta" VALUES('version','4');
5 INSERT INTO "meta" VALUES('last_compatible_version','2');
6 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);
7 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,visit_duration INTEGER DEFAULT 0 NOT NULL);
8 CREATE TABLE visit_source(id INTEGER PRIMARY KEY,source INTEGER NOT NULL);
9 CREATE TABLE keyword_search_terms (keyword_id INTEGER NOT NULL,url_id INTEGER NOT NULL,lower_term LONGVARCHAR NOT NULL,term LONGVARCHAR NOT NULL);
10 CREATE INDEX visits_url_index ON visits (url);
11 CREATE INDEX visits_from_index ON visits (from_visit);
12 CREATE INDEX visits_time_index ON visits (visit_time);
13 CREATE INDEX urls_url_index ON urls (url);
14 CREATE INDEX keyword_search_terms_index1 ON keyword_search_terms (keyword_id, lower_term);
15 CREATE INDEX keyword_search_terms_index2 ON keyword_search_terms (url_id);
16 CREATE INDEX keyword_search_terms_index3 ON keyword_search_terms (term);