webhistory_9.3.5.sql 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  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. CREATE TABLE sqlite_sequence(name, seq);
  11. CREATE TABLE history_visits (
  12. id INTEGER PRIMARY KEY AUTOINCREMENT,
  13. history_item INTEGER NOT NULL REFERENCES history_items(id) ON DELETE CASCADE,
  14. visit_time REAL NOT NULL,
  15. title TEXT NULL,
  16. load_successful BOOLEAN NOT NULL DEFAULT 1,
  17. http_non_get BOOLEAN NOT NULL DEFAULT 0,
  18. synthesized BOOLEAN NOT NULL DEFAULT 0,
  19. redirect_source INTEGER NULL UNIQUE REFERENCES history_visits(id) ON DELETE CASCADE,
  20. redirect_destination INTEGER NULL UNIQUE REFERENCES history_visits(id) ON DELETE CASCADE,
  21. origin INTEGER NOT NULL DEFAULT 0,
  22. generation INTEGER NOT NULL DEFAULT 0);
  23. CREATE TABLE history_tombstones (
  24. id INTEGER PRIMARY KEY AUTOINCREMENT,
  25. start_time REAL NOT NULL,
  26. end_time REAL NOT NULL,
  27. url TEXT,
  28. generation INTEGER NOT NULL DEFAULT 0);
  29. CREATE TABLE metadata (key TEXT NOT NULL UNIQUE,
  30. value);
  31. CREATE INDEX history_items__domain_expansion ON history_items (domain_expansion);
  32. CREATE INDEX history_visits__last_visit ON history_visits (history_item, visit_time DESC, synthesized ASC);
  33. CREATE INDEX history_visits__origin ON history_visits (origin, generation);
  34. CREATE INDEX history_tombstones__generation ON history_tombstones (generation);
  35. CREATE INDEX history_tombstones__end_time ON history_tombstones (end_time);
  36. CREATE TABLE history_client_versions (client_version INTEGER PRIMARY KEY, last_seen REAL NOT NULL);