2024-11-15 01:04:15 +00:00
|
|
|
CREATE TABLE meta_aliases (
|
2024-11-14 05:23:38 +00:00
|
|
|
id UUID DEFAULT gen_random_uuid(),
|
|
|
|
pattern BPCHAR NOT NULL,
|
|
|
|
alias BPCHAR NOT NULL,
|
|
|
|
|
|
|
|
CONSTRAINT unique_aliases UNIQUE (alias),
|
|
|
|
PRIMARY KEY (id)
|
|
|
|
);
|
|
|
|
|
2024-11-15 01:04:15 +00:00
|
|
|
CREATE TABLE meta_links (
|
2024-11-14 05:23:38 +00:00
|
|
|
id UUID DEFAULT gen_random_uuid(),
|
|
|
|
pattern BPCHAR NOT NULL,
|
|
|
|
rel BPCHAR NOT NULL,
|
|
|
|
type BPCHAR,
|
|
|
|
href BPCHAR,
|
|
|
|
|
|
|
|
PRIMARY KEY (id)
|
|
|
|
);
|
|
|
|
|
2024-11-15 01:04:15 +00:00
|
|
|
CREATE TABLE meta_link_properties (
|
2024-11-14 05:23:38 +00:00
|
|
|
id UUID DEFAULT gen_random_uuid(),
|
2024-11-15 01:12:26 +00:00
|
|
|
link 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 01:04:15 +00:00
|
|
|
CREATE TABLE meta_properties (
|
2024-11-14 05:23:38 +00:00
|
|
|
id UUID DEFAULT gen_random_uuid(),
|
|
|
|
pattern BPCHAR NOT NULL,
|
|
|
|
value BPCHAR,
|
|
|
|
|
|
|
|
PRIMARY KEY (id)
|
|
|
|
);
|
|
|
|
|
2024-11-15 01:05:49 +00:00
|
|
|
CREATE FUNCTION get_meta_aliases(BPCHAR) RETURNS SETOF meta_aliases AS $$
|
2024-11-15 01:04:15 +00:00
|
|
|
SELECT * FROM meta_aliases WHERE meta_aliases.pattern ILIKE $1;
|
2024-11-14 05:23:38 +00:00
|
|
|
$$ LANGUAGE SQL;
|
|
|
|
|
2024-11-15 01:05:49 +00:00
|
|
|
CREATE FUNCTION get_meta_links(BPCHAR) RETURNS SETOF meta_links AS $$
|
2024-11-15 01:04:15 +00:00
|
|
|
SELECT * FROM meta_links WHERE meta_links.pattern ILIKE $1;
|
2024-11-14 05:23:38 +00:00
|
|
|
$$ LANGUAGE SQL;
|
|
|
|
|
2024-11-15 01:05:49 +00:00
|
|
|
CREATE FUNCTION get_meta_properties(BPCHAR) RETURNS SETOF meta_properties AS $$
|
2024-11-15 01:04:15 +00:00
|
|
|
SELECT * FROM meta_properties WHERE meta_properties.pattern ILIKE $1;
|
2024-11-14 05:23:38 +00:00
|
|
|
$$ LANGUAGE SQL;
|