2024-11-15 19:48:51 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS meta_aliases (
|
2024-11-14 05:23:38 +00:00
|
|
|
id UUID DEFAULT gen_random_uuid(),
|
2024-11-15 04:19:50 +00:00
|
|
|
document BPCHAR NOT NULL,
|
2024-11-14 05:23:38 +00:00
|
|
|
pattern BPCHAR NOT NULL,
|
|
|
|
alias BPCHAR NOT NULL,
|
|
|
|
|
|
|
|
PRIMARY KEY (id)
|
|
|
|
);
|
|
|
|
|
2024-11-15 19:48:51 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS meta_links (
|
2024-11-14 05:23:38 +00:00
|
|
|
id UUID DEFAULT gen_random_uuid(),
|
2024-11-15 04:19:50 +00:00
|
|
|
document BPCHAR NOT NULL,
|
2024-11-14 05:23:38 +00:00
|
|
|
pattern BPCHAR NOT NULL,
|
|
|
|
rel BPCHAR NOT NULL,
|
|
|
|
type BPCHAR,
|
|
|
|
href BPCHAR,
|
2024-11-15 19:43:41 +00:00
|
|
|
template BPCHAR,
|
2024-11-14 05:23:38 +00:00
|
|
|
|
2024-11-15 19:43:41 +00:00
|
|
|
CONSTRAINT either_href_or_template_not_null CHECK (
|
|
|
|
(href IS NOT NULL AND template IS NULL)
|
|
|
|
OR
|
|
|
|
(href IS NULL AND template IS NOT NULL)
|
|
|
|
),
|
2024-11-14 05:23:38 +00:00
|
|
|
PRIMARY KEY (id)
|
|
|
|
);
|
|
|
|
|
2024-11-15 19:48:51 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS meta_link_properties (
|
2024-11-14 05:23:38 +00:00
|
|
|
id UUID DEFAULT gen_random_uuid(),
|
2024-11-15 01:14:04 +00:00
|
|
|
meta_link_id UUID REFERENCES meta_links (id) NOT NULL,
|
2024-11-14 05:23:38 +00:00
|
|
|
rel BPCHAR NOT NULL,
|
|
|
|
value BPCHAR,
|
|
|
|
|
|
|
|
PRIMARY KEY (id)
|
|
|
|
);
|
|
|
|
|
2024-11-15 19:48:51 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS meta_properties (
|
2024-11-14 05:23:38 +00:00
|
|
|
id UUID DEFAULT gen_random_uuid(),
|
2024-11-15 04:19:50 +00:00
|
|
|
document BPCHAR NOT NULL,
|
2024-11-14 05:23:38 +00:00
|
|
|
pattern BPCHAR NOT NULL,
|
2024-11-15 05:30:42 +00:00
|
|
|
rel BPCHAR NOT NULL,
|
2024-11-14 05:23:38 +00:00
|
|
|
value BPCHAR,
|
|
|
|
|
|
|
|
PRIMARY KEY (id)
|
|
|
|
);
|
2024-11-15 19:43:41 +00:00
|
|
|
|
2024-11-15 19:48:51 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS meta_link_titles (
|
2024-11-15 19:43:41 +00:00
|
|
|
id UUID DEFAULT gen_random_uuid(),
|
|
|
|
meta_link_id UUID REFERENCES meta_links (id) NOT NULL,
|
2024-11-15 19:48:51 +00:00
|
|
|
language BPCHAR NOT NULL DEFAULT 'und',
|
2024-11-15 19:43:41 +00:00
|
|
|
value BPCHAR NOT NULL,
|
|
|
|
|
2024-11-15 19:48:51 +00:00
|
|
|
CONSTRAINT unique_languages UNIQUE (meta_link_id, language),
|
2024-11-15 19:43:41 +00:00
|
|
|
PRIMARY KEY(id)
|
|
|
|
);
|