searchhut/schema.sql

31 lines
816 B
MySQL
Raw Permalink Normal View History

2022-07-08 19:46:11 +02:00
CREATE TABLE domain (
id integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
hostname text NOT NULL UNIQUE,
2022-07-08 19:46:11 +02:00
authoritative boolean NOT NULL,
2022-07-13 10:20:27 +02:00
tags text[] NOT NULL DEFAULT '{}',
exclusion_patterns text[] NOT NULL DEFAULT '{}',
last_index_date timestamptz,
crawl_duration interval
2022-07-08 19:46:11 +02:00
);
CREATE TABLE page (
id integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
domain_id integer NOT NULL REFERENCES domain(id),
2022-07-10 10:13:11 +02:00
source varchar NOT NULL,
2022-07-08 19:46:11 +02:00
url text NOT NULL UNIQUE,
page_size integer NOT NULL,
checksum bytea NOT NULL UNIQUE,
2022-07-08 19:46:11 +02:00
last_index_date timestamptz NOT NULL,
fts_vector tsvector NOT NULL,
javascript boolean NOT NULL,
2022-07-08 19:46:11 +02:00
title text,
language text,
description text,
author text,
excerpt text
2022-07-08 19:46:11 +02:00
);
CREATE EXTENSION rum;
CREATE INDEX idx_page_content ON page USING RUM (fts_vector rum_tsvector_ops);