CREATE TABLE  IF NOT EXISTS results (
  url TEXT NOT NULL UNIQUE ON CONFLICT REPLACE,
  content TEXT NOT NULL,
  time TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_scrape_results__url ON results(url);
CREATE INDEX IF NOT EXISTS idx_scrape_results__time ON results(time);


CREATE TABLE  IF NOT EXISTS errors (
  url TEXT NOT NULL UNIQUE ON CONFLICT REPLACE,
  msg TEXT NOT NULL,
  time TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_errors__url ON errors(url);
CREATE INDEX IF NOT EXISTS idx_errors__time ON errors(time);


CREATE TABLE  IF NOT EXISTS links (
  url TEXT NOT NULL UNIQUE ON CONFLICT REPLACE,
  time TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX IF NOT EXISTS idx_links__url ON links(url);
