searchhut/schema.sql
2022-07-08 19:46:11 +02:00

25 lines
641 B
SQL

CREATE TABLE domain (
id integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
hostname text NOT NULL,
authoritative boolean NOT NULL,
tags text[] NOT NULL
);
CREATE TABLE page (
id integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
domain_id integer NOT NULL REFERENCES domain(id),
url text NOT NULL UNIQUE,
weight integer NOT NULL,
checksum bytea NOT NULL,
last_index_date timestamptz NOT NULL,
crawl_priority integer NOT NULL,
crawl_delay interval,
fts_vector tsvector NOT NULL,
title text,
language text,
description text,
author text,
excerpt text
);
CREATE INDEX idx_page_content ON page USING GIN (fts_vector);