26 lines
641 B
MySQL
26 lines
641 B
MySQL
|
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);
|