webhistory_10.3.3.sql 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. CREATE TABLE history_items (
  2. id INTEGER PRIMARY KEY AUTOINCREMENT,
  3. url TEXT NOT NULL UNIQUE,
  4. domain_expansion TEXT NULL,
  5. visit_count INTEGER NOT NULL,
  6. daily_visit_counts BLOB NOT NULL,
  7. weekly_visit_counts BLOB NULL,
  8. autocomplete_triggers BLOB NULL,
  9. should_recompute_derived_visit_counts INTEGER NOT NULL,
  10. visit_count_score INTEGER NOT NULL);
  11. CREATE TABLE sqlite_sequence(name, seq);
  12. CREATE TABLE history_visits (
  13. id INTEGER PRIMARY KEY AUTOINCREMENT,
  14. history_item INTEGER NOT NULL REFERENCES history_items(id) ON DELETE CASCADE,
  15. visit_time REAL NOT NULL,
  16. title TEXT NULL,
  17. load_successful BOOLEAN NOT NULL DEFAULT 1,
  18. http_non_get BOOLEAN NOT NULL DEFAULT 0,
  19. synthesized BOOLEAN NOT NULL DEFAULT 0,
  20. redirect_source INTEGER NULL UNIQUE REFERENCES history_visits(id) ON DELETE CASCADE,
  21. redirect_destination INTEGER NULL UNIQUE REFERENCES history_visits(id) ON DELETE CASCADE,
  22. origin INTEGER NOT NULL DEFAULT 0,
  23. generation INTEGER NOT NULL DEFAULT 0,
  24. attributes INTEGER NOT NULL DEFAULT 0,
  25. score INTEGER NOT NULL DEFAULT 0);
  26. CREATE TABLE history_tombstones (
  27. id INTEGER PRIMARY KEY AUTOINCREMENT,
  28. start_time REAL NOT NULL,
  29. end_time REAL NOT NULL,
  30. url TEXT,
  31. generation INTEGER NOT NULL DEFAULT 0);
  32. CREATE TABLE metadata (key TEXT NOT NULL UNIQUE,
  33. value);
  34. CREATE TABLE history_client_versions (client_version INTEGER PRIMARY KEY,
  35. last_seen REAL NOT NULL);
  36. CREATE INDEX history_items__domain_expansion ON history_items (domain_expansion);
  37. CREATE INDEX history_visits__last_visit ON history_visits (history_item, visit_time DESC, synthesized ASC);
  38. CREATE INDEX history_visits__origin ON history_visits (origin, generation);
  39. CREATE INDEX history_tombstones__generation ON history_tombstones (generation);
  40. CREATE INDEX history_tombstones__end_time ON history_tombstones (end_time);