diff --git a/acrate-core/migrations/2024-11-14-031744_meta/down.sql b/acrate-core/migrations/2024-11-14-031744_meta/down.sql index af9bea0..93c97ae 100644 --- a/acrate-core/migrations/2024-11-14-031744_meta/down.sql +++ b/acrate-core/migrations/2024-11-14-031744_meta/down.sql @@ -1,8 +1,8 @@ -DROP FUNCTION get_meta_property; -DROP FUNCTION get_meta_link; +DROP FUNCTION get_meta_properties; +DROP FUNCTION get_meta_links; DROP FUNCTION get_meta_aliases; -DROP TABLE meta_property; -DROP TABLE meta_link_property; -DROP TABLE meta_link; -DROP TABLE meta_alias; +DROP TABLE meta_properties; +DROP TABLE meta_link_properties; +DROP TABLE meta_links; +DROP TABLE meta_aliases; diff --git a/acrate-core/migrations/2024-11-14-031744_meta/up.sql b/acrate-core/migrations/2024-11-14-031744_meta/up.sql index 664d409..cb663db 100644 --- a/acrate-core/migrations/2024-11-14-031744_meta/up.sql +++ b/acrate-core/migrations/2024-11-14-031744_meta/up.sql @@ -1,4 +1,4 @@ -CREATE TABLE meta_alias ( +CREATE TABLE meta_aliases ( id UUID DEFAULT gen_random_uuid(), pattern BPCHAR NOT NULL, alias BPCHAR NOT NULL, @@ -7,7 +7,7 @@ CREATE TABLE meta_alias ( PRIMARY KEY (id) ); -CREATE TABLE meta_link ( +CREATE TABLE meta_links ( id UUID DEFAULT gen_random_uuid(), pattern BPCHAR NOT NULL, rel BPCHAR NOT NULL, @@ -17,7 +17,7 @@ CREATE TABLE meta_link ( PRIMARY KEY (id) ); -CREATE TABLE meta_link_property ( +CREATE TABLE meta_link_properties ( id UUID DEFAULT gen_random_uuid(), link UUID REFERENCES meta_link (id), rel BPCHAR NOT NULL, @@ -26,7 +26,7 @@ CREATE TABLE meta_link_property ( PRIMARY KEY (id) ); -CREATE TABLE meta_property ( +CREATE TABLE meta_properties ( id UUID DEFAULT gen_random_uuid(), pattern BPCHAR NOT NULL, value BPCHAR, @@ -35,13 +35,13 @@ CREATE TABLE meta_property ( ); CREATE FUNCTION get_meta_aliases(BPCHAR) RETURNS SETOF meta_alias AS $$ - SELECT * FROM meta_alias WHERE meta_alias.pattern ILIKE $1; + SELECT * FROM meta_aliases WHERE meta_aliases.pattern ILIKE $1; $$ LANGUAGE SQL; -CREATE FUNCTION get_meta_link(BPCHAR) RETURNS SETOF meta_link AS $$ - SELECT * FROM meta_link WHERE meta_link.pattern ILIKE $1; +CREATE FUNCTION get_meta_links(BPCHAR) RETURNS SETOF meta_link AS $$ + SELECT * FROM meta_links WHERE meta_links.pattern ILIKE $1; $$ LANGUAGE SQL; CREATE FUNCTION get_meta_property(BPCHAR) RETURNS SETOF meta_property AS $$ - SELECT * FROM meta_property WHERE meta_property.pattern ILIKE $1; + SELECT * FROM meta_properties WHERE meta_properties.pattern ILIKE $1; $$ LANGUAGE SQL;