From 18bf117db729f22379dee60405814d4505ac1148 Mon Sep 17 00:00:00 2001 From: Sven Thelemann Date: Thu, 30 Jan 2025 18:24:16 +0100 Subject: [PATCH 1/5] feat(Invitation): track invitation activities A new table `invitation`and a new enumeration type `invitation_action`have been added. --- src/deploy/enum_invitation_action.sql | 12 +++ src/deploy/table_invitation.sql | 18 ++++ src/deploy/table_invitation_policy.sql | 27 ++++++ src/revert/enum_invitation_action.sql | 5 + src/revert/table_invitation.sql | 5 + src/revert/table_invitation_policy.sql | 6 ++ src/sqitch.plan | 3 + src/verify/enum_invitation_action.sql | 8 ++ src/verify/table_invitation.sql | 8 ++ src/verify/table_invitation_policy.sql | 19 ++++ test/schema/schema.definition.sql | 127 +++++++++++++++++++++++++ 11 files changed, 238 insertions(+) create mode 100644 src/deploy/enum_invitation_action.sql create mode 100644 src/deploy/table_invitation.sql create mode 100644 src/deploy/table_invitation_policy.sql create mode 100644 src/revert/enum_invitation_action.sql create mode 100644 src/revert/table_invitation.sql create mode 100644 src/revert/table_invitation_policy.sql create mode 100644 src/verify/enum_invitation_action.sql create mode 100644 src/verify/table_invitation.sql create mode 100644 src/verify/table_invitation_policy.sql diff --git a/src/deploy/enum_invitation_action.sql b/src/deploy/enum_invitation_action.sql new file mode 100644 index 00000000..cc50076e --- /dev/null +++ b/src/deploy/enum_invitation_action.sql @@ -0,0 +1,12 @@ +BEGIN; + +CREATE TYPE maevsi.invitation_action AS ENUM ( + 'send', -- invitation is sent by email + 'bounce' -- invitation email bounced back + 'accept', -- invitation accepted + 'reject' -- invitation rejected +); + +COMMENT ON TYPE maevsi.invitation_action IS 'Possible actions around invitations.'; + +COMMIT; diff --git a/src/deploy/table_invitation.sql b/src/deploy/table_invitation.sql new file mode 100644 index 00000000..b9121770 --- /dev/null +++ b/src/deploy/table_invitation.sql @@ -0,0 +1,18 @@ +BEGIN; + +CREATE TABLE maevsi.invitation( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + guest_id UUID NOT NULL REFERENCES maevsi.guest(id), + action maevsi.invitation_action NOT NULL, + created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, + + UNIQUE(guest_id, created_at , action) +); + +COMMENT ON TABLE maevsi.invitation IS '@omit update,delete\nThe table tracks actions around invitations.'; +COMMENT ON COLUMN maevsi.invitation.id IS E'@omit create\nThe tracking record''s internal id.'; +COMMENT ON COLUMN maevsi.invitation.action IS 'The action'; +COMMENT ON COLUMN maevsi.invitation.guest_id IS 'The guest information (containing event and contact).'; +COMMENT ON COLUMN maevsi.invitation.created_at IS '@omit create\nThe timestamp when the action was executed'; + +COMMIT; diff --git a/src/deploy/table_invitation_policy.sql b/src/deploy/table_invitation_policy.sql new file mode 100644 index 00000000..2e5c1a98 --- /dev/null +++ b/src/deploy/table_invitation_policy.sql @@ -0,0 +1,27 @@ +BEGIN; + +GRANT SELECT, INSERT ON maevsi.invitation TO maevsi_account; + +ALTER TABLE maevsi.invitation ENABLE ROW LEVEL SECURITY; + +CREATE POLICY invitation_select ON maevsi.invitation FOR SELECT USING ( + + maevsi.invoker_account_id() = ( + SELECT e.created_by + FROM maevsi.guest g + JOIN maevsi.event e ON g.event_id = e.id + WHERE g.id = guest_id + ) +); + +CREATE POLICY invitation_insert ON maevsi.invitation FOR INSERT WITH CHECK ( + + maevsi.invoker_account_id() = ( + SELECT e.created_by + FROM maevsi.guest g + JOIN maevsi.event e ON g.event_id = e.id + WHERE g.id = guest_id + ) +); + +COMMIT; diff --git a/src/revert/enum_invitation_action.sql b/src/revert/enum_invitation_action.sql new file mode 100644 index 00000000..85a42ebe --- /dev/null +++ b/src/revert/enum_invitation_action.sql @@ -0,0 +1,5 @@ +BEGIN; + +DROP TYPE maevsi.invitation_action; + +COMMIT; diff --git a/src/revert/table_invitation.sql b/src/revert/table_invitation.sql new file mode 100644 index 00000000..82cd0bee --- /dev/null +++ b/src/revert/table_invitation.sql @@ -0,0 +1,5 @@ +BEGIN; + +DROP TABLE maevsi.invitation; + +COMMIT; diff --git a/src/revert/table_invitation_policy.sql b/src/revert/table_invitation_policy.sql new file mode 100644 index 00000000..8b6e9c3d --- /dev/null +++ b/src/revert/table_invitation_policy.sql @@ -0,0 +1,6 @@ +BEGIN; + +DROP POLICY invitation_select ON maevsi.invitation; +DROP POLICY invitation_insert ON maevsi.invitation; + +COMMIT; diff --git a/src/sqitch.plan b/src/sqitch.plan index a0065364..1c23e40d 100644 --- a/src/sqitch.plan +++ b/src/sqitch.plan @@ -101,4 +101,7 @@ test_account_blocking [schema_test] 1970-01-01T00:00:00Z Sven Thelemann # Full-text search on events. index_account_private_location [schema_private table_account_private] 1970-01-01T00:00:00Z Sven Thelemann # Spacial index on location column in table maevsi_private.account. index_event_location [schema_public table_event] 1970-01-01T00:00:00Z Sven Thelemann # Spacial index on location_geography column in table maevsi.event. +enum_invitation_action [schema_public] 1970-01-01T00:00:00Z Sven Thelemann # Possible actions around invitations. +table_invitation [schema_public enum_invitation_action table_guest] 1970-01-01T00:00:00Z Sven Thelemann # A table for tracking actions around invitations. +table_invitation_policy [schema_public function_invoker_account_id table_invitation table_guest table_event role_account] 1970-01-01T00:00:00Z Sven Thelemann # Policy for table invitation. test_location [schema_public schema_private extension_postgis table_account_private table_event role_anonymous role_account] 1970-01-01T00:00:00Z Sven Thelemann # A collection of location related functions. diff --git a/src/verify/enum_invitation_action.sql b/src/verify/enum_invitation_action.sql new file mode 100644 index 00000000..1669b318 --- /dev/null +++ b/src/verify/enum_invitation_action.sql @@ -0,0 +1,8 @@ +BEGIN; + +DO $$ +BEGIN + ASSERT (SELECT pg_catalog.has_type_privilege('maevsi.invitation_action', 'USAGE')); +END $$; + +ROLLBACK; diff --git a/src/verify/table_invitation.sql b/src/verify/table_invitation.sql new file mode 100644 index 00000000..d47a1849 --- /dev/null +++ b/src/verify/table_invitation.sql @@ -0,0 +1,8 @@ +BEGIN; + +DO $$ +BEGIN + +END $$; + +ROLLBACK; diff --git a/src/verify/table_invitation_policy.sql b/src/verify/table_invitation_policy.sql new file mode 100644 index 00000000..8a4dc045 --- /dev/null +++ b/src/verify/table_invitation_policy.sql @@ -0,0 +1,19 @@ +BEGIN; + +DO $$ +BEGIN + ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.invitation', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.invitation', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.invitation', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.invitation', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.invitation', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.invitation', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.invitation', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.invitation', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.invitation', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.invitation', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.invitation', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.invitation', 'DELETE')); +END $$; + +ROLLBACK; diff --git a/test/schema/schema.definition.sql b/test/schema/schema.definition.sql index daa75854..90eddf6f 100644 --- a/test/schema/schema.definition.sql +++ b/test/schema/schema.definition.sql @@ -196,6 +196,26 @@ ALTER TYPE maevsi.event_visibility OWNER TO postgres; COMMENT ON TYPE maevsi.event_visibility IS 'Possible visibilities of events and event groups: public, private and unlisted.'; +-- +-- Name: invitation_action; Type: TYPE; Schema: maevsi; Owner: postgres +-- + +CREATE TYPE maevsi.invitation_action AS ENUM ( + 'send', + 'bounceaccept', + 'reject' +); + + +ALTER TYPE maevsi.invitation_action OWNER TO postgres; + +-- +-- Name: TYPE invitation_action; Type: COMMENT; Schema: maevsi; Owner: postgres +-- + +COMMENT ON TYPE maevsi.invitation_action IS 'Possible actions around invitations.'; + + -- -- Name: invitation_feedback; Type: TYPE; Schema: maevsi; Owner: postgres -- @@ -3541,6 +3561,56 @@ ALTER VIEW maevsi.guest_flat OWNER TO postgres; COMMENT ON VIEW maevsi.guest_flat IS 'View returning flattened guests.'; +-- +-- Name: invitation; Type: TABLE; Schema: maevsi; Owner: postgres +-- + +CREATE TABLE maevsi.invitation ( + id uuid DEFAULT gen_random_uuid() NOT NULL, + guest_id uuid NOT NULL, + action maevsi.invitation_action NOT NULL, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL +); + + +ALTER TABLE maevsi.invitation OWNER TO postgres; + +-- +-- Name: TABLE invitation; Type: COMMENT; Schema: maevsi; Owner: postgres +-- + +COMMENT ON TABLE maevsi.invitation IS '@omit update,delete\nThe table tracks actions around invitations.'; + + +-- +-- Name: COLUMN invitation.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- + +COMMENT ON COLUMN maevsi.invitation.id IS '@omit create +The tracking record''s internal id.'; + + +-- +-- Name: COLUMN invitation.guest_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- + +COMMENT ON COLUMN maevsi.invitation.guest_id IS 'The guest information (containing event and contact).'; + + +-- +-- Name: COLUMN invitation.action; Type: COMMENT; Schema: maevsi; Owner: postgres +-- + +COMMENT ON COLUMN maevsi.invitation.action IS 'The action'; + + +-- +-- Name: COLUMN invitation.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- + +COMMENT ON COLUMN maevsi.invitation.created_at IS '@omit create\nThe timestamp when the action was executed'; + + -- -- Name: legal_term; Type: TABLE; Schema: maevsi; Owner: postgres -- @@ -4767,6 +4837,22 @@ ALTER TABLE ONLY maevsi.guest ADD CONSTRAINT guest_pkey PRIMARY KEY (id); +-- +-- Name: invitation invitation_guest_id_created_at_action_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- + +ALTER TABLE ONLY maevsi.invitation + ADD CONSTRAINT invitation_guest_id_created_at_action_key UNIQUE (guest_id, created_at, action); + + +-- +-- Name: invitation invitation_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- + +ALTER TABLE ONLY maevsi.invitation + ADD CONSTRAINT invitation_pkey PRIMARY KEY (id); + + -- -- Name: legal_term_acceptance legal_term_acceptance_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres -- @@ -5381,6 +5467,14 @@ ALTER TABLE ONLY maevsi.guest ADD CONSTRAINT guest_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES maevsi.account(id); +-- +-- Name: invitation invitation_guest_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- + +ALTER TABLE ONLY maevsi.invitation + ADD CONSTRAINT invitation_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES maevsi.guest(id); + + -- -- Name: legal_term_acceptance legal_term_acceptance_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres -- @@ -5923,6 +6017,32 @@ EXCEPT FROM maevsi_private.account_block_ids() account_block_ids(id)))))))))); +-- +-- Name: invitation; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- + +ALTER TABLE maevsi.invitation ENABLE ROW LEVEL SECURITY; + +-- +-- Name: invitation invitation_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- + +CREATE POLICY invitation_insert ON maevsi.invitation FOR INSERT WITH CHECK ((maevsi.invoker_account_id() = ( SELECT e.created_by + FROM (maevsi.guest g + JOIN maevsi.event e ON ((g.event_id = e.id))) + WHERE (g.id = invitation.guest_id)))); + + +-- +-- Name: invitation invitation_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- + +CREATE POLICY invitation_select ON maevsi.invitation FOR SELECT USING ((maevsi.invoker_account_id() = ( SELECT e.created_by + FROM (maevsi.guest g + JOIN maevsi.event e ON ((g.event_id = e.id))) + WHERE (g.id = invitation.guest_id)))); + + -- -- Name: legal_term; Type: ROW SECURITY; Schema: maevsi; Owner: postgres -- @@ -12377,6 +12497,13 @@ GRANT SELECT ON TABLE maevsi.guest_flat TO maevsi_account; GRANT SELECT ON TABLE maevsi.guest_flat TO maevsi_anonymous; +-- +-- Name: TABLE invitation; Type: ACL; Schema: maevsi; Owner: postgres +-- + +GRANT SELECT,INSERT ON TABLE maevsi.invitation TO maevsi_account; + + -- -- Name: TABLE legal_term; Type: ACL; Schema: maevsi; Owner: postgres -- From 9e427fdc7525c5a6356f74c26a9c8986c4f2eb06 Mon Sep 17 00:00:00 2001 From: Jonas Thelemann Date: Mon, 3 Feb 2025 03:57:33 +0100 Subject: [PATCH 2/5] feat(invitation)!: work in feedback --- src/deploy/enum_invitation_action.sql | 12 -- src/deploy/enum_invitation_status.sql | 12 ++ src/deploy/table_invitation.sql | 29 +++-- src/deploy/table_invitation_policy.sql | 4 +- src/revert/enum_invitation_action.sql | 5 - src/revert/enum_invitation_status.sql | 5 + src/revert/table_invitation_policy.sql | 2 +- src/sqitch.plan | 6 +- ..._action.sql => enum_invitation_status.sql} | 2 +- test/schema/schema.definition.sql | 116 +++++++++++++----- 10 files changed, 130 insertions(+), 63 deletions(-) delete mode 100644 src/deploy/enum_invitation_action.sql create mode 100644 src/deploy/enum_invitation_status.sql delete mode 100644 src/revert/enum_invitation_action.sql create mode 100644 src/revert/enum_invitation_status.sql rename src/verify/{enum_invitation_action.sql => enum_invitation_status.sql} (82%) diff --git a/src/deploy/enum_invitation_action.sql b/src/deploy/enum_invitation_action.sql deleted file mode 100644 index cc50076e..00000000 --- a/src/deploy/enum_invitation_action.sql +++ /dev/null @@ -1,12 +0,0 @@ -BEGIN; - -CREATE TYPE maevsi.invitation_action AS ENUM ( - 'send', -- invitation is sent by email - 'bounce' -- invitation email bounced back - 'accept', -- invitation accepted - 'reject' -- invitation rejected -); - -COMMENT ON TYPE maevsi.invitation_action IS 'Possible actions around invitations.'; - -COMMIT; diff --git a/src/deploy/enum_invitation_status.sql b/src/deploy/enum_invitation_status.sql new file mode 100644 index 00000000..c4f7e123 --- /dev/null +++ b/src/deploy/enum_invitation_status.sql @@ -0,0 +1,12 @@ +BEGIN; + +CREATE TYPE maevsi.invitation_status AS ENUM ( + 'accepted', + 'bounced', + 'rejected', + 'sent' +); + +COMMENT ON TYPE maevsi.invitation_status IS 'Represents the status of an invitation.'; + +COMMIT; diff --git a/src/deploy/table_invitation.sql b/src/deploy/table_invitation.sql index b9121770..4de3ce06 100644 --- a/src/deploy/table_invitation.sql +++ b/src/deploy/table_invitation.sql @@ -2,17 +2,32 @@ BEGIN; CREATE TABLE maevsi.invitation( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + guest_id UUID NOT NULL REFERENCES maevsi.guest(id), - action maevsi.invitation_action NOT NULL, + status maevsi.invitation_status NOT NULL, + created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, + created_by UUID NOT NULL REFERENCES maevsi.account(id), + updated_at TIMESTAMP WITH TIME ZONE, + updated_by UUID REFERENCES maevsi.account(id) NOT NULL, - UNIQUE(guest_id, created_at , action) + UNIQUE(guest_id, status, created_at) ); -COMMENT ON TABLE maevsi.invitation IS '@omit update,delete\nThe table tracks actions around invitations.'; -COMMENT ON COLUMN maevsi.invitation.id IS E'@omit create\nThe tracking record''s internal id.'; -COMMENT ON COLUMN maevsi.invitation.action IS 'The action'; -COMMENT ON COLUMN maevsi.invitation.guest_id IS 'The guest information (containing event and contact).'; -COMMENT ON COLUMN maevsi.invitation.created_at IS '@omit create\nThe timestamp when the action was executed'; +COMMENT ON TABLE maevsi.invitation IS '@omit update,delete\nStores invitations and their statuses.'; +COMMENT ON COLUMN maevsi.invitation.id IS E'@omit create\nThe unique identifier for the invitation.'; +COMMENT ON COLUMN maevsi.invitation.guest_id IS 'The ID of the guest associated with this invitation.'; +COMMENT ON COLUMN maevsi.invitation.status IS 'The current status of the invitation.'; +COMMENT ON COLUMN maevsi.invitation.created_at IS E'@omit create\nTimestamp when the invitation was created. Defaults to the current timestamp.'; +COMMENT ON COLUMN maevsi.invitation.created_by IS E'@omit create\nReference to the account that created the invitation.'; +COMMENT ON COLUMN maevsi.invitation.updated_at IS E'@omit create\nTimestamp when the invitation was last updated.'; +COMMENT ON COLUMN maevsi.invitation.updated_by IS E'@omit create\nReference to the account that last updated the invitation.'; + +CREATE TRIGGER maevsi_trigger_invitation_update + BEFORE + UPDATE + ON maevsi.invitation + FOR EACH ROW + EXECUTE PROCEDURE maevsi.trigger_metadata_update(); COMMIT; diff --git a/src/deploy/table_invitation_policy.sql b/src/deploy/table_invitation_policy.sql index 2e5c1a98..dfba4543 100644 --- a/src/deploy/table_invitation_policy.sql +++ b/src/deploy/table_invitation_policy.sql @@ -5,7 +5,6 @@ GRANT SELECT, INSERT ON maevsi.invitation TO maevsi_account; ALTER TABLE maevsi.invitation ENABLE ROW LEVEL SECURITY; CREATE POLICY invitation_select ON maevsi.invitation FOR SELECT USING ( - maevsi.invoker_account_id() = ( SELECT e.created_by FROM maevsi.guest g @@ -15,7 +14,8 @@ CREATE POLICY invitation_select ON maevsi.invitation FOR SELECT USING ( ); CREATE POLICY invitation_insert ON maevsi.invitation FOR INSERT WITH CHECK ( - + created_by = maevsi.invoker_account_id() + AND maevsi.invoker_account_id() = ( SELECT e.created_by FROM maevsi.guest g diff --git a/src/revert/enum_invitation_action.sql b/src/revert/enum_invitation_action.sql deleted file mode 100644 index 85a42ebe..00000000 --- a/src/revert/enum_invitation_action.sql +++ /dev/null @@ -1,5 +0,0 @@ -BEGIN; - -DROP TYPE maevsi.invitation_action; - -COMMIT; diff --git a/src/revert/enum_invitation_status.sql b/src/revert/enum_invitation_status.sql new file mode 100644 index 00000000..ec243db4 --- /dev/null +++ b/src/revert/enum_invitation_status.sql @@ -0,0 +1,5 @@ +BEGIN; + +DROP TYPE maevsi.invitation_status; + +COMMIT; diff --git a/src/revert/table_invitation_policy.sql b/src/revert/table_invitation_policy.sql index 8b6e9c3d..88309e83 100644 --- a/src/revert/table_invitation_policy.sql +++ b/src/revert/table_invitation_policy.sql @@ -1,6 +1,6 @@ BEGIN; -DROP POLICY invitation_select ON maevsi.invitation; DROP POLICY invitation_insert ON maevsi.invitation; +DROP POLICY invitation_select ON maevsi.invitation; COMMIT; diff --git a/src/sqitch.plan b/src/sqitch.plan index 1c23e40d..f07c5145 100644 --- a/src/sqitch.plan +++ b/src/sqitch.plan @@ -101,7 +101,7 @@ test_account_blocking [schema_test] 1970-01-01T00:00:00Z Sven Thelemann # Full-text search on events. index_account_private_location [schema_private table_account_private] 1970-01-01T00:00:00Z Sven Thelemann # Spacial index on location column in table maevsi_private.account. index_event_location [schema_public table_event] 1970-01-01T00:00:00Z Sven Thelemann # Spacial index on location_geography column in table maevsi.event. -enum_invitation_action [schema_public] 1970-01-01T00:00:00Z Sven Thelemann # Possible actions around invitations. -table_invitation [schema_public enum_invitation_action table_guest] 1970-01-01T00:00:00Z Sven Thelemann # A table for tracking actions around invitations. -table_invitation_policy [schema_public function_invoker_account_id table_invitation table_guest table_event role_account] 1970-01-01T00:00:00Z Sven Thelemann # Policy for table invitation. +enum_invitation_status [schema_public] 1970-01-01T00:00:00Z Sven Thelemann # Represents the status of an invitation. +table_invitation [schema_public table_guest enum_invitation_status table_account_public function_trigger_metadata_update] 1970-01-01T00:00:00Z Sven Thelemann # A table for tracking actions around invitations. +table_invitation_policy [schema_public table_invitation role_account function_invoker_account_id table_guest table_event] 1970-01-01T00:00:00Z Sven Thelemann # Stores invitations and their statuses. test_location [schema_public schema_private extension_postgis table_account_private table_event role_anonymous role_account] 1970-01-01T00:00:00Z Sven Thelemann # A collection of location related functions. diff --git a/src/verify/enum_invitation_action.sql b/src/verify/enum_invitation_status.sql similarity index 82% rename from src/verify/enum_invitation_action.sql rename to src/verify/enum_invitation_status.sql index 1669b318..5dfc5a94 100644 --- a/src/verify/enum_invitation_action.sql +++ b/src/verify/enum_invitation_status.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_type_privilege('maevsi.invitation_action', 'USAGE')); + ASSERT (SELECT pg_catalog.has_type_privilege('maevsi.invitation_status', 'USAGE')); END $$; ROLLBACK; diff --git a/test/schema/schema.definition.sql b/test/schema/schema.definition.sql index 637f7a5a..5a5d9cd6 100644 --- a/test/schema/schema.definition.sql +++ b/test/schema/schema.definition.sql @@ -196,26 +196,6 @@ ALTER TYPE maevsi.event_visibility OWNER TO postgres; COMMENT ON TYPE maevsi.event_visibility IS 'Possible visibilities of events and event groups: public, private and unlisted.'; --- --- Name: invitation_action; Type: TYPE; Schema: maevsi; Owner: postgres --- - -CREATE TYPE maevsi.invitation_action AS ENUM ( - 'send', - 'bounceaccept', - 'reject' -); - - -ALTER TYPE maevsi.invitation_action OWNER TO postgres; - --- --- Name: TYPE invitation_action; Type: COMMENT; Schema: maevsi; Owner: postgres --- - -COMMENT ON TYPE maevsi.invitation_action IS 'Possible actions around invitations.'; - - -- -- Name: invitation_feedback; Type: TYPE; Schema: maevsi; Owner: postgres -- @@ -255,6 +235,27 @@ ALTER TYPE maevsi.invitation_feedback_paper OWNER TO postgres; COMMENT ON TYPE maevsi.invitation_feedback_paper IS 'Possible choices on how to receive a paper invitation: none, paper, digital.'; +-- +-- Name: invitation_status; Type: TYPE; Schema: maevsi; Owner: postgres +-- + +CREATE TYPE maevsi.invitation_status AS ENUM ( + 'accepted', + 'bounced', + 'rejected', + 'sent' +); + + +ALTER TYPE maevsi.invitation_status OWNER TO postgres; + +-- +-- Name: TYPE invitation_status; Type: COMMENT; Schema: maevsi; Owner: postgres +-- + +COMMENT ON TYPE maevsi.invitation_status IS 'Represents the status of an invitation.'; + + -- -- Name: language; Type: TYPE; Schema: maevsi; Owner: postgres -- @@ -3579,8 +3580,11 @@ COMMENT ON VIEW maevsi.guest_flat IS 'View returning flattened guests.'; CREATE TABLE maevsi.invitation ( id uuid DEFAULT gen_random_uuid() NOT NULL, guest_id uuid NOT NULL, - action maevsi.invitation_action NOT NULL, - created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL + status maevsi.invitation_status NOT NULL, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, + created_by uuid NOT NULL, + updated_at timestamp with time zone, + updated_by uuid NOT NULL ); @@ -3590,7 +3594,7 @@ ALTER TABLE maevsi.invitation OWNER TO postgres; -- Name: TABLE invitation; Type: COMMENT; Schema: maevsi; Owner: postgres -- -COMMENT ON TABLE maevsi.invitation IS '@omit update,delete\nThe table tracks actions around invitations.'; +COMMENT ON TABLE maevsi.invitation IS '@omit update,delete\nStores invitations and their statuses.'; -- @@ -3598,28 +3602,53 @@ COMMENT ON TABLE maevsi.invitation IS '@omit update,delete\nThe table tracks act -- COMMENT ON COLUMN maevsi.invitation.id IS '@omit create -The tracking record''s internal id.'; +The unique identifier for the invitation.'; -- -- Name: COLUMN invitation.guest_id; Type: COMMENT; Schema: maevsi; Owner: postgres -- -COMMENT ON COLUMN maevsi.invitation.guest_id IS 'The guest information (containing event and contact).'; +COMMENT ON COLUMN maevsi.invitation.guest_id IS 'The ID of the guest associated with this invitation.'; -- --- Name: COLUMN invitation.action; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN invitation.status; Type: COMMENT; Schema: maevsi; Owner: postgres -- -COMMENT ON COLUMN maevsi.invitation.action IS 'The action'; +COMMENT ON COLUMN maevsi.invitation.status IS 'The current status of the invitation.'; -- -- Name: COLUMN invitation.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres -- -COMMENT ON COLUMN maevsi.invitation.created_at IS '@omit create\nThe timestamp when the action was executed'; +COMMENT ON COLUMN maevsi.invitation.created_at IS '@omit create +Timestamp when the invitation was created. Defaults to the current timestamp.'; + + +-- +-- Name: COLUMN invitation.created_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- + +COMMENT ON COLUMN maevsi.invitation.created_by IS '@omit create +Reference to the account that created the invitation.'; + + +-- +-- Name: COLUMN invitation.updated_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- + +COMMENT ON COLUMN maevsi.invitation.updated_at IS '@omit create +Timestamp when the invitation was last updated.'; + + +-- +-- Name: COLUMN invitation.updated_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- + +COMMENT ON COLUMN maevsi.invitation.updated_by IS '@omit create +Reference to the account that last updated the invitation.'; -- @@ -4849,11 +4878,11 @@ ALTER TABLE ONLY maevsi.guest -- --- Name: invitation invitation_guest_id_created_at_action_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: invitation invitation_guest_id_status_created_at_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres -- ALTER TABLE ONLY maevsi.invitation - ADD CONSTRAINT invitation_guest_id_created_at_action_key UNIQUE (guest_id, created_at, action); + ADD CONSTRAINT invitation_guest_id_status_created_at_key UNIQUE (guest_id, status, created_at); -- @@ -5232,6 +5261,13 @@ CREATE TRIGGER maevsi_trigger_contact_update_account_id BEFORE UPDATE OF account CREATE TRIGGER maevsi_trigger_event_search_vector BEFORE INSERT OR UPDATE OF name, description, language ON maevsi.event FOR EACH ROW EXECUTE FUNCTION maevsi.trigger_event_search_vector(); +-- +-- Name: invitation maevsi_trigger_invitation_update; Type: TRIGGER; Schema: maevsi; Owner: postgres +-- + +CREATE TRIGGER maevsi_trigger_invitation_update BEFORE UPDATE ON maevsi.invitation FOR EACH ROW EXECUTE FUNCTION maevsi.trigger_metadata_update(); + + -- -- Name: account maevsi_private_account_email_address_verification_valid_until; Type: TRIGGER; Schema: maevsi_private; Owner: postgres -- @@ -5478,6 +5514,14 @@ ALTER TABLE ONLY maevsi.guest ADD CONSTRAINT guest_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES maevsi.account(id); +-- +-- Name: invitation invitation_created_by_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- + +ALTER TABLE ONLY maevsi.invitation + ADD CONSTRAINT invitation_created_by_fkey FOREIGN KEY (created_by) REFERENCES maevsi.account(id); + + -- -- Name: invitation invitation_guest_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres -- @@ -5486,6 +5530,14 @@ ALTER TABLE ONLY maevsi.invitation ADD CONSTRAINT invitation_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES maevsi.guest(id); +-- +-- Name: invitation invitation_updated_by_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- + +ALTER TABLE ONLY maevsi.invitation + ADD CONSTRAINT invitation_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES maevsi.account(id); + + -- -- Name: legal_term_acceptance legal_term_acceptance_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres -- @@ -6038,10 +6090,10 @@ ALTER TABLE maevsi.invitation ENABLE ROW LEVEL SECURITY; -- Name: invitation invitation_insert; Type: POLICY; Schema: maevsi; Owner: postgres -- -CREATE POLICY invitation_insert ON maevsi.invitation FOR INSERT WITH CHECK ((maevsi.invoker_account_id() = ( SELECT e.created_by +CREATE POLICY invitation_insert ON maevsi.invitation FOR INSERT WITH CHECK (((created_by = maevsi.invoker_account_id()) AND (maevsi.invoker_account_id() = ( SELECT e.created_by FROM (maevsi.guest g JOIN maevsi.event e ON ((g.event_id = e.id))) - WHERE (g.id = invitation.guest_id)))); + WHERE (g.id = invitation.guest_id))))); -- From 973ae5975b0e84937dcaa2d27f4543f7bd480d66 Mon Sep 17 00:00:00 2001 From: Sven Thelemann Date: Fri, 14 Mar 2025 00:09:46 +0100 Subject: [PATCH 3/5] feat(invitation): redesign table invitation Table `invitation` now inherits from table `notification`which was moved from schema `maevsi_private` to schema `maevsi`. In orrder to make functions originally created in `test_account_blocking.sql` generally available for all tests (including tests for invitations), these functions were moved to `function_test_utilities.sql`. --- src/deploy/enum_invitation_status.sql | 12 - ...unction_account_password_reset_request.sql | 2 +- src/deploy/function_account_registration.sql | 2 +- .../function_account_registration_refresh.sql | 7 +- src/deploy/function_invite.sql | 43 ++- .../function_notification_acknowledge.sql | 13 +- src/deploy/function_test_utilities.sql | 347 ++++++++++++++++++ src/deploy/table_invitation.sql | 31 +- src/deploy/table_invitation_policy.sql | 7 +- src/deploy/table_notification.sql | 14 +- src/deploy/test_account_blocking.sql | 328 +---------------- src/deploy/test_invitation.sql | 5 + src/revert/enum_invitation_status.sql | 5 - src/revert/function_test_utilities.sql | 22 ++ src/revert/table_notification.sql | 2 +- src/revert/test_account_blocking.sql | 17 +- src/revert/test_invitation.sql | 3 + src/sqitch.plan | 9 +- src/verify/enum_invitation_status.sql | 8 - src/verify/function_account_registration.sql | 2 +- src/verify/function_test_utilities.sql | 3 + src/verify/table_notification.sql | 2 +- src/verify/test_invitation.sql | 38 ++ src/verify/test_location.sql | 16 +- test/schema/schema.definition.sql | 337 ++++++++--------- 25 files changed, 650 insertions(+), 625 deletions(-) delete mode 100644 src/deploy/enum_invitation_status.sql create mode 100644 src/deploy/function_test_utilities.sql create mode 100644 src/deploy/test_invitation.sql delete mode 100644 src/revert/enum_invitation_status.sql create mode 100644 src/revert/function_test_utilities.sql create mode 100644 src/revert/test_invitation.sql delete mode 100644 src/verify/enum_invitation_status.sql create mode 100644 src/verify/function_test_utilities.sql create mode 100644 src/verify/test_invitation.sql diff --git a/src/deploy/enum_invitation_status.sql b/src/deploy/enum_invitation_status.sql deleted file mode 100644 index c4f7e123..00000000 --- a/src/deploy/enum_invitation_status.sql +++ /dev/null @@ -1,12 +0,0 @@ -BEGIN; - -CREATE TYPE maevsi.invitation_status AS ENUM ( - 'accepted', - 'bounced', - 'rejected', - 'sent' -); - -COMMENT ON TYPE maevsi.invitation_status IS 'Represents the status of an invitation.'; - -COMMIT; diff --git a/src/deploy/function_account_password_reset_request.sql b/src/deploy/function_account_password_reset_request.sql index ce2a62b0..00e0bb43 100644 --- a/src/deploy/function_account_password_reset_request.sql +++ b/src/deploy/function_account_password_reset_request.sql @@ -24,7 +24,7 @@ BEGIN IF (_notify_data IS NULL) THEN -- noop ELSE - INSERT INTO maevsi_private.notification (channel, payload) VALUES ( + INSERT INTO maevsi.notification (channel, payload) VALUES ( 'account_password_reset_request', jsonb_pretty(jsonb_build_object( 'account', _notify_data, diff --git a/src/deploy/function_account_registration.sql b/src/deploy/function_account_registration.sql index 82d78e08..75b570c9 100644 --- a/src/deploy/function_account_registration.sql +++ b/src/deploy/function_account_registration.sql @@ -40,7 +40,7 @@ BEGIN INSERT INTO maevsi.contact(account_id, created_by) VALUES (_new_account_private.id, _new_account_private.id); - INSERT INTO maevsi_private.notification (channel, payload) VALUES ( + INSERT INTO maevsi.notification (channel, payload) VALUES ( 'account_registration', jsonb_pretty(jsonb_build_object( 'account', row_to_json(_new_account_notify), diff --git a/src/deploy/function_account_registration_refresh.sql b/src/deploy/function_account_registration_refresh.sql index fe37ea80..2d77f25a 100644 --- a/src/deploy/function_account_registration_refresh.sql +++ b/src/deploy/function_account_registration_refresh.sql @@ -10,7 +10,7 @@ BEGIN RAISE 'Refreshing registrations is currently not available due to missing rate limiting!' USING ERRCODE = 'deprecated_feature'; IF (NOT EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = $1)) THEN - RAISE 'An account with this account id does not exists!' USING ERRCODE = 'invalid_parameter_value'; + RAISE 'An account with this account id does not exist!' USING ERRCODE = 'invalid_parameter_value'; END IF; WITH updated AS ( @@ -23,9 +23,8 @@ BEGIN updated.email_address, updated.email_address_verification, updated.email_address_verification_valid_until - FROM updated, maevsi.account - WHERE updated.id = account.id - INTO _new_account_notify; + INTO _new_account_notify + FROM updated JOIN maevsi.account ON updated.id = account.id; INSERT INTO maevsi_private.notification (channel, payload) VALUES ( 'account_registration', diff --git a/src/deploy/function_invite.sql b/src/deploy/function_invite.sql index e825b9e9..6531cd96 100644 --- a/src/deploy/function_invite.sql +++ b/src/deploy/function_invite.sql @@ -3,18 +3,20 @@ BEGIN; CREATE FUNCTION maevsi.invite( guest_id UUID, "language" TEXT -) RETURNS VOID AS $$ +) RETURNS UUID AS $$ DECLARE _contact RECORD; _email_address TEXT; _event RECORD; - _event_creator_profile_picture_upload_id UUID; _event_creator_profile_picture_upload_storage_key TEXT; _event_creator_username TEXT; _guest RECORD; + _id UUID; BEGIN -- Guest UUID - SELECT * FROM maevsi.guest INTO _guest WHERE guest.id = $1; + SELECT * INTO _guest + FROM maevsi.guest + WHERE guest.id = invite.guest_id; IF ( _guest IS NULL @@ -25,14 +27,16 @@ BEGIN END IF; -- Event - SELECT * FROM maevsi.event INTO _event WHERE "event".id = _guest.event_id; + SELECT * INTO _event FROM maevsi.event WHERE id = _guest.event_id; IF (_event IS NULL) THEN RAISE 'Event not accessible!' USING ERRCODE = 'no_data_found'; END IF; -- Contact - SELECT account_id, email_address FROM maevsi.contact INTO _contact WHERE contact.id = _guest.contact_id; + SELECT account_id, email_address INTO _contact + FROM maevsi.contact + WHERE id = _guest.contact_id; IF (_contact IS NULL) THEN RAISE 'Contact not accessible!' USING ERRCODE = 'no_data_found'; @@ -46,7 +50,9 @@ BEGIN END IF; ELSE -- Account - SELECT email_address FROM maevsi_private.account INTO _email_address WHERE account.id = _contact.account_id; + SELECT email_address INTO _email_address + FROM maevsi_private.account + WHERE id = _contact.account_id; IF (_email_address IS NULL) THEN RAISE 'Account email address not accessible!' USING ERRCODE = 'no_data_found'; @@ -54,14 +60,19 @@ BEGIN END IF; -- Event creator username - SELECT username FROM maevsi.account INTO _event_creator_username WHERE account.id = _event.created_by; + SELECT username INTO _event_creator_username + FROM maevsi.account + WHERE id = _event.created_by; -- Event creator profile picture storage key - SELECT upload_id FROM maevsi.profile_picture INTO _event_creator_profile_picture_upload_id WHERE profile_picture.account_id = _event.created_by; - SELECT storage_key FROM maevsi.upload INTO _event_creator_profile_picture_upload_storage_key WHERE upload.id = _event_creator_profile_picture_upload_id; + SELECT u.storage_key INTO _event_creator_profile_picture_upload_storage_key + FROM maevsi.profile_picture p + JOIN maevsi.upload u ON p.upload_id = u.id + WHERE p.account_id = _event.created_by; - INSERT INTO maevsi_private.notification (channel, payload) + INSERT INTO maevsi.invitation (guest_id, channel, payload, created_by) VALUES ( + invite.guest_id, 'event_invitation', jsonb_pretty(jsonb_build_object( 'data', jsonb_build_object( @@ -71,13 +82,17 @@ BEGIN 'eventCreatorUsername', _event_creator_username, 'guestId', _guest.id ), - 'template', jsonb_build_object('language', $2) - )) - ); + 'template', jsonb_build_object('language', invite.language) + )), + maevsi.invoker_account_id() + ) + RETURNING id INTO _id; + + RETURN _id; END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.invite(UUID, TEXT) IS 'Adds a notification for the invitation channel.'; +COMMENT ON FUNCTION maevsi.invite(UUID, TEXT) IS 'Adds an invitation and a notification.'; GRANT EXECUTE ON FUNCTION maevsi.invite(UUID, TEXT) TO maevsi_account; diff --git a/src/deploy/function_notification_acknowledge.sql b/src/deploy/function_notification_acknowledge.sql index 388f3421..a7e2f9f0 100644 --- a/src/deploy/function_notification_acknowledge.sql +++ b/src/deploy/function_notification_acknowledge.sql @@ -4,12 +4,19 @@ CREATE FUNCTION maevsi.notification_acknowledge( id UUID, is_acknowledged BOOLEAN ) RETURNS VOID AS $$ +DECLARE + update_count INTEGER; BEGIN - IF (EXISTS (SELECT 1 FROM maevsi_private.notification WHERE "notification".id = $1)) THEN - UPDATE maevsi_private.notification SET is_acknowledged = $2 WHERE "notification".id = $1; - ELSE + + UPDATE maevsi_private.notification SET + is_acknowledged = notification_acknowledge.is_acknowledged + WHERE id = notification_acknowledge.id; + + GET DIAGNOSTICS update_count = ROW_COUNT; + IF update_count = 0 THEN RAISE 'Notification with given id not found!' USING ERRCODE = 'no_data_found'; END IF; + END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; diff --git a/src/deploy/function_test_utilities.sql b/src/deploy/function_test_utilities.sql new file mode 100644 index 00000000..5ba2a395 --- /dev/null +++ b/src/deploy/function_test_utilities.sql @@ -0,0 +1,347 @@ +BEGIN; + +CREATE OR REPLACE FUNCTION maevsi_test.account_create ( + _username TEXT, + _email TEXT +) RETURNS UUID AS $$ +DECLARE + _id UUID; + _verification UUID; +BEGIN + _id := maevsi.account_registration(_username, _email, 'password', 'en'); + + SELECT email_address_verification INTO _verification + FROM maevsi_private.account + WHERE id = _id; + + PERFORM maevsi.account_email_address_verification(_verification); + + RETURN _id; +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.account_remove ( + _username TEXT +) RETURNS VOID AS $$ +DECLARE + _id UUID; +BEGIN + SELECT id INTO _id FROM maevsi.account WHERE username = _username; + + IF _id IS NOT NULL THEN + + SET LOCAL role = 'maevsi_account'; + EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _id || ''''; + + DELETE FROM maevsi.event WHERE created_by = _id; + + PERFORM maevsi.account_delete('password'); + + SET LOCAL role = 'postgres'; + END IF; +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.contact_select_by_account_id ( + _account_id UUID +) RETURNS UUID AS $$ +DECLARE + _id UUID; +BEGIN + SELECT id INTO _id + FROM maevsi.contact + WHERE created_by = _account_id AND account_id = _account_id; + + RETURN _id; +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.contact_create ( + _created_by UUID, + _email_address TEXT +) RETURNS UUID AS $$ +DECLARE + _id UUID; + _account_id UUID; +BEGIN + SELECT id FROM maevsi_private.account WHERE email_address = _email_address INTO _account_id; + + SET LOCAL role = 'maevsi_account'; + EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; + + INSERT INTO maevsi.contact(created_by, email_address) + VALUES (_created_by, _email_address) + RETURNING id INTO _id; + + IF (_account_id IS NOT NULL) THEN + UPDATE maevsi.contact SET account_id = _account_id WHERE id = _id; + END IF; + + SET LOCAL role = 'postgres'; + + RETURN _id; +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.event_create ( + _created_by UUID, + _name TEXT, + _slug TEXT, + _start TEXT, + _visibility TEXT +) RETURNS UUID AS $$ +DECLARE + _id UUID; +BEGIN + SET LOCAL role = 'maevsi_account'; + EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; + + INSERT INTO maevsi.event(created_by, name, slug, start, visibility) + VALUES (_created_by, _name, _slug, _start::TIMESTAMP WITH TIME ZONE, _visibility::maevsi.event_visibility) + RETURNING id INTO _id; + + SET LOCAL role = 'postgres'; + + RETURN _id; +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.guest_create ( + _created_by UUID, + _event_id UUID, + _contact_id UUID +) RETURNS UUID AS $$ +DECLARE + _id UUID; +BEGIN + SET LOCAL role = 'maevsi_account'; + EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; + + INSERT INTO maevsi.guest(contact_id, event_id) + VALUES (_contact_id, _event_id) + RETURNING id INTO _id; + + SET LOCAL role = 'postgres'; + + RETURN _id; +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.event_category_create ( + _category TEXT +) RETURNS VOID AS $$ +BEGIN + INSERT INTO maevsi.event_category(category) VALUES (_category); +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.event_category_mapping_create ( + _created_by UUID, + _event_id UUID, + _category TEXT +) RETURNS VOID AS $$ +BEGIN + SET LOCAL role = 'maevsi_account'; + EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; + + INSERT INTO maevsi.event_category_mapping(event_id, category) + VALUES (_event_id, _category); + + SET LOCAL role = 'postgres'; +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.account_block_create ( + _created_by UUID, + _blocked_account_id UUID +) RETURNS UUID AS $$ +DECLARE + _id UUID; +BEGIN + SET LOCAL role = 'maevsi_account'; + EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; + + INSERT INTO maevsi.account_block(created_by, blocked_account_id) + VALUES (_created_by, _blocked_Account_id) + RETURNING id INTO _id; + + SET LOCAL role = 'postgres'; + + RETURN _id; +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.account_block_remove ( + _created_by UUID, + _blocked_account_id UUID +) RETURNS VOID AS $$ +DECLARE + _id UUID; +BEGIN + DELETE FROM maevsi.account_block + WHERE created_by = _created_by and blocked_account_id = _blocked_account_id; +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.event_test ( + _test_case TEXT, + _account_id UUID, + _expected_result UUID[] +) RETURNS VOID AS $$ +BEGIN + IF _account_id IS NULL THEN + SET LOCAL role = 'maevsi_anonymous'; + SET LOCAL jwt.claims.account_id = ''; + ELSE + SET LOCAL role = 'maevsi_account'; + EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; + END IF; + + IF EXISTS (SELECT id FROM maevsi.event EXCEPT SELECT * FROM unnest(_expected_result)) THEN + RAISE EXCEPTION 'some event should not appear in the query result'; + END IF; + + IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM maevsi.event) THEN + RAISE EXCEPTION 'some event is missing in the query result'; + END IF; + + SET LOCAL role = 'postgres'; +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.event_category_mapping_test ( + _test_case TEXT, + _account_id UUID, + _expected_result UUID[] +) RETURNS VOID AS $$ +BEGIN + IF _account_id IS NULL THEN + SET LOCAL role = 'maevsi_anonymous'; + SET LOCAL jwt.claims.account_id = ''; + ELSE + SET LOCAL role = 'maevsi_account'; + EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; + END IF; + + IF EXISTS (SELECT event_id FROM maevsi.event_category_mapping EXCEPT SELECT * FROM unnest(_expected_result)) THEN + RAISE EXCEPTION 'some event_category_mappings should not appear in the query result'; + END IF; + + IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT event_id FROM maevsi.event_category_mapping) THEN + RAISE EXCEPTION 'some event_category_mappings is missing in the query result'; + END IF; + + SET LOCAL role = 'postgres'; +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.contact_test ( + _test_case TEXT, + _account_id UUID, + _expected_result UUID[] +) RETURNS VOID AS $$ +DECLARE + rec RECORD; +BEGIN + IF _account_id IS NULL THEN + SET LOCAL role = 'maevsi_anonymous'; + SET LOCAL jwt.claims.account_id = ''; + ELSE + SET LOCAL role = 'maevsi_account'; + EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; + END IF; + + IF EXISTS (SELECT id FROM maevsi.contact EXCEPT SELECT * FROM unnest(_expected_result)) THEN + RAISE EXCEPTION 'some contact should not appear in the query result'; + END IF; + + IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM maevsi.contact) THEN + RAISE EXCEPTION 'some contact is missing in the query result'; + END IF; + + SET LOCAL role = 'postgres'; +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.guest_test ( + _test_case TEXT, + _account_id UUID, + _expected_result UUID[] +) RETURNS VOID AS $$ +BEGIN + IF _account_id IS NULL THEN + SET LOCAL role = 'maevsi_anonymous'; + SET LOCAL jwt.claims.account_id = ''; + ELSE + SET LOCAL role = 'maevsi_account'; + EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; + END IF; + + IF EXISTS (SELECT id FROM maevsi.guest EXCEPT SELECT * FROM unnest(_expected_result)) THEN + RAISE EXCEPTION 'some guest should not appear in the query result'; + END IF; + + IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM maevsi.guest) THEN + RAISE EXCEPTION 'some guest is missing in the query result'; + END IF; + + SET LOCAL role = 'postgres'; +END $$ LANGUAGE plpgsql; + +CREATE FUNCTION maevsi_test.guest_claim_from_account_guest ( + _account_id UUID +) +RETURNS UUID[] AS $$ +DECLARE + _guest maevsi.guest; + _result UUID[] := ARRAY[]::UUID[]; + _text TEXT := ''; +BEGIN + SET LOCAL role = 'maevsi_account'; + EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; + + -- reads all guests where _account_id is invited, + -- sets jwt.claims.guests to a string representation of these guests + -- and returns an array of these guests. + + FOR _guest IN + SELECT g.id + FROM maevsi.guest g JOIN maevsi.contact c + ON g.contact_id = c.id + WHERE c.account_id = _account_id + LOOP + _text := _text || ',"' || _guest.id || '"'; + _result := array_append(_result, _guest.id); + END LOOP; + + IF LENGTH(_text) > 0 THEN + _text := SUBSTR(_text, 2); + END IF; + + EXECUTE 'SET LOCAL jwt.claims.guests = ''[' || _text || ']'''; + + SET LOCAL role = 'postgres'; + + RETURN _result; +END $$ LANGUAGE plpgsql; + +CREATE FUNCTION maevsi_test.invoker_set ( + _invoker_id UUID +) +RETURNS VOID AS $$ +BEGIN + SET LOCAL role = 'maevsi_account'; + EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _invoker_id || ''''; +END $$ LANGUAGE plpgsql; + +CREATE FUNCTION maevsi_test.invoker_unset () +RETURNS VOID AS $$ +BEGIN + CALL maevsi_test.set_local_superuser(); + EXECUTE 'SET LOCAL jwt.claims.account_id = '''''; +END $$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION maevsi_test.uuid_array_test ( + _test_case TEXT, + _array UUID[], + _expected_array UUID[] +) +RETURNS VOID AS $$ +BEGIN + IF EXISTS (SELECT * FROM unnest(_array) EXCEPT SELECT * FROM unnest(_expected_array)) THEN + RAISE EXCEPTION 'some uuid should not appear in the array'; + END IF; + + IF EXISTS (SELECT * FROM unnest(_expected_array) EXCEPT SELECT * FROM unnest(_array)) THEN + RAISE EXCEPTION 'some expected uuid is missing in the array'; + END IF; +END $$ LANGUAGE plpgsql; + +COMMIT; diff --git a/src/deploy/table_invitation.sql b/src/deploy/table_invitation.sql index 4de3ce06..afecdf29 100644 --- a/src/deploy/table_invitation.sql +++ b/src/deploy/table_invitation.sql @@ -1,33 +1,14 @@ BEGIN; -CREATE TABLE maevsi.invitation( - id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - - guest_id UUID NOT NULL REFERENCES maevsi.guest(id), - status maevsi.invitation_status NOT NULL, - - created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, - created_by UUID NOT NULL REFERENCES maevsi.account(id), - updated_at TIMESTAMP WITH TIME ZONE, - updated_by UUID REFERENCES maevsi.account(id) NOT NULL, - - UNIQUE(guest_id, status, created_at) -); +CREATE TABLE maevsi.invitation ( + guest_id UUID NOT NULL REFERENCES maevsi.guest(id), + -- created_at is already column of table notification + created_by UUID NOT NULL REFERENCES maevsi.account(id) +) +INHERITS (maevsi.notification); COMMENT ON TABLE maevsi.invitation IS '@omit update,delete\nStores invitations and their statuses.'; -COMMENT ON COLUMN maevsi.invitation.id IS E'@omit create\nThe unique identifier for the invitation.'; COMMENT ON COLUMN maevsi.invitation.guest_id IS 'The ID of the guest associated with this invitation.'; -COMMENT ON COLUMN maevsi.invitation.status IS 'The current status of the invitation.'; -COMMENT ON COLUMN maevsi.invitation.created_at IS E'@omit create\nTimestamp when the invitation was created. Defaults to the current timestamp.'; COMMENT ON COLUMN maevsi.invitation.created_by IS E'@omit create\nReference to the account that created the invitation.'; -COMMENT ON COLUMN maevsi.invitation.updated_at IS E'@omit create\nTimestamp when the invitation was last updated.'; -COMMENT ON COLUMN maevsi.invitation.updated_by IS E'@omit create\nReference to the account that last updated the invitation.'; - -CREATE TRIGGER maevsi_trigger_invitation_update - BEFORE - UPDATE - ON maevsi.invitation - FOR EACH ROW - EXECUTE PROCEDURE maevsi.trigger_metadata_update(); COMMIT; diff --git a/src/deploy/table_invitation_policy.sql b/src/deploy/table_invitation_policy.sql index dfba4543..e8f11ba7 100644 --- a/src/deploy/table_invitation_policy.sql +++ b/src/deploy/table_invitation_policy.sql @@ -5,12 +5,7 @@ GRANT SELECT, INSERT ON maevsi.invitation TO maevsi_account; ALTER TABLE maevsi.invitation ENABLE ROW LEVEL SECURITY; CREATE POLICY invitation_select ON maevsi.invitation FOR SELECT USING ( - maevsi.invoker_account_id() = ( - SELECT e.created_by - FROM maevsi.guest g - JOIN maevsi.event e ON g.event_id = e.id - WHERE g.id = guest_id - ) + created_by = maevsi.invoker_account_id() ); CREATE POLICY invitation_insert ON maevsi.invitation FOR INSERT WITH CHECK ( diff --git a/src/deploy/table_notification.sql b/src/deploy/table_notification.sql index 64722c33..80d83995 100644 --- a/src/deploy/table_notification.sql +++ b/src/deploy/table_notification.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE TABLE maevsi_private.notification ( +CREATE TABLE maevsi.notification ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), channel TEXT NOT NULL, @@ -10,11 +10,11 @@ CREATE TABLE maevsi_private.notification ( created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP ); -COMMENT ON TABLE maevsi_private.notification IS 'A notification.'; -COMMENT ON COLUMN maevsi_private.notification.id IS 'The notification''s internal id.'; -COMMENT ON COLUMN maevsi_private.notification.channel IS 'The notification''s channel.'; -COMMENT ON COLUMN maevsi_private.notification.is_acknowledged IS 'Whether the notification was acknowledged.'; -COMMENT ON COLUMN maevsi_private.notification.payload IS 'The notification''s payload.'; -COMMENT ON COLUMN maevsi_private.notification.created_at IS 'The timestamp of the notification''s creation.'; +COMMENT ON TABLE maevsi.notification IS 'A notification.'; +COMMENT ON COLUMN maevsi.notification.id IS 'The notification''s internal id.'; +COMMENT ON COLUMN maevsi.notification.channel IS 'The notification''s channel.'; +COMMENT ON COLUMN maevsi.notification.is_acknowledged IS 'Whether the notification was acknowledged.'; +COMMENT ON COLUMN maevsi.notification.payload IS 'The notification''s payload.'; +COMMENT ON COLUMN maevsi.notification.created_at IS 'The timestamp of the notification''s creation.'; COMMIT; diff --git a/src/deploy/test_account_blocking.sql b/src/deploy/test_account_blocking.sql index 993ce60b..e13cab07 100644 --- a/src/deploy/test_account_blocking.sql +++ b/src/deploy/test_account_blocking.sql @@ -1,331 +1,5 @@ BEGIN; -CREATE OR REPLACE FUNCTION maevsi_test.account_create ( - _username TEXT, - _email TEXT -) RETURNS UUID AS $$ -DECLARE - _id UUID; - _verification UUID; -BEGIN - _id := maevsi.account_registration(_username, _email, 'password', 'en'); - - SELECT email_address_verification INTO _verification - FROM maevsi_private.account - WHERE id = _id; - - PERFORM maevsi.account_email_address_verification(_verification); - - RETURN _id; -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.account_remove ( - _username TEXT -) RETURNS VOID AS $$ -DECLARE - _id UUID; -BEGIN - SELECT id INTO _id FROM maevsi.account WHERE username = _username; - - IF _id IS NOT NULL THEN - - SET LOCAL role = 'maevsi_account'; - EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _id || ''''; - - DELETE FROM maevsi.event WHERE created_by = _id; - - PERFORM maevsi.account_delete('password'); - - SET LOCAL role = 'postgres'; - END IF; -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.contact_select_by_account_id ( - _account_id UUID -) RETURNS UUID AS $$ -DECLARE - _id UUID; -BEGIN - SELECT id INTO _id - FROM maevsi.contact - WHERE created_by = _account_id AND account_id = _account_id; - - RETURN _id; -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.contact_create ( - _created_by UUID, - _email_address TEXT -) RETURNS UUID AS $$ -DECLARE - _id UUID; - _account_id UUID; -BEGIN - SELECT id FROM maevsi_private.account WHERE email_address = _email_address INTO _account_id; - - SET LOCAL role = 'maevsi_account'; - EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - - INSERT INTO maevsi.contact(created_by, email_address) - VALUES (_created_by, _email_address) - RETURNING id INTO _id; - - IF (_account_id IS NOT NULL) THEN - UPDATE maevsi.contact SET account_id = _account_id WHERE id = _id; - END IF; - - SET LOCAL role = 'postgres'; - - RETURN _id; -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.event_create ( - _created_by UUID, - _name TEXT, - _slug TEXT, - _start TEXT, - _visibility TEXT -) RETURNS UUID AS $$ -DECLARE - _id UUID; -BEGIN - SET LOCAL role = 'maevsi_account'; - EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - - INSERT INTO maevsi.event(created_by, name, slug, start, visibility) - VALUES (_created_by, _name, _slug, _start::TIMESTAMP WITH TIME ZONE, _visibility::maevsi.event_visibility) - RETURNING id INTO _id; - - SET LOCAL role = 'postgres'; - - RETURN _id; -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.guest_create ( - _created_by UUID, - _event_id UUID, - _contact_id UUID -) RETURNS UUID AS $$ -DECLARE - _id UUID; -BEGIN - SET LOCAL role = 'maevsi_account'; - EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - - INSERT INTO maevsi.guest(contact_id, event_id) - VALUES (_contact_id, _event_id) - RETURNING id INTO _id; - - SET LOCAL role = 'postgres'; - - RETURN _id; -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.event_category_create ( - _category TEXT -) RETURNS VOID AS $$ -BEGIN - INSERT INTO maevsi.event_category(category) VALUES (_category); -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.event_category_mapping_create ( - _created_by UUID, - _event_id UUID, - _category TEXT -) RETURNS VOID AS $$ -BEGIN - SET LOCAL role = 'maevsi_account'; - EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - - INSERT INTO maevsi.event_category_mapping(event_id, category) - VALUES (_event_id, _category); - - SET LOCAL role = 'postgres'; -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.account_block_create ( - _created_by UUID, - _blocked_account_id UUID -) RETURNS UUID AS $$ -DECLARE - _id UUID; -BEGIN - SET LOCAL role = 'maevsi_account'; - EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - - INSERT INTO maevsi.account_block(created_by, blocked_account_id) - VALUES (_created_by, _blocked_Account_id) - RETURNING id INTO _id; - - SET LOCAL role = 'postgres'; - - RETURN _id; -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.account_block_remove ( - _created_by UUID, - _blocked_account_id UUID -) RETURNS VOID AS $$ -DECLARE - _id UUID; -BEGIN - DELETE FROM maevsi.account_block - WHERE created_by = _created_by and blocked_account_id = _blocked_account_id; -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.event_test ( - _test_case TEXT, - _account_id UUID, - _expected_result UUID[] -) RETURNS VOID AS $$ -BEGIN - IF _account_id IS NULL THEN - SET LOCAL role = 'maevsi_anonymous'; - SET LOCAL jwt.claims.account_id = ''; - ELSE - SET LOCAL role = 'maevsi_account'; - EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; - END IF; - - IF EXISTS (SELECT id FROM maevsi.event EXCEPT SELECT * FROM unnest(_expected_result)) THEN - RAISE EXCEPTION 'some event should not appear in the query result'; - END IF; - - IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM maevsi.event) THEN - RAISE EXCEPTION 'some event is missing in the query result'; - END IF; - - SET LOCAL role = 'postgres'; -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.event_category_mapping_test ( - _test_case TEXT, - _account_id UUID, - _expected_result UUID[] -) RETURNS VOID AS $$ -BEGIN - IF _account_id IS NULL THEN - SET LOCAL role = 'maevsi_anonymous'; - SET LOCAL jwt.claims.account_id = ''; - ELSE - SET LOCAL role = 'maevsi_account'; - EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; - END IF; - - IF EXISTS (SELECT event_id FROM maevsi.event_category_mapping EXCEPT SELECT * FROM unnest(_expected_result)) THEN - RAISE EXCEPTION 'some event_category_mappings should not appear in the query result'; - END IF; - - IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT event_id FROM maevsi.event_category_mapping) THEN - RAISE EXCEPTION 'some event_category_mappings is missing in the query result'; - END IF; - - SET LOCAL role = 'postgres'; -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.contact_test ( - _test_case TEXT, - _account_id UUID, - _expected_result UUID[] -) RETURNS VOID AS $$ -DECLARE - rec RECORD; -BEGIN - IF _account_id IS NULL THEN - SET LOCAL role = 'maevsi_anonymous'; - SET LOCAL jwt.claims.account_id = ''; - ELSE - SET LOCAL role = 'maevsi_account'; - EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; - END IF; - - IF EXISTS (SELECT id FROM maevsi.contact EXCEPT SELECT * FROM unnest(_expected_result)) THEN - RAISE EXCEPTION 'some contact should not appear in the query result'; - END IF; - - IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM maevsi.contact) THEN - RAISE EXCEPTION 'some contact is missing in the query result'; - END IF; - - SET LOCAL role = 'postgres'; -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.guest_test ( - _test_case TEXT, - _account_id UUID, - _expected_result UUID[] -) RETURNS VOID AS $$ -BEGIN - IF _account_id IS NULL THEN - SET LOCAL role = 'maevsi_anonymous'; - SET LOCAL jwt.claims.account_id = ''; - ELSE - SET LOCAL role = 'maevsi_account'; - EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; - END IF; - - IF EXISTS (SELECT id FROM maevsi.guest EXCEPT SELECT * FROM unnest(_expected_result)) THEN - RAISE EXCEPTION 'some guest should not appear in the query result'; - END IF; - - IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM maevsi.guest) THEN - RAISE EXCEPTION 'some guest is missing in the query result'; - END IF; - - SET LOCAL role = 'postgres'; -END $$ LANGUAGE plpgsql; - -CREATE FUNCTION maevsi_test.guest_claim_from_account_guest ( - _account_id UUID -) -RETURNS UUID[] AS $$ -DECLARE - _guest maevsi.guest; - _result UUID[] := ARRAY[]::UUID[]; - _text TEXT := ''; -BEGIN - SET LOCAL role = 'maevsi_account'; - EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; - - -- reads all guests where _account_id is invited, - -- sets jwt.claims.guests to a string representation of these guests - -- and returns an array of these guests. - - FOR _guest IN - SELECT g.id - FROM maevsi.guest g JOIN maevsi.contact c - ON g.contact_id = c.id - WHERE c.account_id = _account_id - LOOP - _text := _text || ',"' || _guest.id || '"'; - _result := array_append(_result, _guest.id); - END LOOP; - - IF LENGTH(_text) > 0 THEN - _text := SUBSTR(_text, 2); - END IF; - - EXECUTE 'SET LOCAL jwt.claims.guests = ''[' || _text || ']'''; - - SET LOCAL role = 'postgres'; - - RETURN _result; -END $$ LANGUAGE plpgsql; - -CREATE OR REPLACE FUNCTION maevsi_test.uuid_array_test ( - _test_case TEXT, - _array UUID[], - _expected_array UUID[] -) -RETURNS VOID AS $$ -BEGIN - IF EXISTS (SELECT * FROM unnest(_array) EXCEPT SELECT * FROM unnest(_expected_array)) THEN - RAISE EXCEPTION 'some uuid should not appear in the array'; - END IF; - - IF EXISTS (SELECT * FROM unnest(_expected_array) EXCEPT SELECT * FROM unnest(_array)) THEN - RAISE EXCEPTION 'some expected uuid is missing in the array'; - END IF; -END $$ LANGUAGE plpgsql; +-- nothing defined here; see function_test_utilities.sql COMMIT; diff --git a/src/deploy/test_invitation.sql b/src/deploy/test_invitation.sql new file mode 100644 index 00000000..1004a402 --- /dev/null +++ b/src/deploy/test_invitation.sql @@ -0,0 +1,5 @@ +BEGIN; + +-- nothing defined here; see also function_test_utilities.sql + +COMMIT; diff --git a/src/revert/enum_invitation_status.sql b/src/revert/enum_invitation_status.sql deleted file mode 100644 index ec243db4..00000000 --- a/src/revert/enum_invitation_status.sql +++ /dev/null @@ -1,5 +0,0 @@ -BEGIN; - -DROP TYPE maevsi.invitation_status; - -COMMIT; diff --git a/src/revert/function_test_utilities.sql b/src/revert/function_test_utilities.sql new file mode 100644 index 00000000..68ba0b89 --- /dev/null +++ b/src/revert/function_test_utilities.sql @@ -0,0 +1,22 @@ +BEGIN; + +DROP FUNCTION maevsi_test.account_block_create(UUID, UUID); +DROP FUNCTION maevsi_test.account_block_remove(UUID, UUID); +DROP FUNCTION maevsi_test.account_create(TEXT, TEXT); +DROP FUNCTION maevsi_test.account_remove(TEXT); +DROP FUNCTION maevsi_test.contact_create(UUID, TEXT); +DROP FUNCTION maevsi_test.contact_select_by_account_id(UUID); +DROP FUNCTION maevsi_test.contact_test(TEXT, UUID, UUID[]); +DROP FUNCTION maevsi_test.event_category_create(TEXT); +DROP FUNCTION maevsi_test.event_category_mapping_create(UUID, UUID, TEXT); +DROP FUNCTION maevsi_test.event_category_mapping_test(TEXT, UUID, UUID[]); +DROP FUNCTION maevsi_test.event_create(UUID, TEXT, TEXT, TEXT, TEXT); +DROP FUNCTION maevsi_test.event_test(TEXT, UUID, UUID[]); +DROP FUNCTION maevsi_test.guest_create(UUID, UUID, UUID); +DROP FUNCTION maevsi_test.guest_test(TEXT, UUID, UUID[]); +DROP FUNCTION maevsi_test.guest_claim_from_account_guest(UUID); +DROP FUNCTION maevsi_test.invoker_set(UUID); +DROP FUNCTION maevsi_test.invoker_unset(); +DROP FUNCTION maevsi_test.uuid_array_test(TEXT, UUID[], UUID[]); + +COMMIT; diff --git a/src/revert/table_notification.sql b/src/revert/table_notification.sql index 840e2a1c..ccaf2f81 100644 --- a/src/revert/table_notification.sql +++ b/src/revert/table_notification.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi_private.notification; +DROP TABLE maevsi.notification; COMMIT; diff --git a/src/revert/test_account_blocking.sql b/src/revert/test_account_blocking.sql index 0a0dca75..ab576564 100644 --- a/src/revert/test_account_blocking.sql +++ b/src/revert/test_account_blocking.sql @@ -1,20 +1,5 @@ BEGIN; -DROP FUNCTION maevsi_test.account_block_create(UUID, UUID); -DROP FUNCTION maevsi_test.account_block_remove(UUID, UUID); -DROP FUNCTION maevsi_test.account_create(TEXT, TEXT); -DROP FUNCTION maevsi_test.account_remove(TEXT); -DROP FUNCTION maevsi_test.contact_create(UUID, TEXT); -DROP FUNCTION maevsi_test.contact_select_by_account_id(UUID); -DROP FUNCTION maevsi_test.contact_test(TEXT, UUID, UUID[]); -DROP FUNCTION maevsi_test.event_category_create(TEXT); -DROP FUNCTION maevsi_test.event_category_mapping_create(UUID, UUID, TEXT); -DROP FUNCTION maevsi_test.event_category_mapping_test(TEXT, UUID, UUID[]); -DROP FUNCTION maevsi_test.event_create(UUID, TEXT, TEXT, TEXT, TEXT); -DROP FUNCTION maevsi_test.event_test(TEXT, UUID, UUID[]); -DROP FUNCTION maevsi_test.guest_create(UUID, UUID, UUID); -DROP FUNCTION maevsi_test.guest_test(TEXT, UUID, UUID[]); -DROP FUNCTION maevsi_test.guest_claim_from_account_guest(UUID); -DROP FUNCTION maevsi_test.uuid_array_test(TEXT, UUID[], UUID[]); +-- nothing to be dropped here COMMIT; diff --git a/src/revert/test_invitation.sql b/src/revert/test_invitation.sql new file mode 100644 index 00000000..2035c361 --- /dev/null +++ b/src/revert/test_invitation.sql @@ -0,0 +1,3 @@ +BEGIN; + +COMMIT; \ No newline at end of file diff --git a/src/sqitch.plan b/src/sqitch.plan index f07c5145..1fed4301 100644 --- a/src/sqitch.plan +++ b/src/sqitch.plan @@ -97,11 +97,12 @@ table_event_recommendation [schema_public table_account_public table_event] 1970 table_event_recommendation_policy [schema_public table_event_recommendation role_account] 1970-01-01T00:00:00Z marlon # Row level security policies for table event_recommendation. table_event_favorite [schema_public table_account_public table_event] 1970-01-01T00:00:00Z Sven Thelemann # A table for the user accounts' favorite events. table_event_favorite_policy [schema_public table_account_public table_event role_account] 1970-01-01T00:00:00Z Sven Thelemann # Policy for table event_favorite. -test_account_blocking [schema_test] 1970-01-01T00:00:00Z Sven Thelemann # Test cases for account blocking. +function_test_utilities [schema_test schema_public schema_private role_account table_account_private table_account_public function_account_delete function_account_registration function_account_email_address_verification table_contact table_event table_event_category table_event_category_mapping table_guest table_account_block ] 1970-01-01T00:00:00Z Sven Thelemann # A collection of utility functions to be used across al tests. +test_account_blocking [schema_test function_test_utilities] 1970-01-01T00:00:00Z Sven Thelemann # Test cases for account blocking. function_event_search [privilege_execute_revoke schema_public enum_language schema_private function_language_iso_full_text_search table_event role_account role_anonymous] 1970-01-01T00:00:00Z Jonas Thelemann # Full-text search on events. index_account_private_location [schema_private table_account_private] 1970-01-01T00:00:00Z Sven Thelemann # Spacial index on location column in table maevsi_private.account. index_event_location [schema_public table_event] 1970-01-01T00:00:00Z Sven Thelemann # Spacial index on location_geography column in table maevsi.event. -enum_invitation_status [schema_public] 1970-01-01T00:00:00Z Sven Thelemann # Represents the status of an invitation. -table_invitation [schema_public table_guest enum_invitation_status table_account_public function_trigger_metadata_update] 1970-01-01T00:00:00Z Sven Thelemann # A table for tracking actions around invitations. +table_invitation [schema_public table_guest table_account_public] 1970-01-01T00:00:00Z Sven Thelemann # A table for tracking actions around invitations. table_invitation_policy [schema_public table_invitation role_account function_invoker_account_id table_guest table_event] 1970-01-01T00:00:00Z Sven Thelemann # Stores invitations and their statuses. -test_location [schema_public schema_private extension_postgis table_account_private table_event role_anonymous role_account] 1970-01-01T00:00:00Z Sven Thelemann # A collection of location related functions. +test_location [schema_test schema_public schema_private extension_postgis table_account_private table_event role_anonymous role_account] 1970-01-01T00:00:00Z Sven Thelemann # A collection of location related test functions and tests. +test_invitation [schema_test function_test_utilities] 1970-01-01T00:00:00Z Sven Thelemann # Invitation related tests. diff --git a/src/verify/enum_invitation_status.sql b/src/verify/enum_invitation_status.sql deleted file mode 100644 index 5dfc5a94..00000000 --- a/src/verify/enum_invitation_status.sql +++ /dev/null @@ -1,8 +0,0 @@ -BEGIN; - -DO $$ -BEGIN - ASSERT (SELECT pg_catalog.has_type_privilege('maevsi.invitation_status', 'USAGE')); -END $$; - -ROLLBACK; diff --git a/src/verify/function_account_registration.sql b/src/verify/function_account_registration.sql index 40559d88..e1aae5a9 100644 --- a/src/verify/function_account_registration.sql +++ b/src/verify/function_account_registration.sql @@ -78,7 +78,7 @@ BEGIN PERFORM maevsi.account_registration('username-8b973f', 'email@example.com', 'password', 'en'); IF NOT EXISTS ( - SELECT 1 FROM maevsi_private.notification + SELECT 1 FROM maevsi.notification WHERE channel = 'account_registration' AND payload::jsonb -> 'account' ->> 'username' = 'username-8b973f' ) THEN diff --git a/src/verify/function_test_utilities.sql b/src/verify/function_test_utilities.sql new file mode 100644 index 00000000..d8b0f893 --- /dev/null +++ b/src/verify/function_test_utilities.sql @@ -0,0 +1,3 @@ +BEGIN; + +ROLLBACK; \ No newline at end of file diff --git a/src/verify/table_notification.sql b/src/verify/table_notification.sql index f6c435a9..cec9d675 100644 --- a/src/verify/table_notification.sql +++ b/src/verify/table_notification.sql @@ -5,6 +5,6 @@ SELECT id, is_acknowledged, payload, created_at -FROM maevsi_private.notification WHERE FALSE; +FROM maevsi.notification WHERE FALSE; ROLLBACK; diff --git a/src/verify/test_invitation.sql b/src/verify/test_invitation.sql new file mode 100644 index 00000000..29c91888 --- /dev/null +++ b/src/verify/test_invitation.sql @@ -0,0 +1,38 @@ +BEGIN; + +DO $$ +DECLARE + accountA UUID; + accountB UUID; + + contactAB UUID; + eventA UUID; + guestAB UUID; + + invitationId UUID; + + rec RECORD; + +BEGIN + + accountA := maevsi_test.account_create('a', 'a@example.com'); + accountB := maevsi_test.account_create('b', 'b@example.com'); + contactAB := maevsi_test.contact_create(accountA, 'b@example.com'); + eventA := maevsi_test.event_create(accountA, 'Event by A', 'event-by-a', '2025-06-01 20:00', 'public'); + guestAB := maevsi_test.guest_create(accountA, eventA, contactAB); + + PERFORM maevsi_test.invoker_set(accountA); + + invitationId := maevsi.invite(guestAB, 'de'); + + SELECT guest_id, created_by, channel INTO rec + FROM maevsi.invitation + WHERE id = invitationId; + + IF rec.guest_id != guestAB or rec.created_by != accountA or rec.channel != 'event_invitation' THEN + RAISE EXCEPTION 'The invitation was not correctly created'; + END IF; + +END $$; + +ROLLBACK; \ No newline at end of file diff --git a/src/verify/test_location.sql b/src/verify/test_location.sql index 2179ac3b..9aa1988f 100644 --- a/src/verify/test_location.sql +++ b/src/verify/test_location.sql @@ -8,19 +8,10 @@ DECLARE _id UUID; BEGIN -- Register account - _account_id := maevsi.account_registration('username', 'email@example.com', 'password', 'en'); - PERFORM maevsi.account_email_address_verification( - (SELECT email_address_verification FROM maevsi_private.account WHERE id = _account_id) - ); - - -- Set account-specific context - SET LOCAL role = 'maevsi_account'; - EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; + _account_id := maevsi_test.account_create('username', 'email@example.com'); -- Create event - INSERT INTO maevsi.event(created_by, name, slug, start, visibility) - VALUES (_account_id, 'event', 'event', CURRENT_TIMESTAMP, 'public'::maevsi.event_visibility) - RETURNING id INTO _event_id; + _event_id := maevsi_test.event_create(_account_id, 'Event by A', 'event-by-a', '2025-06-01 20:00', 'public'); -- Update and validate account location PERFORM maevsi_test.account_location_update(_account_id, 51.304, 9.476); -- Somewhere in Kassel @@ -30,6 +21,9 @@ BEGIN RAISE EXCEPTION 'Wrong account coordinates'; END IF; + -- Set account-specific context + PERFORM maevsi_test.invoker_set(_account_id); + -- Update and validate event location PERFORM maevsi_test.event_location_update(_event_id, 50.113, 8.650); -- Somewhere in Frankfurt _coordinates := maevsi_test.event_location_coordinates(_event_id); diff --git a/test/schema/schema.definition.sql b/test/schema/schema.definition.sql index 5a5d9cd6..bedf3908 100644 --- a/test/schema/schema.definition.sql +++ b/test/schema/schema.definition.sql @@ -235,27 +235,6 @@ ALTER TYPE maevsi.invitation_feedback_paper OWNER TO postgres; COMMENT ON TYPE maevsi.invitation_feedback_paper IS 'Possible choices on how to receive a paper invitation: none, paper, digital.'; --- --- Name: invitation_status; Type: TYPE; Schema: maevsi; Owner: postgres --- - -CREATE TYPE maevsi.invitation_status AS ENUM ( - 'accepted', - 'bounced', - 'rejected', - 'sent' -); - - -ALTER TYPE maevsi.invitation_status OWNER TO postgres; - --- --- Name: TYPE invitation_status; Type: COMMENT; Schema: maevsi; Owner: postgres --- - -COMMENT ON TYPE maevsi.invitation_status IS 'Represents the status of an invitation.'; - - -- -- Name: language; Type: TYPE; Schema: maevsi; Owner: postgres -- @@ -475,7 +454,7 @@ BEGIN IF (_notify_data IS NULL) THEN -- noop ELSE - INSERT INTO maevsi_private.notification (channel, payload) VALUES ( + INSERT INTO maevsi.notification (channel, payload) VALUES ( 'account_password_reset_request', jsonb_pretty(jsonb_build_object( 'account', _notify_data, @@ -537,7 +516,7 @@ BEGIN INSERT INTO maevsi.contact(account_id, created_by) VALUES (_new_account_private.id, _new_account_private.id); - INSERT INTO maevsi_private.notification (channel, payload) VALUES ( + INSERT INTO maevsi.notification (channel, payload) VALUES ( 'account_registration', jsonb_pretty(jsonb_build_object( 'account', row_to_json(_new_account_notify), @@ -572,7 +551,7 @@ BEGIN RAISE 'Refreshing registrations is currently not available due to missing rate limiting!' USING ERRCODE = 'deprecated_feature'; IF (NOT EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = $1)) THEN - RAISE 'An account with this account id does not exists!' USING ERRCODE = 'invalid_parameter_value'; + RAISE 'An account with this account id does not exist!' USING ERRCODE = 'invalid_parameter_value'; END IF; WITH updated AS ( @@ -585,9 +564,8 @@ BEGIN updated.email_address, updated.email_address_verification, updated.email_address_verification_valid_until - FROM updated, maevsi.account - WHERE updated.id = account.id - INTO _new_account_notify; + INTO _new_account_notify + FROM updated JOIN maevsi.account ON updated.id = account.id; INSERT INTO maevsi_private.notification (channel, payload) VALUES ( 'account_registration', @@ -1300,20 +1278,22 @@ COMMENT ON FUNCTION maevsi.guest_count(event_id uuid) IS 'Returns the guest coun -- Name: invite(uuid, text); Type: FUNCTION; Schema: maevsi; Owner: postgres -- -CREATE FUNCTION maevsi.invite(guest_id uuid, language text) RETURNS void +CREATE FUNCTION maevsi.invite(guest_id uuid, language text) RETURNS uuid LANGUAGE plpgsql STRICT SECURITY DEFINER - AS $_$ + AS $$ DECLARE _contact RECORD; _email_address TEXT; _event RECORD; - _event_creator_profile_picture_upload_id UUID; _event_creator_profile_picture_upload_storage_key TEXT; _event_creator_username TEXT; _guest RECORD; + _id UUID; BEGIN -- Guest UUID - SELECT * FROM maevsi.guest INTO _guest WHERE guest.id = $1; + SELECT * INTO _guest + FROM maevsi.guest + WHERE guest.id = invite.guest_id; IF ( _guest IS NULL @@ -1324,14 +1304,16 @@ BEGIN END IF; -- Event - SELECT * FROM maevsi.event INTO _event WHERE "event".id = _guest.event_id; + SELECT * INTO _event FROM maevsi.event WHERE id = _guest.event_id; IF (_event IS NULL) THEN RAISE 'Event not accessible!' USING ERRCODE = 'no_data_found'; END IF; -- Contact - SELECT account_id, email_address FROM maevsi.contact INTO _contact WHERE contact.id = _guest.contact_id; + SELECT account_id, email_address INTO _contact + FROM maevsi.contact + WHERE id = _guest.contact_id; IF (_contact IS NULL) THEN RAISE 'Contact not accessible!' USING ERRCODE = 'no_data_found'; @@ -1345,7 +1327,9 @@ BEGIN END IF; ELSE -- Account - SELECT email_address FROM maevsi_private.account INTO _email_address WHERE account.id = _contact.account_id; + SELECT email_address INTO _email_address + FROM maevsi_private.account + WHERE id = _contact.account_id; IF (_email_address IS NULL) THEN RAISE 'Account email address not accessible!' USING ERRCODE = 'no_data_found'; @@ -1353,14 +1337,19 @@ BEGIN END IF; -- Event creator username - SELECT username FROM maevsi.account INTO _event_creator_username WHERE account.id = _event.created_by; + SELECT username INTO _event_creator_username + FROM maevsi.account + WHERE id = _event.created_by; -- Event creator profile picture storage key - SELECT upload_id FROM maevsi.profile_picture INTO _event_creator_profile_picture_upload_id WHERE profile_picture.account_id = _event.created_by; - SELECT storage_key FROM maevsi.upload INTO _event_creator_profile_picture_upload_storage_key WHERE upload.id = _event_creator_profile_picture_upload_id; + SELECT u.storage_key INTO _event_creator_profile_picture_upload_storage_key + FROM maevsi.profile_picture p + JOIN maevsi.upload u ON p.upload_id = u.id + WHERE p.account_id = _event.created_by; - INSERT INTO maevsi_private.notification (channel, payload) + INSERT INTO maevsi.invitation (guest_id, channel, payload, created_by) VALUES ( + invite.guest_id, 'event_invitation', jsonb_pretty(jsonb_build_object( 'data', jsonb_build_object( @@ -1370,11 +1359,15 @@ BEGIN 'eventCreatorUsername', _event_creator_username, 'guestId', _guest.id ), - 'template', jsonb_build_object('language', $2) - )) - ); + 'template', jsonb_build_object('language', invite.language) + )), + maevsi.invoker_account_id() + ) + RETURNING id INTO _id; + + RETURN _id; END; -$_$; +$$; ALTER FUNCTION maevsi.invite(guest_id uuid, language text) OWNER TO postgres; @@ -1383,7 +1376,7 @@ ALTER FUNCTION maevsi.invite(guest_id uuid, language text) OWNER TO postgres; -- Name: FUNCTION invite(guest_id uuid, language text); Type: COMMENT; Schema: maevsi; Owner: postgres -- -COMMENT ON FUNCTION maevsi.invite(guest_id uuid, language text) IS 'Adds a notification for the invitation channel.'; +COMMENT ON FUNCTION maevsi.invite(guest_id uuid, language text) IS 'Adds an invitation and a notification.'; -- @@ -1529,15 +1522,22 @@ ALTER FUNCTION maevsi.legal_term_change() OWNER TO postgres; CREATE FUNCTION maevsi.notification_acknowledge(id uuid, is_acknowledged boolean) RETURNS void LANGUAGE plpgsql STRICT SECURITY DEFINER - AS $_$ + AS $$ +DECLARE + update_count INTEGER; BEGIN - IF (EXISTS (SELECT 1 FROM maevsi_private.notification WHERE "notification".id = $1)) THEN - UPDATE maevsi_private.notification SET is_acknowledged = $2 WHERE "notification".id = $1; - ELSE + + UPDATE maevsi_private.notification SET + is_acknowledged = notification_acknowledge.is_acknowledged + WHERE id = notification_acknowledge.id; + + GET DIAGNOSTICS update_count = ROW_COUNT; + IF update_count = 0 THEN RAISE 'Notification with given id not found!' USING ERRCODE = 'no_data_found'; END IF; + END; -$_$; +$$; ALTER FUNCTION maevsi.notification_acknowledge(id uuid, is_acknowledged boolean) OWNER TO postgres; @@ -2571,6 +2571,36 @@ END $$; ALTER FUNCTION maevsi_test.guest_test(_test_case text, _account_id uuid, _expected_result uuid[]) OWNER TO postgres; +-- +-- Name: invoker_set(uuid); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- + +CREATE FUNCTION maevsi_test.invoker_set(_invoker_id uuid) RETURNS void + LANGUAGE plpgsql + AS $$ +BEGIN + SET LOCAL role = 'maevsi_account'; + EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _invoker_id || ''''; +END $$; + + +ALTER FUNCTION maevsi_test.invoker_set(_invoker_id uuid) OWNER TO postgres; + +-- +-- Name: invoker_unset(); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- + +CREATE FUNCTION maevsi_test.invoker_unset() RETURNS void + LANGUAGE plpgsql + AS $$ +BEGIN + CALL maevsi_test.set_local_superuser(); + EXECUTE 'SET LOCAL jwt.claims.account_id = '''''; +END $$; + + +ALTER FUNCTION maevsi_test.invoker_unset() OWNER TO postgres; + -- -- Name: uuid_array_test(text, uuid[], uuid[]); Type: FUNCTION; Schema: maevsi_test; Owner: postgres -- @@ -3574,81 +3604,96 @@ COMMENT ON VIEW maevsi.guest_flat IS 'View returning flattened guests.'; -- --- Name: invitation; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: notification; Type: TABLE; Schema: maevsi; Owner: postgres -- -CREATE TABLE maevsi.invitation ( +CREATE TABLE maevsi.notification ( id uuid DEFAULT gen_random_uuid() NOT NULL, - guest_id uuid NOT NULL, - status maevsi.invitation_status NOT NULL, + channel text NOT NULL, + is_acknowledged boolean, + payload text NOT NULL, created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, - created_by uuid NOT NULL, - updated_at timestamp with time zone, - updated_by uuid NOT NULL + CONSTRAINT notification_payload_check CHECK ((octet_length(payload) <= 8000)) ); -ALTER TABLE maevsi.invitation OWNER TO postgres; +ALTER TABLE maevsi.notification OWNER TO postgres; -- --- Name: TABLE invitation; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE notification; Type: COMMENT; Schema: maevsi; Owner: postgres -- -COMMENT ON TABLE maevsi.invitation IS '@omit update,delete\nStores invitations and their statuses.'; +COMMENT ON TABLE maevsi.notification IS 'A notification.'; -- --- Name: COLUMN invitation.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN notification.id; Type: COMMENT; Schema: maevsi; Owner: postgres -- -COMMENT ON COLUMN maevsi.invitation.id IS '@omit create -The unique identifier for the invitation.'; +COMMENT ON COLUMN maevsi.notification.id IS 'The notification''s internal id.'; -- --- Name: COLUMN invitation.guest_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN notification.channel; Type: COMMENT; Schema: maevsi; Owner: postgres -- -COMMENT ON COLUMN maevsi.invitation.guest_id IS 'The ID of the guest associated with this invitation.'; +COMMENT ON COLUMN maevsi.notification.channel IS 'The notification''s channel.'; -- --- Name: COLUMN invitation.status; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN notification.is_acknowledged; Type: COMMENT; Schema: maevsi; Owner: postgres -- -COMMENT ON COLUMN maevsi.invitation.status IS 'The current status of the invitation.'; +COMMENT ON COLUMN maevsi.notification.is_acknowledged IS 'Whether the notification was acknowledged.'; -- --- Name: COLUMN invitation.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN notification.payload; Type: COMMENT; Schema: maevsi; Owner: postgres -- -COMMENT ON COLUMN maevsi.invitation.created_at IS '@omit create -Timestamp when the invitation was created. Defaults to the current timestamp.'; +COMMENT ON COLUMN maevsi.notification.payload IS 'The notification''s payload.'; -- --- Name: COLUMN invitation.created_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN notification.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres -- -COMMENT ON COLUMN maevsi.invitation.created_by IS '@omit create -Reference to the account that created the invitation.'; +COMMENT ON COLUMN maevsi.notification.created_at IS 'The timestamp of the notification''s creation.'; -- --- Name: COLUMN invitation.updated_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: invitation; Type: TABLE; Schema: maevsi; Owner: postgres +-- + +CREATE TABLE maevsi.invitation ( + guest_id uuid NOT NULL, + created_by uuid NOT NULL +) +INHERITS (maevsi.notification); + + +ALTER TABLE maevsi.invitation OWNER TO postgres; + +-- +-- Name: TABLE invitation; Type: COMMENT; Schema: maevsi; Owner: postgres -- -COMMENT ON COLUMN maevsi.invitation.updated_at IS '@omit create -Timestamp when the invitation was last updated.'; +COMMENT ON TABLE maevsi.invitation IS '@omit update,delete\nStores invitations and their statuses.'; + + +-- +-- Name: COLUMN invitation.guest_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- + +COMMENT ON COLUMN maevsi.invitation.guest_id IS 'The ID of the guest associated with this invitation.'; -- --- Name: COLUMN invitation.updated_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN invitation.created_by; Type: COMMENT; Schema: maevsi; Owner: postgres -- -COMMENT ON COLUMN maevsi.invitation.updated_by IS '@omit create -Reference to the account that last updated the invitation.'; +COMMENT ON COLUMN maevsi.invitation.created_by IS '@omit create +Reference to the account that created the invitation.'; -- @@ -4086,64 +4131,6 @@ COMMENT ON COLUMN maevsi_private.jwt.id IS 'The token''s id.'; COMMENT ON COLUMN maevsi_private.jwt.token IS 'The token.'; --- --- Name: notification; Type: TABLE; Schema: maevsi_private; Owner: postgres --- - -CREATE TABLE maevsi_private.notification ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - channel text NOT NULL, - is_acknowledged boolean, - payload text NOT NULL, - created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, - CONSTRAINT notification_payload_check CHECK ((octet_length(payload) <= 8000)) -); - - -ALTER TABLE maevsi_private.notification OWNER TO postgres; - --- --- Name: TABLE notification; Type: COMMENT; Schema: maevsi_private; Owner: postgres --- - -COMMENT ON TABLE maevsi_private.notification IS 'A notification.'; - - --- --- Name: COLUMN notification.id; Type: COMMENT; Schema: maevsi_private; Owner: postgres --- - -COMMENT ON COLUMN maevsi_private.notification.id IS 'The notification''s internal id.'; - - --- --- Name: COLUMN notification.channel; Type: COMMENT; Schema: maevsi_private; Owner: postgres --- - -COMMENT ON COLUMN maevsi_private.notification.channel IS 'The notification''s channel.'; - - --- --- Name: COLUMN notification.is_acknowledged; Type: COMMENT; Schema: maevsi_private; Owner: postgres --- - -COMMENT ON COLUMN maevsi_private.notification.is_acknowledged IS 'Whether the notification was acknowledged.'; - - --- --- Name: COLUMN notification.payload; Type: COMMENT; Schema: maevsi_private; Owner: postgres --- - -COMMENT ON COLUMN maevsi_private.notification.payload IS 'The notification''s payload.'; - - --- --- Name: COLUMN notification.created_at; Type: COMMENT; Schema: maevsi_private; Owner: postgres --- - -COMMENT ON COLUMN maevsi_private.notification.created_at IS 'The timestamp of the notification''s creation.'; - - -- -- Name: changes; Type: TABLE; Schema: sqitch; Owner: postgres -- @@ -4640,6 +4627,20 @@ COMMENT ON COLUMN sqitch.tags.planner_name IS 'Name of the user who planed the t COMMENT ON COLUMN sqitch.tags.planner_email IS 'Email address of the user who planned the tag.'; +-- +-- Name: invitation id; Type: DEFAULT; Schema: maevsi; Owner: postgres +-- + +ALTER TABLE ONLY maevsi.invitation ALTER COLUMN id SET DEFAULT gen_random_uuid(); + + +-- +-- Name: invitation created_at; Type: DEFAULT; Schema: maevsi; Owner: postgres +-- + +ALTER TABLE ONLY maevsi.invitation ALTER COLUMN created_at SET DEFAULT CURRENT_TIMESTAMP; + + -- -- Name: account_block account_block_created_by_blocked_account_id_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres -- @@ -4877,22 +4878,6 @@ ALTER TABLE ONLY maevsi.guest ADD CONSTRAINT guest_pkey PRIMARY KEY (id); --- --- Name: invitation invitation_guest_id_status_created_at_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres --- - -ALTER TABLE ONLY maevsi.invitation - ADD CONSTRAINT invitation_guest_id_status_created_at_key UNIQUE (guest_id, status, created_at); - - --- --- Name: invitation invitation_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres --- - -ALTER TABLE ONLY maevsi.invitation - ADD CONSTRAINT invitation_pkey PRIMARY KEY (id); - - -- -- Name: legal_term_acceptance legal_term_acceptance_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres -- @@ -4917,6 +4902,14 @@ ALTER TABLE ONLY maevsi.legal_term ADD CONSTRAINT legal_term_pkey PRIMARY KEY (id); +-- +-- Name: notification notification_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- + +ALTER TABLE ONLY maevsi.notification + ADD CONSTRAINT notification_pkey PRIMARY KEY (id); + + -- -- Name: profile_picture profile_picture_account_id_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres -- @@ -5020,14 +5013,6 @@ ALTER TABLE ONLY maevsi_private.jwt ADD CONSTRAINT jwt_token_key UNIQUE (token); --- --- Name: notification notification_pkey; Type: CONSTRAINT; Schema: maevsi_private; Owner: postgres --- - -ALTER TABLE ONLY maevsi_private.notification - ADD CONSTRAINT notification_pkey PRIMARY KEY (id); - - -- -- Name: changes changes_pkey; Type: CONSTRAINT; Schema: sqitch; Owner: postgres -- @@ -5261,13 +5246,6 @@ CREATE TRIGGER maevsi_trigger_contact_update_account_id BEFORE UPDATE OF account CREATE TRIGGER maevsi_trigger_event_search_vector BEFORE INSERT OR UPDATE OF name, description, language ON maevsi.event FOR EACH ROW EXECUTE FUNCTION maevsi.trigger_event_search_vector(); --- --- Name: invitation maevsi_trigger_invitation_update; Type: TRIGGER; Schema: maevsi; Owner: postgres --- - -CREATE TRIGGER maevsi_trigger_invitation_update BEFORE UPDATE ON maevsi.invitation FOR EACH ROW EXECUTE FUNCTION maevsi.trigger_metadata_update(); - - -- -- Name: account maevsi_private_account_email_address_verification_valid_until; Type: TRIGGER; Schema: maevsi_private; Owner: postgres -- @@ -5530,14 +5508,6 @@ ALTER TABLE ONLY maevsi.invitation ADD CONSTRAINT invitation_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES maevsi.guest(id); --- --- Name: invitation invitation_updated_by_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres --- - -ALTER TABLE ONLY maevsi.invitation - ADD CONSTRAINT invitation_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES maevsi.account(id); - - -- -- Name: legal_term_acceptance legal_term_acceptance_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres -- @@ -6100,10 +6070,7 @@ CREATE POLICY invitation_insert ON maevsi.invitation FOR INSERT WITH CHECK (((cr -- Name: invitation invitation_select; Type: POLICY; Schema: maevsi; Owner: postgres -- -CREATE POLICY invitation_select ON maevsi.invitation FOR SELECT USING ((maevsi.invoker_account_id() = ( SELECT e.created_by - FROM (maevsi.guest g - JOIN maevsi.event e ON ((g.event_id = e.id))) - WHERE (g.id = invitation.guest_id)))); +CREATE POLICY invitation_select ON maevsi.invitation FOR SELECT USING ((created_by = maevsi.invoker_account_id())); -- @@ -7075,6 +7042,20 @@ REVOKE ALL ON FUNCTION maevsi_test.guest_create(_created_by uuid, _event_id uuid REVOKE ALL ON FUNCTION maevsi_test.guest_test(_test_case text, _account_id uuid, _expected_result uuid[]) FROM PUBLIC; +-- +-- Name: FUNCTION invoker_set(_invoker_id uuid); Type: ACL; Schema: maevsi_test; Owner: postgres +-- + +REVOKE ALL ON FUNCTION maevsi_test.invoker_set(_invoker_id uuid) FROM PUBLIC; + + +-- +-- Name: FUNCTION invoker_unset(); Type: ACL; Schema: maevsi_test; Owner: postgres +-- + +REVOKE ALL ON FUNCTION maevsi_test.invoker_unset() FROM PUBLIC; + + -- -- Name: FUNCTION uuid_array_test(_test_case text, _array uuid[], _expected_array uuid[]); Type: ACL; Schema: maevsi_test; Owner: postgres -- From 4cd674582b0357bcde414fd6da2483a84a857e48 Mon Sep 17 00:00:00 2001 From: Sven Thelemann Date: Tue, 18 Mar 2025 23:07:00 +0100 Subject: [PATCH 4/5] chore(rename): rename maevsi to vibetype All occurrences of "maevsi" have been replaced by "vibetype". --- src/deploy/enum_achievement_type.sql | 4 +- src/deploy/enum_event_size.sql | 4 +- src/deploy/enum_event_visibility.sql | 4 +- src/deploy/enum_invitation_feedback.sql | 4 +- src/deploy/enum_invitation_feedback_paper.sql | 4 +- src/deploy/enum_language.sql | 4 +- src/deploy/enum_social_network.sql | 4 +- src/deploy/extension_postgis.sql | 2 +- src/deploy/function_account_block_ids.sql | 14 +- src/deploy/function_account_delete.sql | 12 +- ...ion_account_email_address_verification.sql | 12 +- .../function_account_password_change.sql | 10 +- .../function_account_password_reset.sql | 12 +- ...unction_account_password_reset_request.sql | 12 +- src/deploy/function_account_registration.sql | 22 +- .../function_account_registration_refresh.sql | 14 +- .../function_account_upload_quota_bytes.sql | 8 +- src/deploy/function_achievement_unlock.sql | 16 +- src/deploy/function_authenticate.sql | 28 +- src/deploy/function_event_delete.sql | 14 +- .../function_event_guest_count_maximum.sql | 16 +- src/deploy/function_event_is_existing.sql | 8 +- src/deploy/function_event_search.sql | 14 +- src/deploy/function_event_unlock.sql | 28 +- src/deploy/function_events_invited.sql | 16 +- src/deploy/function_events_organized.sql | 10 +- src/deploy/function_guest_claim_array.sql | 18 +- src/deploy/function_guest_contact_ids.sql | 18 +- src/deploy/function_guest_count.sql | 8 +- src/deploy/function_invite.sql | 26 +- src/deploy/function_invoker_account_id.sql | 6 +- src/deploy/function_jwt_refresh.sql | 20 +- ...function_language_iso_full_text_search.sql | 6 +- .../function_notification_acknowledge.sql | 8 +- src/deploy/function_profile_picture_set.sql | 8 +- src/deploy/function_test_utilities.sql | 124 +- .../function_trigger_metadata_update.sql | 8 +- src/deploy/function_upload_create.sql | 16 +- src/deploy/index_account_private_location.sql | 4 +- src/deploy/index_event_creator_username.sql | 4 +- .../index_event_group_creator_username.sql | 4 +- .../index_event_grouping_event_group_id.sql | 4 +- src/deploy/index_event_grouping_event_id.sql | 4 +- src/deploy/index_event_location.sql | 4 +- src/deploy/index_guest_contact_id.sql | 4 +- src/deploy/index_guest_event_id.sql | 4 +- src/deploy/role_account.sql | 6 +- src/deploy/role_anonymous.sql | 6 +- src/deploy/role_postgraphile.sql | 6 +- src/deploy/role_tusd.sql | 8 +- src/deploy/schema_private.sql | 4 +- src/deploy/schema_public.sql | 6 +- src/deploy/schema_test.sql | 6 +- src/deploy/table_account_block.sql | 16 +- src/deploy/table_account_block_policy.sql | 18 +- src/deploy/table_account_interest.sql | 12 +- src/deploy/table_account_interest_policy.sql | 16 +- .../table_account_preference_event_size.sql | 14 +- ...e_account_preference_event_size_policy.sql | 16 +- src/deploy/table_account_private.sql | 52 +- src/deploy/table_account_public.sql | 16 +- src/deploy/table_account_social_network.sql | 16 +- .../table_account_social_network_policy.sql | 18 +- src/deploy/table_achievement.sql | 22 +- src/deploy/table_achievement_code.sql | 18 +- src/deploy/table_address.sql | 40 +- src/deploy/table_address_policy.sql | 24 +- src/deploy/table_contact.sql | 62 +- src/deploy/table_contact_policy.sql | 42 +- src/deploy/table_event.sql | 64 +- src/deploy/table_event_category.sql | 6 +- src/deploy/table_event_category_mapping.sql | 12 +- .../table_event_category_mapping_policy.sql | 32 +- src/deploy/table_event_category_policy.sql | 2 +- src/deploy/table_event_favorite.sql | 18 +- src/deploy/table_event_favorite_policy.sql | 16 +- src/deploy/table_event_group.sql | 30 +- src/deploy/table_event_grouping.sql | 24 +- src/deploy/table_event_policy.sql | 32 +- src/deploy/table_event_recommendation.sql | 18 +- .../table_event_recommendation_policy.sql | 10 +- src/deploy/table_event_upload.sql | 14 +- src/deploy/table_event_upload_policy.sql | 26 +- src/deploy/table_guest.sql | 30 +- src/deploy/table_guest_policy.sql | 90 +- src/deploy/table_invitation.sql | 14 +- src/deploy/table_invitation_policy.sql | 18 +- src/deploy/table_jwt.sql | 10 +- src/deploy/table_legal_term.sql | 34 +- src/deploy/table_legal_term_acceptance.sql | 32 +- src/deploy/table_notification.sql | 14 +- src/deploy/table_profile_picture.sql | 44 +- src/deploy/table_report.sql | 32 +- src/deploy/table_report_policy.sql | 16 +- src/deploy/table_upload.sql | 20 +- src/deploy/table_upload_policy.sql | 26 +- src/deploy/test_location.sql | 52 +- src/deploy/type_event_unlock_response.sql | 4 +- src/deploy/type_jwt.sql | 2 +- src/deploy/view_guest_flat.sql | 12 +- src/revert/enum_achievement_type.sql | 2 +- src/revert/enum_event_size.sql | 2 +- src/revert/enum_event_visibility.sql | 2 +- src/revert/enum_invitation_feedback.sql | 2 +- src/revert/enum_invitation_feedback_paper.sql | 2 +- src/revert/enum_language.sql | 2 +- src/revert/enum_social_network.sql | 2 +- src/revert/extension_postgis.sql | 2 +- src/revert/function_account_block_ids.sql | 2 +- src/revert/function_account_delete.sql | 2 +- ...ion_account_email_address_verification.sql | 2 +- .../function_account_password_change.sql | 2 +- .../function_account_password_reset.sql | 2 +- ...unction_account_password_reset_request.sql | 2 +- src/revert/function_account_registration.sql | 2 +- .../function_account_registration_refresh.sql | 2 +- .../function_account_upload_quota_bytes.sql | 2 +- src/revert/function_achievement_unlock.sql | 2 +- src/revert/function_authenticate.sql | 2 +- src/revert/function_event_delete.sql | 2 +- .../function_event_guest_count_maximum.sql | 2 +- src/revert/function_event_is_existing.sql | 2 +- src/revert/function_event_search.sql | 2 +- src/revert/function_event_unlock.sql | 2 +- src/revert/function_events_invited.sql | 2 +- src/revert/function_events_organized.sql | 2 +- src/revert/function_guest_claim_array.sql | 2 +- src/revert/function_guest_contact_ids.sql | 2 +- src/revert/function_guest_count.sql | 2 +- src/revert/function_invite.sql | 2 +- src/revert/function_invoker_account_id.sql | 2 +- src/revert/function_jwt_refresh.sql | 2 +- ...function_language_iso_full_text_search.sql | 2 +- .../function_notification_acknowledge.sql | 2 +- src/revert/function_profile_picture_set.sql | 2 +- src/revert/function_test_utilities.sql | 36 +- .../function_trigger_metadata_update.sql | 2 +- src/revert/function_upload_create.sql | 2 +- src/revert/index_account_private_location.sql | 2 +- src/revert/index_event_creator_username.sql | 2 +- .../index_event_group_creator_username.sql | 2 +- .../index_event_grouping_event_group_id.sql | 2 +- src/revert/index_event_grouping_event_id.sql | 2 +- src/revert/index_event_location.sql | 2 +- src/revert/index_guest_contact_id.sql | 2 +- src/revert/index_guest_event_id.sql | 2 +- src/revert/role_account.sql | 2 +- src/revert/role_anonymous.sql | 2 +- src/revert/role_postgraphile.sql | 4 +- src/revert/role_tusd.sql | 4 +- src/revert/schema_private.sql | 2 +- src/revert/schema_public.sql | 2 +- src/revert/schema_test.sql | 2 +- src/revert/table_account_block.sql | 2 +- src/revert/table_account_block_policy.sql | 4 +- src/revert/table_account_interest.sql | 2 +- src/revert/table_account_interest_policy.sql | 6 +- .../table_account_preference_event_size.sql | 2 +- ...e_account_preference_event_size_policy.sql | 6 +- src/revert/table_account_private.sql | 10 +- src/revert/table_account_public.sql | 2 +- src/revert/table_account_social_network.sql | 2 +- .../table_account_social_network_policy.sql | 6 +- src/revert/table_achievement.sql | 4 +- src/revert/table_achievement_code.sql | 2 +- src/revert/table_address.sql | 4 +- src/revert/table_address_policy.sql | 8 +- src/revert/table_contact.sql | 6 +- src/revert/table_contact_policy.sql | 8 +- src/revert/table_event.sql | 6 +- src/revert/table_event_category.sql | 2 +- src/revert/table_event_category_mapping.sql | 2 +- .../table_event_category_mapping_policy.sql | 6 +- src/revert/table_event_favorite.sql | 2 +- src/revert/table_event_favorite_policy.sql | 6 +- src/revert/table_event_group.sql | 2 +- src/revert/table_event_grouping.sql | 2 +- src/revert/table_event_policy.sql | 6 +- src/revert/table_event_recommendation.sql | 2 +- .../table_event_recommendation_policy.sql | 2 +- src/revert/table_event_upload.sql | 2 +- src/revert/table_event_upload_policy.sql | 6 +- src/revert/table_guest.sql | 2 +- src/revert/table_guest_policy.sql | 12 +- src/revert/table_invitation.sql | 2 +- src/revert/table_invitation_policy.sql | 4 +- src/revert/table_jwt.sql | 2 +- src/revert/table_legal_term.sql | 10 +- src/revert/table_legal_term_acceptance.sql | 6 +- src/revert/table_notification.sql | 2 +- src/revert/table_profile_picture.sql | 2 +- src/revert/table_report.sql | 2 +- src/revert/table_report_policy.sql | 4 +- src/revert/table_upload.sql | 2 +- src/revert/table_upload_policy.sql | 6 +- src/revert/test_location.sql | 12 +- src/revert/type_event_unlock_response.sql | 2 +- src/revert/type_jwt.sql | 2 +- src/revert/view_guest_flat.sql | 2 +- src/verify/enum_achievement_type.sql | 2 +- src/verify/enum_event_size.sql | 2 +- src/verify/enum_event_visibility.sql | 2 +- src/verify/enum_invitation_feedback.sql | 2 +- src/verify/enum_invitation_feedback_paper.sql | 2 +- src/verify/enum_language.sql | 2 +- src/verify/enum_social_network.sql | 2 +- src/verify/extension_postgis.sql | 2 +- src/verify/function_account_block_ids.sql | 4 +- src/verify/function_account_delete.sql | 4 +- ...ion_account_email_address_verification.sql | 4 +- .../function_account_password_change.sql | 4 +- .../function_account_password_reset.sql | 4 +- ...unction_account_password_reset_request.sql | 4 +- src/verify/function_account_registration.sql | 28 +- .../function_account_registration_refresh.sql | 4 +- .../function_account_upload_quota_bytes.sql | 4 +- src/verify/function_achievement_unlock.sql | 4 +- src/verify/function_authenticate.sql | 68 +- src/verify/function_event_delete.sql | 4 +- .../function_event_guest_count_maximum.sql | 4 +- src/verify/function_event_is_existing.sql | 4 +- src/verify/function_event_search.sql | 8 +- src/verify/function_event_unlock.sql | 4 +- src/verify/function_events_invited.sql | 4 +- src/verify/function_events_organized.sql | 4 +- src/verify/function_guest_claim_array.sql | 4 +- src/verify/function_guest_contact_ids.sql | 4 +- src/verify/function_guest_count.sql | 4 +- src/verify/function_invite.sql | 4 +- src/verify/function_invoker_account_id.sql | 6 +- src/verify/function_jwt_refresh.sql | 4 +- ...function_language_iso_full_text_search.sql | 18 +- .../function_notification_acknowledge.sql | 4 +- src/verify/function_profile_picture_set.sql | 4 +- .../function_trigger_metadata_update.sql | 4 +- src/verify/function_upload_create.sql | 4 +- src/verify/index_account_private_location.sql | 2 +- src/verify/index_event_creator_username.sql | 2 +- .../index_event_group_creator_username.sql | 2 +- .../index_event_grouping_event_group_id.sql | 2 +- src/verify/index_event_grouping_event_id.sql | 2 +- src/verify/index_event_location.sql | 2 +- src/verify/index_guest_contact_id.sql | 2 +- src/verify/index_guest_event_id.sql | 2 +- src/verify/privilege_execute_revoke.sql | 2 +- src/verify/role_account.sql | 2 +- src/verify/role_anonymous.sql | 2 +- src/verify/role_postgraphile.sql | 2 +- src/verify/role_tusd.sql | 2 +- src/verify/schema_private.sql | 4 +- src/verify/schema_public.sql | 6 +- src/verify/schema_test.sql | 6 +- src/verify/table_account_block.sql | 2 +- src/verify/table_account_block_policy.sql | 24 +- src/verify/table_account_interest.sql | 2 +- src/verify/table_account_interest_policy.sql | 24 +- .../table_account_preference_event_size.sql | 2 +- ...e_account_preference_event_size_policy.sql | 24 +- src/verify/table_account_private.sql | 34 +- src/verify/table_account_public.sql | 26 +- src/verify/table_account_social_network.sql | 2 +- .../table_account_social_network_policy.sql | 64 +- src/verify/table_achievement.sql | 26 +- src/verify/table_achievement_code.sql | 26 +- src/verify/table_address.sql | 2 +- src/verify/table_address_policy.sql | 24 +- src/verify/table_contact.sql | 2 +- src/verify/table_contact_policy.sql | 24 +- src/verify/table_event.sql | 2 +- src/verify/table_event_category.sql | 2 +- src/verify/table_event_category_mapping.sql | 2 +- .../table_event_category_mapping_policy.sql | 24 +- src/verify/table_event_category_policy.sql | 24 +- src/verify/table_event_favorite.sql | 2 +- src/verify/table_event_favorite_policy.sql | 24 +- src/verify/table_event_group.sql | 26 +- src/verify/table_event_grouping.sql | 26 +- src/verify/table_event_policy.sql | 24 +- src/verify/table_event_recommendation.sql | 2 +- .../table_event_recommendation_policy.sql | 24 +- src/verify/table_event_upload.sql | 2 +- src/verify/table_event_upload_policy.sql | 24 +- src/verify/table_guest.sql | 2 +- src/verify/table_guest_policy.sql | 28 +- src/verify/table_invitation_policy.sql | 24 +- src/verify/table_jwt.sql | 26 +- src/verify/table_legal_term.sql | 30 +- src/verify/table_legal_term_acceptance.sql | 26 +- src/verify/table_notification.sql | 2 +- src/verify/table_profile_picture.sql | 26 +- src/verify/table_report.sql | 2 +- src/verify/table_report_policy.sql | 24 +- src/verify/table_upload.sql | 2 +- src/verify/table_upload_policy.sql | 24 +- src/verify/test_account_blocking.sql | 148 +- src/verify/test_invitation.sql | 16 +- src/verify/test_location.sql | 22 +- src/verify/type_event_unlock_response.sql | 2 +- src/verify/type_jwt.sql | 2 +- src/verify/view_guest_flat.sql | 2 +- test/schema/schema.definition.sql | 7328 ++++++++--------- 301 files changed, 5332 insertions(+), 5332 deletions(-) diff --git a/src/deploy/enum_achievement_type.sql b/src/deploy/enum_achievement_type.sql index cbe716fc..c10226e4 100644 --- a/src/deploy/enum_achievement_type.sql +++ b/src/deploy/enum_achievement_type.sql @@ -1,10 +1,10 @@ BEGIN; -CREATE TYPE maevsi.achievement_type AS ENUM ( +CREATE TYPE vibetype.achievement_type AS ENUM ( 'early_bird', 'meet_the_team' ); -COMMENT ON TYPE maevsi.achievement_type IS 'Achievements that can be unlocked by users.'; +COMMENT ON TYPE vibetype.achievement_type IS 'Achievements that can be unlocked by users.'; COMMIT; diff --git a/src/deploy/enum_event_size.sql b/src/deploy/enum_event_size.sql index b3af027c..c105fdb0 100644 --- a/src/deploy/enum_event_size.sql +++ b/src/deploy/enum_event_size.sql @@ -1,12 +1,12 @@ BEGIN; -CREATE TYPE maevsi.event_size AS ENUM ( +CREATE TYPE vibetype.event_size AS ENUM ( 'small', 'medium', 'large', 'huge' ); -COMMENT ON TYPE maevsi.event_size IS 'Possible event sizes: small, medium, large, huge.'; +COMMENT ON TYPE vibetype.event_size IS 'Possible event sizes: small, medium, large, huge.'; COMMIT; diff --git a/src/deploy/enum_event_visibility.sql b/src/deploy/enum_event_visibility.sql index 37dbf9c4..849b6bb1 100644 --- a/src/deploy/enum_event_visibility.sql +++ b/src/deploy/enum_event_visibility.sql @@ -1,11 +1,11 @@ BEGIN; -CREATE TYPE maevsi.event_visibility AS ENUM ( +CREATE TYPE vibetype.event_visibility AS ENUM ( 'public', 'private', 'unlisted' ); -COMMENT ON TYPE maevsi.event_visibility IS 'Possible visibilities of events and event groups: public, private and unlisted.'; +COMMENT ON TYPE vibetype.event_visibility IS 'Possible visibilities of events and event groups: public, private and unlisted.'; COMMIT; diff --git a/src/deploy/enum_invitation_feedback.sql b/src/deploy/enum_invitation_feedback.sql index dfdf76d7..d0535e81 100644 --- a/src/deploy/enum_invitation_feedback.sql +++ b/src/deploy/enum_invitation_feedback.sql @@ -1,10 +1,10 @@ BEGIN; -CREATE TYPE maevsi.invitation_feedback AS ENUM ( +CREATE TYPE vibetype.invitation_feedback AS ENUM ( 'accepted', 'canceled' ); -COMMENT ON TYPE maevsi.invitation_feedback IS 'Possible answers to an invitation: accepted, canceled.'; +COMMENT ON TYPE vibetype.invitation_feedback IS 'Possible answers to an invitation: accepted, canceled.'; COMMIT; diff --git a/src/deploy/enum_invitation_feedback_paper.sql b/src/deploy/enum_invitation_feedback_paper.sql index 64ec9c85..fc1ee9a4 100644 --- a/src/deploy/enum_invitation_feedback_paper.sql +++ b/src/deploy/enum_invitation_feedback_paper.sql @@ -1,11 +1,11 @@ BEGIN; -CREATE TYPE maevsi.invitation_feedback_paper AS ENUM ( +CREATE TYPE vibetype.invitation_feedback_paper AS ENUM ( 'none', 'paper', 'digital' ); -COMMENT ON TYPE maevsi.invitation_feedback_paper IS 'Possible choices on how to receive a paper invitation: none, paper, digital.'; +COMMENT ON TYPE vibetype.invitation_feedback_paper IS 'Possible choices on how to receive a paper invitation: none, paper, digital.'; COMMIT; diff --git a/src/deploy/enum_language.sql b/src/deploy/enum_language.sql index 56e7c109..eab0273a 100644 --- a/src/deploy/enum_language.sql +++ b/src/deploy/enum_language.sql @@ -1,10 +1,10 @@ BEGIN; -CREATE TYPE maevsi.language AS ENUM ( +CREATE TYPE vibetype.language AS ENUM ( 'de', 'en' ); -COMMENT ON TYPE maevsi.language IS 'Supported ISO 639 language codes.'; +COMMENT ON TYPE vibetype.language IS 'Supported ISO 639 language codes.'; COMMIT; diff --git a/src/deploy/enum_social_network.sql b/src/deploy/enum_social_network.sql index 5ea9d01e..c99bd1f4 100644 --- a/src/deploy/enum_social_network.sql +++ b/src/deploy/enum_social_network.sql @@ -1,12 +1,12 @@ BEGIN; -CREATE TYPE maevsi.social_network AS ENUM ( +CREATE TYPE vibetype.social_network AS ENUM ( 'facebook', 'instagram', 'tiktok', 'x' ); -COMMENT ON TYPE maevsi.social_network IS 'Social networks.'; +COMMENT ON TYPE vibetype.social_network IS 'Social networks.'; COMMIT; diff --git a/src/deploy/extension_postgis.sql b/src/deploy/extension_postgis.sql index f938fd0f..dee5c84a 100644 --- a/src/deploy/extension_postgis.sql +++ b/src/deploy/extension_postgis.sql @@ -13,6 +13,6 @@ GRANT EXECUTE ON FUNCTION st_coorddim(geometry), st_geomfromgeojson(text), st_srid(geography) -TO maevsi_anonymous, maevsi_account; +TO vibetype_anonymous, vibetype_account; COMMIT; diff --git a/src/deploy/function_account_block_ids.sql b/src/deploy/function_account_block_ids.sql index d91d1a4c..595314b0 100644 --- a/src/deploy/function_account_block_ids.sql +++ b/src/deploy/function_account_block_ids.sql @@ -1,23 +1,23 @@ BEGIN; -CREATE FUNCTION maevsi_private.account_block_ids() +CREATE FUNCTION vibetype_private.account_block_ids() RETURNS TABLE (id UUID) AS $$ BEGIN RETURN QUERY -- users blocked by the current user SELECT blocked_account_id - FROM maevsi.account_block - WHERE created_by = maevsi.invoker_account_id() + FROM vibetype.account_block + WHERE created_by = vibetype.invoker_account_id() UNION ALL -- users who blocked the current user SELECT created_by - FROM maevsi.account_block - WHERE blocked_account_id = maevsi.invoker_account_id(); + FROM vibetype.account_block + WHERE blocked_account_id = vibetype.invoker_account_id(); END $$ LANGUAGE PLPGSQL STRICT STABLE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi_private.account_block_ids() IS 'Returns all account ids being blocked by the invoker and all accounts that blocked the invoker.'; +COMMENT ON FUNCTION vibetype_private.account_block_ids() IS 'Returns all account ids being blocked by the invoker and all accounts that blocked the invoker.'; -GRANT EXECUTE ON FUNCTION maevsi_private.account_block_ids() TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype_private.account_block_ids() TO vibetype_account, vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_account_delete.sql b/src/deploy/function_account_delete.sql index 03a5b5b8..28662fa4 100644 --- a/src/deploy/function_account_delete.sql +++ b/src/deploy/function_account_delete.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE FUNCTION maevsi.account_delete( +CREATE FUNCTION vibetype.account_delete( "password" TEXT ) RETURNS VOID AS $$ DECLARE @@ -8,11 +8,11 @@ DECLARE BEGIN _current_account_id := current_setting('jwt.claims.account_id')::UUID; - IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($1, account.password_hash))) THEN - IF (EXISTS (SELECT 1 FROM maevsi.event WHERE event.created_by = _current_account_id)) THEN + IF (EXISTS (SELECT 1 FROM vibetype_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($1, account.password_hash))) THEN + IF (EXISTS (SELECT 1 FROM vibetype.event WHERE event.created_by = _current_account_id)) THEN RAISE 'You still own events!' USING ERRCODE = 'foreign_key_violation'; ELSE - DELETE FROM maevsi_private.account WHERE account.id = _current_account_id; + DELETE FROM vibetype_private.account WHERE account.id = _current_account_id; END IF; ELSE RAISE 'Account with given password not found!' USING ERRCODE = 'invalid_password'; @@ -20,8 +20,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.account_delete(TEXT) IS 'Allows to delete an account.'; +COMMENT ON FUNCTION vibetype.account_delete(TEXT) IS 'Allows to delete an account.'; -GRANT EXECUTE ON FUNCTION maevsi.account_delete(TEXT) TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.account_delete(TEXT) TO vibetype_account; COMMIT; diff --git a/src/deploy/function_account_email_address_verification.sql b/src/deploy/function_account_email_address_verification.sql index a211fc2b..16feaf4b 100644 --- a/src/deploy/function_account_email_address_verification.sql +++ b/src/deploy/function_account_email_address_verification.sql @@ -1,13 +1,13 @@ BEGIN; -CREATE FUNCTION maevsi.account_email_address_verification( +CREATE FUNCTION vibetype.account_email_address_verification( code UUID ) RETURNS VOID AS $$ DECLARE - _account maevsi_private.account; + _account vibetype_private.account; BEGIN SELECT * - FROM maevsi_private.account + FROM vibetype_private.account INTO _account WHERE account.email_address_verification = $1; @@ -19,14 +19,14 @@ BEGIN RAISE 'Verification code expired!' USING ERRCODE = 'object_not_in_prerequisite_state'; END IF; - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET email_address_verification = NULL WHERE email_address_verification = $1; END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.account_email_address_verification(UUID) IS 'Sets the account''s email address verification code to `NULL` for which the email address verification code equals the one passed and is up to date.'; +COMMENT ON FUNCTION vibetype.account_email_address_verification(UUID) IS 'Sets the account''s email address verification code to `NULL` for which the email address verification code equals the one passed and is up to date.'; -GRANT EXECUTE ON FUNCTION maevsi.account_email_address_verification(UUID) TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.account_email_address_verification(UUID) TO vibetype_account, vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_account_password_change.sql b/src/deploy/function_account_password_change.sql index 15324500..5b849171 100644 --- a/src/deploy/function_account_password_change.sql +++ b/src/deploy/function_account_password_change.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE FUNCTION maevsi.account_password_change( +CREATE FUNCTION vibetype.account_password_change( password_current TEXT, password_new TEXT ) RETURNS VOID AS $$ @@ -13,16 +13,16 @@ BEGIN _current_account_id := current_setting('jwt.claims.account_id')::UUID; - IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($1, account.password_hash))) THEN - UPDATE maevsi_private.account SET password_hash = crypt($2, gen_salt('bf')) WHERE account.id = _current_account_id; + IF (EXISTS (SELECT 1 FROM vibetype_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($1, account.password_hash))) THEN + UPDATE vibetype_private.account SET password_hash = crypt($2, gen_salt('bf')) WHERE account.id = _current_account_id; ELSE RAISE 'Account with given password not found!' USING ERRCODE = 'invalid_password'; END IF; END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.account_password_change(TEXT, TEXT) IS 'Allows to change an account''s password.'; +COMMENT ON FUNCTION vibetype.account_password_change(TEXT, TEXT) IS 'Allows to change an account''s password.'; -GRANT EXECUTE ON FUNCTION maevsi.account_password_change(TEXT, TEXT) TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.account_password_change(TEXT, TEXT) TO vibetype_account; COMMIT; diff --git a/src/deploy/function_account_password_reset.sql b/src/deploy/function_account_password_reset.sql index c925390a..993812f5 100644 --- a/src/deploy/function_account_password_reset.sql +++ b/src/deploy/function_account_password_reset.sql @@ -1,18 +1,18 @@ BEGIN; -CREATE FUNCTION maevsi.account_password_reset( +CREATE FUNCTION vibetype.account_password_reset( code UUID, "password" TEXT ) RETURNS VOID AS $$ DECLARE - _account maevsi_private.account; + _account vibetype_private.account; BEGIN IF (char_length($2) < 8) THEN RAISE 'Password too short!' USING ERRCODE = 'invalid_parameter_value'; END IF; SELECT * - FROM maevsi_private.account + FROM vibetype_private.account INTO _account WHERE account.password_reset_verification = $1; @@ -24,7 +24,7 @@ BEGIN RAISE 'Reset code expired!' USING ERRCODE = 'object_not_in_prerequisite_state'; END IF; - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET password_hash = crypt($2, gen_salt('bf')), password_reset_verification = NULL @@ -32,8 +32,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.account_password_reset(UUID, TEXT) IS 'Sets a new password for an account if there was a request to do so before that''s still up to date.'; +COMMENT ON FUNCTION vibetype.account_password_reset(UUID, TEXT) IS 'Sets a new password for an account if there was a request to do so before that''s still up to date.'; -GRANT EXECUTE ON FUNCTION maevsi.account_password_reset(UUID, TEXT) TO maevsi_anonymous, maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.account_password_reset(UUID, TEXT) TO vibetype_anonymous, vibetype_account; COMMIT; diff --git a/src/deploy/function_account_password_reset_request.sql b/src/deploy/function_account_password_reset_request.sql index 00e0bb43..6875cae1 100644 --- a/src/deploy/function_account_password_reset_request.sql +++ b/src/deploy/function_account_password_reset_request.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE FUNCTION maevsi.account_password_reset_request( +CREATE FUNCTION vibetype.account_password_reset_request( email_address TEXT, "language" TEXT ) RETURNS VOID AS $$ @@ -8,7 +8,7 @@ DECLARE _notify_data RECORD; BEGIN WITH updated AS ( - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET password_reset_verification = gen_random_uuid() WHERE account.email_address = $1 RETURNING * @@ -17,14 +17,14 @@ BEGIN updated.email_address, updated.password_reset_verification, updated.password_reset_verification_valid_until - FROM updated, maevsi.account + FROM updated, vibetype.account WHERE updated.id = account.id INTO _notify_data; IF (_notify_data IS NULL) THEN -- noop ELSE - INSERT INTO maevsi.notification (channel, payload) VALUES ( + INSERT INTO vibetype.notification (channel, payload) VALUES ( 'account_password_reset_request', jsonb_pretty(jsonb_build_object( 'account', _notify_data, @@ -35,8 +35,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.account_password_reset_request(TEXT, TEXT) IS 'Sets a new password reset verification code for an account.'; +COMMENT ON FUNCTION vibetype.account_password_reset_request(TEXT, TEXT) IS 'Sets a new password reset verification code for an account.'; -GRANT EXECUTE ON FUNCTION maevsi.account_password_reset_request(TEXT, TEXT) TO maevsi_anonymous, maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.account_password_reset_request(TEXT, TEXT) TO vibetype_anonymous, vibetype_account; COMMIT; diff --git a/src/deploy/function_account_registration.sql b/src/deploy/function_account_registration.sql index 75b570c9..d1d2eba4 100644 --- a/src/deploy/function_account_registration.sql +++ b/src/deploy/function_account_registration.sql @@ -1,33 +1,33 @@ BEGIN; -CREATE FUNCTION maevsi.account_registration( +CREATE FUNCTION vibetype.account_registration( username TEXT, email_address TEXT, "password" TEXT, "language" TEXT ) RETURNS UUID AS $$ DECLARE - _new_account_private maevsi_private.account; - _new_account_public maevsi.account; + _new_account_private vibetype_private.account; + _new_account_public vibetype.account; _new_account_notify RECORD; BEGIN IF (char_length(account_registration.password) < 8) THEN RAISE 'Password too short!' USING ERRCODE = 'invalid_parameter_value'; END IF; - IF (EXISTS (SELECT 1 FROM maevsi.account WHERE account.username = account_registration.username)) THEN + IF (EXISTS (SELECT 1 FROM vibetype.account WHERE account.username = account_registration.username)) THEN RAISE 'An account with this username already exists!' USING ERRCODE = 'unique_violation'; END IF; - IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.email_address = account_registration.email_address)) THEN + IF (EXISTS (SELECT 1 FROM vibetype_private.account WHERE account.email_address = account_registration.email_address)) THEN RAISE 'An account with this email address already exists!' USING ERRCODE = 'unique_violation'; END IF; - INSERT INTO maevsi_private.account(email_address, password_hash, last_activity) VALUES + INSERT INTO vibetype_private.account(email_address, password_hash, last_activity) VALUES (account_registration.email_address, crypt(account_registration.password, gen_salt('bf')), CURRENT_TIMESTAMP) RETURNING * INTO _new_account_private; - INSERT INTO maevsi.account(id, username) VALUES + INSERT INTO vibetype.account(id, username) VALUES (_new_account_private.id, account_registration.username) RETURNING * INTO _new_account_public; @@ -38,9 +38,9 @@ BEGIN _new_account_private.email_address_verification_valid_until INTO _new_account_notify; - INSERT INTO maevsi.contact(account_id, created_by) VALUES (_new_account_private.id, _new_account_private.id); + INSERT INTO vibetype.contact(account_id, created_by) VALUES (_new_account_private.id, _new_account_private.id); - INSERT INTO maevsi.notification (channel, payload) VALUES ( + INSERT INTO vibetype.notification (channel, payload) VALUES ( 'account_registration', jsonb_pretty(jsonb_build_object( 'account', row_to_json(_new_account_notify), @@ -52,8 +52,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.account_registration(TEXT, TEXT, TEXT, TEXT) IS 'Creates a contact and registers an account referencing it.'; +COMMENT ON FUNCTION vibetype.account_registration(TEXT, TEXT, TEXT, TEXT) IS 'Creates a contact and registers an account referencing it.'; -GRANT EXECUTE ON FUNCTION maevsi.account_registration(TEXT, TEXT, TEXT, TEXT) TO maevsi_anonymous, maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.account_registration(TEXT, TEXT, TEXT, TEXT) TO vibetype_anonymous, vibetype_account; COMMIT; diff --git a/src/deploy/function_account_registration_refresh.sql b/src/deploy/function_account_registration_refresh.sql index 2d77f25a..0622d69a 100644 --- a/src/deploy/function_account_registration_refresh.sql +++ b/src/deploy/function_account_registration_refresh.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE FUNCTION maevsi.account_registration_refresh( +CREATE FUNCTION vibetype.account_registration_refresh( account_id UUID, "language" TEXT ) RETURNS VOID AS $$ @@ -9,12 +9,12 @@ DECLARE BEGIN RAISE 'Refreshing registrations is currently not available due to missing rate limiting!' USING ERRCODE = 'deprecated_feature'; - IF (NOT EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = $1)) THEN + IF (NOT EXISTS (SELECT 1 FROM vibetype_private.account WHERE account.id = $1)) THEN RAISE 'An account with this account id does not exist!' USING ERRCODE = 'invalid_parameter_value'; END IF; WITH updated AS ( - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET email_address_verification = DEFAULT WHERE account.id = $1 RETURNING * @@ -24,9 +24,9 @@ BEGIN updated.email_address_verification, updated.email_address_verification_valid_until INTO _new_account_notify - FROM updated JOIN maevsi.account ON updated.id = account.id; + FROM updated JOIN vibetype.account ON updated.id = account.id; - INSERT INTO maevsi_private.notification (channel, payload) VALUES ( + INSERT INTO vibetype_private.notification (channel, payload) VALUES ( 'account_registration', jsonb_pretty(jsonb_build_object( 'account', row_to_json(_new_account_notify), @@ -36,8 +36,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.account_registration_refresh(UUID, TEXT) IS 'Refreshes an account''s email address verification validity period.'; +COMMENT ON FUNCTION vibetype.account_registration_refresh(UUID, TEXT) IS 'Refreshes an account''s email address verification validity period.'; -GRANT EXECUTE ON FUNCTION maevsi.account_registration_refresh(UUID, TEXT) TO maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.account_registration_refresh(UUID, TEXT) TO vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_account_upload_quota_bytes.sql b/src/deploy/function_account_upload_quota_bytes.sql index a001ff9c..4bc22449 100644 --- a/src/deploy/function_account_upload_quota_bytes.sql +++ b/src/deploy/function_account_upload_quota_bytes.sql @@ -1,13 +1,13 @@ BEGIN; -CREATE FUNCTION maevsi.account_upload_quota_bytes() RETURNS BIGINT AS $$ +CREATE FUNCTION vibetype.account_upload_quota_bytes() RETURNS BIGINT AS $$ BEGIN - RETURN (SELECT upload_quota_bytes FROM maevsi_private.account WHERE account.id = current_setting('jwt.claims.account_id')::UUID); + RETURN (SELECT upload_quota_bytes FROM vibetype_private.account WHERE account.id = current_setting('jwt.claims.account_id')::UUID); END; $$ LANGUAGE PLPGSQL STRICT STABLE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.account_upload_quota_bytes() IS 'Gets the total upload quota in bytes for the invoking account.'; +COMMENT ON FUNCTION vibetype.account_upload_quota_bytes() IS 'Gets the total upload quota in bytes for the invoking account.'; -GRANT EXECUTE ON FUNCTION maevsi.account_upload_quota_bytes() TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.account_upload_quota_bytes() TO vibetype_account; COMMIT; diff --git a/src/deploy/function_achievement_unlock.sql b/src/deploy/function_achievement_unlock.sql index 773d87ba..b17672f0 100644 --- a/src/deploy/function_achievement_unlock.sql +++ b/src/deploy/function_achievement_unlock.sql @@ -1,18 +1,18 @@ BEGIN; -CREATE FUNCTION maevsi.achievement_unlock( +CREATE FUNCTION vibetype.achievement_unlock( code UUID, alias TEXT ) RETURNS UUID AS $$ DECLARE _account_id UUID; - _achievement maevsi.achievement_type; + _achievement vibetype.achievement_type; _achievement_id UUID; BEGIN - _account_id := maevsi.invoker_account_id(); + _account_id := vibetype.invoker_account_id(); SELECT achievement - FROM maevsi_private.achievement_code + FROM vibetype_private.achievement_code INTO _achievement WHERE achievement_code.id = $1 OR achievement_code.alias = $2; @@ -25,12 +25,12 @@ BEGIN END IF; _achievement_id := ( - SELECT id FROM maevsi.achievement + SELECT id FROM vibetype.achievement WHERE achievement.account_id = _account_id AND achievement.achievement = _achievement ); IF (_achievement_id IS NULL) THEN - INSERT INTO maevsi.achievement(account_id, achievement) + INSERT INTO vibetype.achievement(account_id, achievement) VALUES (_account_id, _achievement) RETURNING achievement.id INTO _achievement_id; END IF; @@ -39,8 +39,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.achievement_unlock(UUID, TEXT) IS 'Inserts an achievement unlock for the user that gave an existing achievement code.'; +COMMENT ON FUNCTION vibetype.achievement_unlock(UUID, TEXT) IS 'Inserts an achievement unlock for the user that gave an existing achievement code.'; -GRANT EXECUTE ON FUNCTION maevsi.achievement_unlock(UUID, TEXT) TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.achievement_unlock(UUID, TEXT) TO vibetype_account; COMMIT; diff --git a/src/deploy/function_authenticate.sql b/src/deploy/function_authenticate.sql index 0d3355d8..7c881df6 100644 --- a/src/deploy/function_authenticate.sql +++ b/src/deploy/function_authenticate.sql @@ -1,36 +1,36 @@ BEGIN; -CREATE FUNCTION maevsi.authenticate( +CREATE FUNCTION vibetype.authenticate( username TEXT, password TEXT -) RETURNS maevsi.jwt AS $$ +) RETURNS vibetype.jwt AS $$ DECLARE _account_id UUID; _jwt_id UUID := gen_random_uuid(); - _jwt_exp BIGINT := EXTRACT(EPOCH FROM ((SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP WITH TIME ZONE)) + COALESCE(current_setting('maevsi.jwt_expiry_duration', true), '1 day')::INTERVAL)); - _jwt maevsi.jwt; + _jwt_exp BIGINT := EXTRACT(EPOCH FROM ((SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP WITH TIME ZONE)) + COALESCE(current_setting('vibetype.jwt_expiry_duration', true), '1 day')::INTERVAL)); + _jwt vibetype.jwt; _username TEXT; BEGIN IF (authenticate.username = '' AND authenticate.password = '') THEN -- Authenticate as guest. - _jwt := (_jwt_id, NULL, NULL, _jwt_exp, maevsi.guest_claim_array(), 'maevsi_anonymous')::maevsi.jwt; + _jwt := (_jwt_id, NULL, NULL, _jwt_exp, vibetype.guest_claim_array(), 'vibetype_anonymous')::vibetype.jwt; ELSIF (authenticate.username IS NOT NULL AND authenticate.password IS NOT NULL) THEN -- if authenticate.username contains @ then treat it as an email adress otherwise as a user name IF (strpos(authenticate.username, '@') = 0) THEN - SELECT id FROM maevsi.account WHERE account.username = authenticate.username INTO _account_id; + SELECT id FROM vibetype.account WHERE account.username = authenticate.username INTO _account_id; ELSE - SELECT id FROM maevsi_private.account WHERE account.email_address = authenticate.username INTO _account_id; + SELECT id FROM vibetype_private.account WHERE account.email_address = authenticate.username INTO _account_id; END IF; IF (_account_id IS NULL) THEN RAISE 'Account not found!' USING ERRCODE = 'no_data_found'; END IF; - SELECT account.username INTO _username FROM maevsi.account WHERE id = _account_id; + SELECT account.username INTO _username FROM vibetype.account WHERE id = _account_id; IF (( SELECT account.email_address_verification - FROM maevsi_private.account + FROM vibetype_private.account WHERE account.id = _account_id AND account.password_hash = crypt(authenticate.password, account.password_hash) @@ -39,14 +39,14 @@ BEGIN END IF; WITH updated AS ( - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET (last_activity, password_reset_verification) = (DEFAULT, NULL) WHERE account.id = _account_id AND account.email_address_verification IS NULL -- Has been checked before, but better safe than sorry. AND account.password_hash = crypt(authenticate.password, account.password_hash) RETURNING * - ) SELECT _jwt_id, updated.id, _username, _jwt_exp, NULL, 'maevsi_account' + ) SELECT _jwt_id, updated.id, _username, _jwt_exp, NULL, 'vibetype_account' FROM updated INTO _jwt; @@ -55,13 +55,13 @@ BEGIN END IF; END IF; - INSERT INTO maevsi_private.jwt(id, token) VALUES (_jwt_id, _jwt); + INSERT INTO vibetype_private.jwt(id, token) VALUES (_jwt_id, _jwt); RETURN _jwt; END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.authenticate(TEXT, TEXT) IS 'Creates a JWT token that will securely identify an account and give it certain permissions.'; +COMMENT ON FUNCTION vibetype.authenticate(TEXT, TEXT) IS 'Creates a JWT token that will securely identify an account and give it certain permissions.'; -GRANT EXECUTE ON FUNCTION maevsi.authenticate(TEXT, TEXT) TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.authenticate(TEXT, TEXT) TO vibetype_account, vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_event_delete.sql b/src/deploy/function_event_delete.sql index 4ec721e4..6b959cab 100644 --- a/src/deploy/function_event_delete.sql +++ b/src/deploy/function_event_delete.sql @@ -1,18 +1,18 @@ BEGIN; -CREATE FUNCTION maevsi.event_delete( +CREATE FUNCTION vibetype.event_delete( id UUID, "password" TEXT -) RETURNS maevsi.event AS $$ +) RETURNS vibetype.event AS $$ DECLARE _current_account_id UUID; - _event_deleted maevsi.event; + _event_deleted vibetype.event; BEGIN _current_account_id := current_setting('jwt.claims.account_id')::UUID; - IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($2, account.password_hash))) THEN + IF (EXISTS (SELECT 1 FROM vibetype_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($2, account.password_hash))) THEN DELETE - FROM maevsi.event + FROM vibetype.event WHERE "event".id = $1 AND "event".created_by = _current_account_id @@ -29,8 +29,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.event_delete(UUID, TEXT) IS 'Allows to delete an event.'; +COMMENT ON FUNCTION vibetype.event_delete(UUID, TEXT) IS 'Allows to delete an event.'; -GRANT EXECUTE ON FUNCTION maevsi.event_delete(UUID, TEXT) TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.event_delete(UUID, TEXT) TO vibetype_account; COMMIT; diff --git a/src/deploy/function_event_guest_count_maximum.sql b/src/deploy/function_event_guest_count_maximum.sql index 321ad802..b865f3de 100644 --- a/src/deploy/function_event_guest_count_maximum.sql +++ b/src/deploy/function_event_guest_count_maximum.sql @@ -1,12 +1,12 @@ BEGIN; -CREATE FUNCTION maevsi.event_guest_count_maximum( +CREATE FUNCTION vibetype.event_guest_count_maximum( event_id UUID ) RETURNS INTEGER AS $$ BEGIN RETURN ( SELECT guest_count_maximum - FROM maevsi.event + FROM vibetype.event WHERE id = $1 AND ( -- Copied from `event_select` POLICY. @@ -16,22 +16,22 @@ BEGIN ( guest_count_maximum IS NULL OR - guest_count_maximum > (maevsi.guest_count(id)) -- Using the function here is required as there would otherwise be infinite recursion. + guest_count_maximum > (vibetype.guest_count(id)) -- Using the function here is required as there would otherwise be infinite recursion. ) ) OR ( - maevsi.invoker_account_id() IS NOT NULL + vibetype.invoker_account_id() IS NOT NULL AND - created_by = maevsi.invoker_account_id() + created_by = vibetype.invoker_account_id() ) - OR id IN (SELECT maevsi_private.events_invited()) + OR id IN (SELECT vibetype_private.events_invited()) ) ); END $$ LANGUAGE PLPGSQL STRICT STABLE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.event_guest_count_maximum(UUID) IS 'Add a function that returns the maximum guest count of an accessible event.'; +COMMENT ON FUNCTION vibetype.event_guest_count_maximum(UUID) IS 'Add a function that returns the maximum guest count of an accessible event.'; -GRANT EXECUTE ON FUNCTION maevsi.event_guest_count_maximum(UUID) TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.event_guest_count_maximum(UUID) TO vibetype_account, vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_event_is_existing.sql b/src/deploy/function_event_is_existing.sql index f5822977..c6364fee 100644 --- a/src/deploy/function_event_is_existing.sql +++ b/src/deploy/function_event_is_existing.sql @@ -1,11 +1,11 @@ BEGIN; -CREATE FUNCTION maevsi.event_is_existing( +CREATE FUNCTION vibetype.event_is_existing( created_by UUID, slug TEXT ) RETURNS BOOLEAN AS $$ BEGIN - IF (EXISTS (SELECT 1 FROM maevsi.event WHERE "event".created_by = $1 AND "event".slug = $2)) THEN + IF (EXISTS (SELECT 1 FROM vibetype.event WHERE "event".created_by = $1 AND "event".slug = $2)) THEN RETURN TRUE; ELSE RETURN FALSE; @@ -13,8 +13,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT STABLE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.event_is_existing(UUID, TEXT) IS 'Shows if an event exists.'; +COMMENT ON FUNCTION vibetype.event_is_existing(UUID, TEXT) IS 'Shows if an event exists.'; -GRANT EXECUTE ON FUNCTION maevsi.event_is_existing(UUID, TEXT) TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.event_is_existing(UUID, TEXT) TO vibetype_account, vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_event_search.sql b/src/deploy/function_event_search.sql index b33da0df..2f0b8d69 100644 --- a/src/deploy/function_event_search.sql +++ b/src/deploy/function_event_search.sql @@ -1,19 +1,19 @@ BEGIN; -CREATE FUNCTION maevsi.event_search( +CREATE FUNCTION vibetype.event_search( query TEXT, - language maevsi.language -) RETURNS SETOF maevsi.event AS $$ + language vibetype.language +) RETURNS SETOF vibetype.event AS $$ DECLARE ts_config regconfig; BEGIN - ts_config := maevsi.language_iso_full_text_search(event_search.language); + ts_config := vibetype.language_iso_full_text_search(event_search.language); RETURN QUERY SELECT * FROM - maevsi.event + vibetype.event WHERE search_vector @@ websearch_to_tsquery(ts_config, event_search.query) ORDER BY @@ -21,8 +21,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STABLE SECURITY INVOKER; -COMMENT ON FUNCTION maevsi.event_search(TEXT, maevsi.language) IS 'Performs a full-text search on the event table based on the provided query and language, returning event IDs ordered by relevance.'; +COMMENT ON FUNCTION vibetype.event_search(TEXT, vibetype.language) IS 'Performs a full-text search on the event table based on the provided query and language, returning event IDs ordered by relevance.'; -GRANT EXECUTE ON FUNCTION maevsi.event_search(TEXT, maevsi.language) TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.event_search(TEXT, vibetype.language) TO vibetype_account, vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_event_unlock.sql b/src/deploy/function_event_unlock.sql index 302b5f91..65b4e2bf 100644 --- a/src/deploy/function_event_unlock.sql +++ b/src/deploy/function_event_unlock.sql @@ -1,31 +1,31 @@ BEGIN; -CREATE FUNCTION maevsi.event_unlock( +CREATE FUNCTION vibetype.event_unlock( guest_id UUID -) RETURNS maevsi.event_unlock_response AS $$ +) RETURNS vibetype.event_unlock_response AS $$ DECLARE _jwt_id UUID; - _jwt maevsi.jwt; - _event maevsi.event; + _jwt vibetype.jwt; + _event vibetype.event; _event_creator_account_username TEXT; _event_id UUID; BEGIN _jwt_id := current_setting('jwt.claims.id', true)::UUID; _jwt := ( _jwt_id, - maevsi.invoker_account_id(), -- prevent empty string cast to UUID + vibetype.invoker_account_id(), -- prevent empty string cast to UUID current_setting('jwt.claims.account_username', true)::TEXT, current_setting('jwt.claims.exp', true)::BIGINT, - (SELECT ARRAY(SELECT DISTINCT UNNEST(maevsi.guest_claim_array() || $1) ORDER BY 1)), + (SELECT ARRAY(SELECT DISTINCT UNNEST(vibetype.guest_claim_array() || $1) ORDER BY 1)), current_setting('jwt.claims.role', true)::TEXT - )::maevsi.jwt; + )::vibetype.jwt; - UPDATE maevsi_private.jwt + UPDATE vibetype_private.jwt SET token = _jwt WHERE id = _jwt_id; _event_id := ( - SELECT event_id FROM maevsi.guest + SELECT event_id FROM vibetype.guest WHERE guest.id = $1 ); @@ -34,7 +34,7 @@ BEGIN END IF; SELECT * - FROM maevsi.event + FROM vibetype.event WHERE id = _event_id INTO _event; @@ -44,7 +44,7 @@ BEGIN _event_creator_account_username := ( SELECT username - FROM maevsi.account + FROM vibetype.account WHERE id = _event.created_by ); @@ -52,11 +52,11 @@ BEGIN RAISE 'No event creator username for this guest id found!' USING ERRCODE = 'no_data_found'; END IF; - RETURN (_event_creator_account_username, _event.slug, _jwt)::maevsi.event_unlock_response; + RETURN (_event_creator_account_username, _event.slug, _jwt)::vibetype.event_unlock_response; END $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.event_unlock(UUID) IS 'Adds a guest claim to the current session.'; +COMMENT ON FUNCTION vibetype.event_unlock(UUID) IS 'Adds a guest claim to the current session.'; -GRANT EXECUTE ON FUNCTION maevsi.event_unlock(UUID) TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.event_unlock(UUID) TO vibetype_account, vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_events_invited.sql b/src/deploy/function_events_invited.sql index a7272676..e5e8db70 100644 --- a/src/deploy/function_events_invited.sql +++ b/src/deploy/function_events_invited.sql @@ -1,36 +1,36 @@ BEGIN; -CREATE FUNCTION maevsi_private.events_invited() +CREATE FUNCTION vibetype_private.events_invited() RETURNS TABLE(event_id uuid) AS $$ BEGIN RETURN QUERY -- get all events for guests - SELECT guest.event_id FROM maevsi.guest + SELECT guest.event_id FROM vibetype.guest WHERE ( -- whose guest guest.contact_id IN ( SELECT id - FROM maevsi.contact + FROM vibetype.contact WHERE -- is the requesting user - account_id = maevsi.invoker_account_id() -- if the invoker account id is `NULL` this does *not* return contacts for which `account_id` is NULL (an `IS` instead of `=` comparison would) + account_id = vibetype.invoker_account_id() -- if the invoker account id is `NULL` this does *not* return contacts for which `account_id` is NULL (an `IS` instead of `=` comparison would) AND -- who is not invited by created_by NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) ) -- TODO: it appears blocking should be accounted for after all other criteria using the event author instead ) OR -- for which the requesting user knows the id - guest.id = ANY (maevsi.guest_claim_array()); + guest.id = ANY (vibetype.guest_claim_array()); END $$ LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi_private.events_invited() IS 'Add a function that returns all event ids for which the invoker is invited.'; +COMMENT ON FUNCTION vibetype_private.events_invited() IS 'Add a function that returns all event ids for which the invoker is invited.'; -GRANT EXECUTE ON FUNCTION maevsi_private.events_invited() TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype_private.events_invited() TO vibetype_account, vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_events_organized.sql b/src/deploy/function_events_organized.sql index 0a29933e..2c395116 100644 --- a/src/deploy/function_events_organized.sql +++ b/src/deploy/function_events_organized.sql @@ -1,18 +1,18 @@ BEGIN; -CREATE FUNCTION maevsi.events_organized() +CREATE FUNCTION vibetype.events_organized() RETURNS TABLE (event_id UUID) AS $$ BEGIN RETURN QUERY - SELECT id FROM maevsi.event + SELECT id FROM vibetype.event WHERE - created_by = maevsi.invoker_account_id(); + created_by = vibetype.invoker_account_id(); END $$ LANGUAGE PLPGSQL STRICT STABLE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.events_organized() IS 'Add a function that returns all event ids for which the invoker is the creator.'; +COMMENT ON FUNCTION vibetype.events_organized() IS 'Add a function that returns all event ids for which the invoker is the creator.'; -GRANT EXECUTE ON FUNCTION maevsi.events_organized() TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.events_organized() TO vibetype_account, vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_guest_claim_array.sql b/src/deploy/function_guest_claim_array.sql index f1fa1499..a0ec6ff3 100644 --- a/src/deploy/function_guest_claim_array.sql +++ b/src/deploy/function_guest_claim_array.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE FUNCTION maevsi.guest_claim_array() +CREATE FUNCTION vibetype.guest_claim_array() RETURNS UUID[] AS $$ DECLARE _guest_ids UUID[]; @@ -11,22 +11,22 @@ BEGIN IF _guest_ids IS NOT NULL THEN _guest_ids_unblocked := ARRAY ( SELECT g.id - FROM maevsi.guest g - JOIN maevsi.event e ON g.event_id = e.id - JOIN maevsi.contact c ON g.contact_id = c.id + FROM vibetype.guest g + JOIN vibetype.event e ON g.event_id = e.id + JOIN vibetype.contact c ON g.contact_id = c.id WHERE g.id = ANY(_guest_ids) AND e.created_by NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) AND ( c.created_by NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) AND ( c.account_id IS NULL OR c.account_id NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) ) ) @@ -38,8 +38,8 @@ BEGIN END $$ LANGUAGE PLPGSQL STRICT STABLE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.guest_claim_array() IS 'Returns the current guest claims as UUID array.'; +COMMENT ON FUNCTION vibetype.guest_claim_array() IS 'Returns the current guest claims as UUID array.'; -GRANT EXECUTE ON FUNCTION maevsi.guest_claim_array() TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.guest_claim_array() TO vibetype_account, vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_guest_contact_ids.sql b/src/deploy/function_guest_contact_ids.sql index 922e774c..601b9004 100644 --- a/src/deploy/function_guest_contact_ids.sql +++ b/src/deploy/function_guest_contact_ids.sql @@ -1,41 +1,41 @@ BEGIN; -CREATE FUNCTION maevsi.guest_contact_ids() +CREATE FUNCTION vibetype.guest_contact_ids() RETURNS TABLE (contact_id UUID) AS $$ BEGIN RETURN QUERY -- get all contacts for guests SELECT guest.contact_id - FROM maevsi.guest + FROM vibetype.guest WHERE ( -- that are known to the invoker - guest.id = ANY (maevsi.guest_claim_array()) + guest.id = ANY (vibetype.guest_claim_array()) OR -- or for events organized by the invoker - guest.event_id IN (SELECT maevsi.events_organized()) + guest.event_id IN (SELECT vibetype.events_organized()) ) AND -- except contacts created by a blocked account or referring to a blocked account guest.contact_id NOT IN ( SELECT contact.id - FROM maevsi.contact + FROM vibetype.contact WHERE contact.account_id IS NULL -- TODO: evaluate if this null check is necessary OR contact.account_id IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) OR contact.created_by IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) ); END; $$ LANGUAGE PLPGSQL STRICT STABLE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.guest_contact_ids() IS 'Returns contact ids that are accessible through guests.'; +COMMENT ON FUNCTION vibetype.guest_contact_ids() IS 'Returns contact ids that are accessible through guests.'; -GRANT EXECUTE ON FUNCTION maevsi.guest_contact_ids() TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.guest_contact_ids() TO vibetype_account, vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_guest_count.sql b/src/deploy/function_guest_count.sql index bc94dd9d..e8b21eaa 100644 --- a/src/deploy/function_guest_count.sql +++ b/src/deploy/function_guest_count.sql @@ -1,14 +1,14 @@ BEGIN; -CREATE FUNCTION maevsi.guest_count(event_id UUID) +CREATE FUNCTION vibetype.guest_count(event_id UUID) RETURNS INTEGER AS $$ BEGIN - RETURN (SELECT COUNT(1) FROM maevsi.guest WHERE guest.event_id = $1); + RETURN (SELECT COUNT(1) FROM vibetype.guest WHERE guest.event_id = $1); END; $$ LANGUAGE PLPGSQL STRICT STABLE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.guest_count(UUID) IS 'Returns the guest count for an event.'; +COMMENT ON FUNCTION vibetype.guest_count(UUID) IS 'Returns the guest count for an event.'; -GRANT EXECUTE ON FUNCTION maevsi.guest_count(UUID) TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.guest_count(UUID) TO vibetype_account, vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_invite.sql b/src/deploy/function_invite.sql index 6531cd96..b8e99261 100644 --- a/src/deploy/function_invite.sql +++ b/src/deploy/function_invite.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE FUNCTION maevsi.invite( +CREATE FUNCTION vibetype.invite( guest_id UUID, "language" TEXT ) RETURNS UUID AS $$ @@ -15,19 +15,19 @@ DECLARE BEGIN -- Guest UUID SELECT * INTO _guest - FROM maevsi.guest + FROM vibetype.guest WHERE guest.id = invite.guest_id; IF ( _guest IS NULL OR - _guest.event_id NOT IN (SELECT maevsi.events_organized()) -- Initial validation, every query below is expected to be secure. + _guest.event_id NOT IN (SELECT vibetype.events_organized()) -- Initial validation, every query below is expected to be secure. ) THEN RAISE 'Guest not accessible!' USING ERRCODE = 'no_data_found'; END IF; -- Event - SELECT * INTO _event FROM maevsi.event WHERE id = _guest.event_id; + SELECT * INTO _event FROM vibetype.event WHERE id = _guest.event_id; IF (_event IS NULL) THEN RAISE 'Event not accessible!' USING ERRCODE = 'no_data_found'; @@ -35,7 +35,7 @@ BEGIN -- Contact SELECT account_id, email_address INTO _contact - FROM maevsi.contact + FROM vibetype.contact WHERE id = _guest.contact_id; IF (_contact IS NULL) THEN @@ -51,7 +51,7 @@ BEGIN ELSE -- Account SELECT email_address INTO _email_address - FROM maevsi_private.account + FROM vibetype_private.account WHERE id = _contact.account_id; IF (_email_address IS NULL) THEN @@ -61,16 +61,16 @@ BEGIN -- Event creator username SELECT username INTO _event_creator_username - FROM maevsi.account + FROM vibetype.account WHERE id = _event.created_by; -- Event creator profile picture storage key SELECT u.storage_key INTO _event_creator_profile_picture_upload_storage_key - FROM maevsi.profile_picture p - JOIN maevsi.upload u ON p.upload_id = u.id + FROM vibetype.profile_picture p + JOIN vibetype.upload u ON p.upload_id = u.id WHERE p.account_id = _event.created_by; - INSERT INTO maevsi.invitation (guest_id, channel, payload, created_by) + INSERT INTO vibetype.invitation (guest_id, channel, payload, created_by) VALUES ( invite.guest_id, 'event_invitation', @@ -84,7 +84,7 @@ BEGIN ), 'template', jsonb_build_object('language', invite.language) )), - maevsi.invoker_account_id() + vibetype.invoker_account_id() ) RETURNING id INTO _id; @@ -92,8 +92,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.invite(UUID, TEXT) IS 'Adds an invitation and a notification.'; +COMMENT ON FUNCTION vibetype.invite(UUID, TEXT) IS 'Adds an invitation and a notification.'; -GRANT EXECUTE ON FUNCTION maevsi.invite(UUID, TEXT) TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.invite(UUID, TEXT) TO vibetype_account; COMMIT; diff --git a/src/deploy/function_invoker_account_id.sql b/src/deploy/function_invoker_account_id.sql index ff68f0c9..c0a02730 100644 --- a/src/deploy/function_invoker_account_id.sql +++ b/src/deploy/function_invoker_account_id.sql @@ -1,13 +1,13 @@ BEGIN; -CREATE FUNCTION maevsi.invoker_account_id() RETURNS UUID AS $$ +CREATE FUNCTION vibetype.invoker_account_id() RETURNS UUID AS $$ BEGIN RETURN NULLIF(current_setting('jwt.claims.account_id', true), '')::UUID; END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER STABLE; -COMMENT ON FUNCTION maevsi.invoker_account_id() IS 'Returns the session''s account id.'; +COMMENT ON FUNCTION vibetype.invoker_account_id() IS 'Returns the session''s account id.'; -GRANT EXECUTE ON FUNCTION maevsi.invoker_account_id() TO maevsi_account, maevsi_anonymous, maevsi_tusd; +GRANT EXECUTE ON FUNCTION vibetype.invoker_account_id() TO vibetype_account, vibetype_anonymous, vibetype_tusd; COMMIT; diff --git a/src/deploy/function_jwt_refresh.sql b/src/deploy/function_jwt_refresh.sql index b83c871b..262eba96 100644 --- a/src/deploy/function_jwt_refresh.sql +++ b/src/deploy/function_jwt_refresh.sql @@ -1,31 +1,31 @@ BEGIN; -CREATE FUNCTION maevsi.jwt_refresh( +CREATE FUNCTION vibetype.jwt_refresh( jwt_id UUID -) RETURNS maevsi.jwt AS $$ +) RETURNS vibetype.jwt AS $$ DECLARE _epoch_now BIGINT := EXTRACT(EPOCH FROM (SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP WITH TIME ZONE))); - _jwt maevsi.jwt; + _jwt vibetype.jwt; BEGIN SELECT (token).id, (token).account_id, (token).account_username, (token)."exp", (token).guests, (token).role INTO _jwt - FROM maevsi_private.jwt + FROM vibetype_private.jwt WHERE id = $1 AND (token)."exp" >= _epoch_now; IF (_jwt IS NULL) THEN RETURN NULL; ELSE - UPDATE maevsi_private.jwt - SET token.exp = EXTRACT(EPOCH FROM ((SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP WITH TIME ZONE)) + COALESCE(current_setting('maevsi.jwt_expiry_duration', true), '1 day')::INTERVAL)) + UPDATE vibetype_private.jwt + SET token.exp = EXTRACT(EPOCH FROM ((SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP WITH TIME ZONE)) + COALESCE(current_setting('vibetype.jwt_expiry_duration', true), '1 day')::INTERVAL)) WHERE id = $1; - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET last_activity = DEFAULT WHERE account.id = _jwt.account_id; RETURN ( SELECT token - FROM maevsi_private.jwt + FROM vibetype_private.jwt WHERE id = $1 AND (token)."exp" >= _epoch_now ); @@ -33,8 +33,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.jwt_refresh(UUID) IS 'Refreshes a JWT.'; +COMMENT ON FUNCTION vibetype.jwt_refresh(UUID) IS 'Refreshes a JWT.'; -GRANT EXECUTE ON FUNCTION maevsi.jwt_refresh(UUID) TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.jwt_refresh(UUID) TO vibetype_account, vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_language_iso_full_text_search.sql b/src/deploy/function_language_iso_full_text_search.sql index 6c1b83fe..481a88f4 100644 --- a/src/deploy/function_language_iso_full_text_search.sql +++ b/src/deploy/function_language_iso_full_text_search.sql @@ -1,4 +1,4 @@ -CREATE FUNCTION maevsi.language_iso_full_text_search(language maevsi.language) +CREATE FUNCTION vibetype.language_iso_full_text_search(language vibetype.language) RETURNS regconfig AS $$ BEGIN CASE language @@ -35,6 +35,6 @@ BEGIN END; $$ LANGUAGE PLPGSQL STABLE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.language_iso_full_text_search(maevsi.language) IS 'Maps an ISO language code to the corresponding PostgreSQL text search configuration. This function returns the appropriate text search configuration for supported languages, such as "german" for "de" and "english" for "en". If the language code is not explicitly handled, the function defaults to the "simple" configuration, which is a basic tokenizer that does not perform stemming or handle stop words. This ensures that full-text search can work with a wide range of languages even if specific optimizations are not available for some.'; +COMMENT ON FUNCTION vibetype.language_iso_full_text_search(vibetype.language) IS 'Maps an ISO language code to the corresponding PostgreSQL text search configuration. This function returns the appropriate text search configuration for supported languages, such as "german" for "de" and "english" for "en". If the language code is not explicitly handled, the function defaults to the "simple" configuration, which is a basic tokenizer that does not perform stemming or handle stop words. This ensures that full-text search can work with a wide range of languages even if specific optimizations are not available for some.'; -GRANT EXECUTE ON FUNCTION maevsi.language_iso_full_text_search(maevsi.language) TO maevsi_anonymous, maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.language_iso_full_text_search(vibetype.language) TO vibetype_anonymous, vibetype_account; diff --git a/src/deploy/function_notification_acknowledge.sql b/src/deploy/function_notification_acknowledge.sql index a7e2f9f0..5182f2da 100644 --- a/src/deploy/function_notification_acknowledge.sql +++ b/src/deploy/function_notification_acknowledge.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE FUNCTION maevsi.notification_acknowledge( +CREATE FUNCTION vibetype.notification_acknowledge( id UUID, is_acknowledged BOOLEAN ) RETURNS VOID AS $$ @@ -8,7 +8,7 @@ DECLARE update_count INTEGER; BEGIN - UPDATE maevsi_private.notification SET + UPDATE vibetype_private.notification SET is_acknowledged = notification_acknowledge.is_acknowledged WHERE id = notification_acknowledge.id; @@ -20,8 +20,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.notification_acknowledge(UUID, BOOLEAN) IS 'Allows to set the acknowledgement state of a notification.'; +COMMENT ON FUNCTION vibetype.notification_acknowledge(UUID, BOOLEAN) IS 'Allows to set the acknowledgement state of a notification.'; -GRANT EXECUTE ON FUNCTION maevsi.notification_acknowledge(UUID, BOOLEAN) TO maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.notification_acknowledge(UUID, BOOLEAN) TO vibetype_anonymous; COMMIT; diff --git a/src/deploy/function_profile_picture_set.sql b/src/deploy/function_profile_picture_set.sql index 69366bb7..4a19e3e4 100644 --- a/src/deploy/function_profile_picture_set.sql +++ b/src/deploy/function_profile_picture_set.sql @@ -1,10 +1,10 @@ BEGIN; -CREATE FUNCTION maevsi.profile_picture_set( +CREATE FUNCTION vibetype.profile_picture_set( upload_id UUID ) RETURNS VOID AS $$ BEGIN - INSERT INTO maevsi.profile_picture(account_id, upload_id) + INSERT INTO vibetype.profile_picture(account_id, upload_id) VALUES ( current_setting('jwt.claims.account_id')::UUID, $1 @@ -15,8 +15,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT VOLATILE SECURITY INVOKER; -COMMENT ON FUNCTION maevsi.profile_picture_set(UUID) IS 'Sets the picture with the given upload id as the invoker''s profile picture.'; +COMMENT ON FUNCTION vibetype.profile_picture_set(UUID) IS 'Sets the picture with the given upload id as the invoker''s profile picture.'; -GRANT EXECUTE ON FUNCTION maevsi.profile_picture_set(UUID) TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.profile_picture_set(UUID) TO vibetype_account; COMMIT; diff --git a/src/deploy/function_test_utilities.sql b/src/deploy/function_test_utilities.sql index 5ba2a395..9077c47f 100644 --- a/src/deploy/function_test_utilities.sql +++ b/src/deploy/function_test_utilities.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE OR REPLACE FUNCTION maevsi_test.account_create ( +CREATE OR REPLACE FUNCTION vibetype_test.account_create ( _username TEXT, _email TEXT ) RETURNS UUID AS $$ @@ -8,52 +8,52 @@ DECLARE _id UUID; _verification UUID; BEGIN - _id := maevsi.account_registration(_username, _email, 'password', 'en'); + _id := vibetype.account_registration(_username, _email, 'password', 'en'); SELECT email_address_verification INTO _verification - FROM maevsi_private.account + FROM vibetype_private.account WHERE id = _id; - PERFORM maevsi.account_email_address_verification(_verification); + PERFORM vibetype.account_email_address_verification(_verification); RETURN _id; END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.account_remove ( +CREATE OR REPLACE FUNCTION vibetype_test.account_remove ( _username TEXT ) RETURNS VOID AS $$ DECLARE _id UUID; BEGIN - SELECT id INTO _id FROM maevsi.account WHERE username = _username; + SELECT id INTO _id FROM vibetype.account WHERE username = _username; IF _id IS NOT NULL THEN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _id || ''''; - DELETE FROM maevsi.event WHERE created_by = _id; + DELETE FROM vibetype.event WHERE created_by = _id; - PERFORM maevsi.account_delete('password'); + PERFORM vibetype.account_delete('password'); SET LOCAL role = 'postgres'; END IF; END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.contact_select_by_account_id ( +CREATE OR REPLACE FUNCTION vibetype_test.contact_select_by_account_id ( _account_id UUID ) RETURNS UUID AS $$ DECLARE _id UUID; BEGIN SELECT id INTO _id - FROM maevsi.contact + FROM vibetype.contact WHERE created_by = _account_id AND account_id = _account_id; RETURN _id; END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.contact_create ( +CREATE OR REPLACE FUNCTION vibetype_test.contact_create ( _created_by UUID, _email_address TEXT ) RETURNS UUID AS $$ @@ -61,17 +61,17 @@ DECLARE _id UUID; _account_id UUID; BEGIN - SELECT id FROM maevsi_private.account WHERE email_address = _email_address INTO _account_id; + SELECT id FROM vibetype_private.account WHERE email_address = _email_address INTO _account_id; - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - INSERT INTO maevsi.contact(created_by, email_address) + INSERT INTO vibetype.contact(created_by, email_address) VALUES (_created_by, _email_address) RETURNING id INTO _id; IF (_account_id IS NOT NULL) THEN - UPDATE maevsi.contact SET account_id = _account_id WHERE id = _id; + UPDATE vibetype.contact SET account_id = _account_id WHERE id = _id; END IF; SET LOCAL role = 'postgres'; @@ -79,7 +79,7 @@ BEGIN RETURN _id; END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.event_create ( +CREATE OR REPLACE FUNCTION vibetype_test.event_create ( _created_by UUID, _name TEXT, _slug TEXT, @@ -89,11 +89,11 @@ CREATE OR REPLACE FUNCTION maevsi_test.event_create ( DECLARE _id UUID; BEGIN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - INSERT INTO maevsi.event(created_by, name, slug, start, visibility) - VALUES (_created_by, _name, _slug, _start::TIMESTAMP WITH TIME ZONE, _visibility::maevsi.event_visibility) + INSERT INTO vibetype.event(created_by, name, slug, start, visibility) + VALUES (_created_by, _name, _slug, _start::TIMESTAMP WITH TIME ZONE, _visibility::vibetype.event_visibility) RETURNING id INTO _id; SET LOCAL role = 'postgres'; @@ -101,7 +101,7 @@ BEGIN RETURN _id; END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.guest_create ( +CREATE OR REPLACE FUNCTION vibetype_test.guest_create ( _created_by UUID, _event_id UUID, _contact_id UUID @@ -109,10 +109,10 @@ CREATE OR REPLACE FUNCTION maevsi_test.guest_create ( DECLARE _id UUID; BEGIN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - INSERT INTO maevsi.guest(contact_id, event_id) + INSERT INTO vibetype.guest(contact_id, event_id) VALUES (_contact_id, _event_id) RETURNING id INTO _id; @@ -121,39 +121,39 @@ BEGIN RETURN _id; END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.event_category_create ( +CREATE OR REPLACE FUNCTION vibetype_test.event_category_create ( _category TEXT ) RETURNS VOID AS $$ BEGIN - INSERT INTO maevsi.event_category(category) VALUES (_category); + INSERT INTO vibetype.event_category(category) VALUES (_category); END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.event_category_mapping_create ( +CREATE OR REPLACE FUNCTION vibetype_test.event_category_mapping_create ( _created_by UUID, _event_id UUID, _category TEXT ) RETURNS VOID AS $$ BEGIN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - INSERT INTO maevsi.event_category_mapping(event_id, category) + INSERT INTO vibetype.event_category_mapping(event_id, category) VALUES (_event_id, _category); SET LOCAL role = 'postgres'; END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.account_block_create ( +CREATE OR REPLACE FUNCTION vibetype_test.account_block_create ( _created_by UUID, _blocked_account_id UUID ) RETURNS UUID AS $$ DECLARE _id UUID; BEGIN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - INSERT INTO maevsi.account_block(created_by, blocked_account_id) + INSERT INTO vibetype.account_block(created_by, blocked_account_id) VALUES (_created_by, _blocked_Account_id) RETURNING id INTO _id; @@ -162,68 +162,68 @@ BEGIN RETURN _id; END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.account_block_remove ( +CREATE OR REPLACE FUNCTION vibetype_test.account_block_remove ( _created_by UUID, _blocked_account_id UUID ) RETURNS VOID AS $$ DECLARE _id UUID; BEGIN - DELETE FROM maevsi.account_block + DELETE FROM vibetype.account_block WHERE created_by = _created_by and blocked_account_id = _blocked_account_id; END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.event_test ( +CREATE OR REPLACE FUNCTION vibetype_test.event_test ( _test_case TEXT, _account_id UUID, _expected_result UUID[] ) RETURNS VOID AS $$ BEGIN IF _account_id IS NULL THEN - SET LOCAL role = 'maevsi_anonymous'; + SET LOCAL role = 'vibetype_anonymous'; SET LOCAL jwt.claims.account_id = ''; ELSE - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; END IF; - IF EXISTS (SELECT id FROM maevsi.event EXCEPT SELECT * FROM unnest(_expected_result)) THEN + IF EXISTS (SELECT id FROM vibetype.event EXCEPT SELECT * FROM unnest(_expected_result)) THEN RAISE EXCEPTION 'some event should not appear in the query result'; END IF; - IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM maevsi.event) THEN + IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM vibetype.event) THEN RAISE EXCEPTION 'some event is missing in the query result'; END IF; SET LOCAL role = 'postgres'; END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.event_category_mapping_test ( +CREATE OR REPLACE FUNCTION vibetype_test.event_category_mapping_test ( _test_case TEXT, _account_id UUID, _expected_result UUID[] ) RETURNS VOID AS $$ BEGIN IF _account_id IS NULL THEN - SET LOCAL role = 'maevsi_anonymous'; + SET LOCAL role = 'vibetype_anonymous'; SET LOCAL jwt.claims.account_id = ''; ELSE - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; END IF; - IF EXISTS (SELECT event_id FROM maevsi.event_category_mapping EXCEPT SELECT * FROM unnest(_expected_result)) THEN + IF EXISTS (SELECT event_id FROM vibetype.event_category_mapping EXCEPT SELECT * FROM unnest(_expected_result)) THEN RAISE EXCEPTION 'some event_category_mappings should not appear in the query result'; END IF; - IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT event_id FROM maevsi.event_category_mapping) THEN + IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT event_id FROM vibetype.event_category_mapping) THEN RAISE EXCEPTION 'some event_category_mappings is missing in the query result'; END IF; SET LOCAL role = 'postgres'; END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.contact_test ( +CREATE OR REPLACE FUNCTION vibetype_test.contact_test ( _test_case TEXT, _account_id UUID, _expected_result UUID[] @@ -232,59 +232,59 @@ DECLARE rec RECORD; BEGIN IF _account_id IS NULL THEN - SET LOCAL role = 'maevsi_anonymous'; + SET LOCAL role = 'vibetype_anonymous'; SET LOCAL jwt.claims.account_id = ''; ELSE - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; END IF; - IF EXISTS (SELECT id FROM maevsi.contact EXCEPT SELECT * FROM unnest(_expected_result)) THEN + IF EXISTS (SELECT id FROM vibetype.contact EXCEPT SELECT * FROM unnest(_expected_result)) THEN RAISE EXCEPTION 'some contact should not appear in the query result'; END IF; - IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM maevsi.contact) THEN + IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM vibetype.contact) THEN RAISE EXCEPTION 'some contact is missing in the query result'; END IF; SET LOCAL role = 'postgres'; END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.guest_test ( +CREATE OR REPLACE FUNCTION vibetype_test.guest_test ( _test_case TEXT, _account_id UUID, _expected_result UUID[] ) RETURNS VOID AS $$ BEGIN IF _account_id IS NULL THEN - SET LOCAL role = 'maevsi_anonymous'; + SET LOCAL role = 'vibetype_anonymous'; SET LOCAL jwt.claims.account_id = ''; ELSE - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; END IF; - IF EXISTS (SELECT id FROM maevsi.guest EXCEPT SELECT * FROM unnest(_expected_result)) THEN + IF EXISTS (SELECT id FROM vibetype.guest EXCEPT SELECT * FROM unnest(_expected_result)) THEN RAISE EXCEPTION 'some guest should not appear in the query result'; END IF; - IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM maevsi.guest) THEN + IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM vibetype.guest) THEN RAISE EXCEPTION 'some guest is missing in the query result'; END IF; SET LOCAL role = 'postgres'; END $$ LANGUAGE plpgsql; -CREATE FUNCTION maevsi_test.guest_claim_from_account_guest ( +CREATE FUNCTION vibetype_test.guest_claim_from_account_guest ( _account_id UUID ) RETURNS UUID[] AS $$ DECLARE - _guest maevsi.guest; + _guest vibetype.guest; _result UUID[] := ARRAY[]::UUID[]; _text TEXT := ''; BEGIN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; -- reads all guests where _account_id is invited, @@ -293,7 +293,7 @@ BEGIN FOR _guest IN SELECT g.id - FROM maevsi.guest g JOIN maevsi.contact c + FROM vibetype.guest g JOIN vibetype.contact c ON g.contact_id = c.id WHERE c.account_id = _account_id LOOP @@ -312,23 +312,23 @@ BEGIN RETURN _result; END $$ LANGUAGE plpgsql; -CREATE FUNCTION maevsi_test.invoker_set ( +CREATE FUNCTION vibetype_test.invoker_set ( _invoker_id UUID ) RETURNS VOID AS $$ BEGIN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _invoker_id || ''''; END $$ LANGUAGE plpgsql; -CREATE FUNCTION maevsi_test.invoker_unset () +CREATE FUNCTION vibetype_test.invoker_unset () RETURNS VOID AS $$ BEGIN - CALL maevsi_test.set_local_superuser(); + CALL vibetype_test.set_local_superuser(); EXECUTE 'SET LOCAL jwt.claims.account_id = '''''; END $$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION maevsi_test.uuid_array_test ( +CREATE OR REPLACE FUNCTION vibetype_test.uuid_array_test ( _test_case TEXT, _array UUID[], _expected_array UUID[] diff --git a/src/deploy/function_trigger_metadata_update.sql b/src/deploy/function_trigger_metadata_update.sql index d71e645c..dc81eafa 100644 --- a/src/deploy/function_trigger_metadata_update.sql +++ b/src/deploy/function_trigger_metadata_update.sql @@ -1,13 +1,13 @@ -CREATE FUNCTION maevsi.trigger_metadata_update() +CREATE FUNCTION vibetype.trigger_metadata_update() RETURNS TRIGGER AS $$ BEGIN NEW.updated_at = CURRENT_TIMESTAMP; - NEW.updated_by = maevsi.invoker_account_id(); + NEW.updated_by = vibetype.invoker_account_id(); RETURN NEW; END; $$ LANGUAGE plpgsql; -COMMENT ON FUNCTION maevsi.trigger_metadata_update() IS 'Trigger function to automatically update metadata fields `updated_at` and `updated_by` when a row is modified. Sets `updated_at` to the current timestamp and `updated_by` to the account ID of the invoker.'; +COMMENT ON FUNCTION vibetype.trigger_metadata_update() IS 'Trigger function to automatically update metadata fields `updated_at` and `updated_by` when a row is modified. Sets `updated_at` to the current timestamp and `updated_by` to the account ID of the invoker.'; -GRANT EXECUTE ON FUNCTION maevsi.trigger_metadata_update() TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.trigger_metadata_update() TO vibetype_account; diff --git a/src/deploy/function_upload_create.sql b/src/deploy/function_upload_create.sql index 17f0ca92..0a6d4f22 100644 --- a/src/deploy/function_upload_create.sql +++ b/src/deploy/function_upload_create.sql @@ -1,21 +1,21 @@ BEGIN; -CREATE FUNCTION maevsi.upload_create( +CREATE FUNCTION vibetype.upload_create( size_byte BIGINT -) RETURNS maevsi.upload AS $$ +) RETURNS vibetype.upload AS $$ DECLARE - _upload maevsi.upload; + _upload vibetype.upload; BEGIN IF (COALESCE(( SELECT SUM(upload.size_byte) - FROM maevsi.upload + FROM vibetype.upload WHERE upload.account_id = current_setting('jwt.claims.account_id')::UUID ), 0) + $1 <= ( SELECT upload_quota_bytes - FROM maevsi_private.account + FROM vibetype_private.account WHERE account.id = current_setting('jwt.claims.account_id')::UUID )) THEN - INSERT INTO maevsi.upload(account_id, size_byte) + INSERT INTO vibetype.upload(account_id, size_byte) VALUES (current_setting('jwt.claims.account_id')::UUID, $1) RETURNING upload.id INTO _upload; @@ -26,8 +26,8 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT VOLATILE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.upload_create(BIGINT) IS 'Creates an upload with the given size if quota is available.'; +COMMENT ON FUNCTION vibetype.upload_create(BIGINT) IS 'Creates an upload with the given size if quota is available.'; -GRANT EXECUTE ON FUNCTION maevsi.upload_create(BIGINT) TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.upload_create(BIGINT) TO vibetype_account; COMMIT; diff --git a/src/deploy/index_account_private_location.sql b/src/deploy/index_account_private_location.sql index e78e911d..ad30a523 100644 --- a/src/deploy/index_account_private_location.sql +++ b/src/deploy/index_account_private_location.sql @@ -1,7 +1,7 @@ BEGIN; -CREATE INDEX idx_account_private_location ON maevsi_private.account USING GIST (location); +CREATE INDEX idx_account_private_location ON vibetype_private.account USING GIST (location); -COMMENT ON INDEX maevsi_private.idx_account_private_location IS 'Spatial index on column location in maevsi_private.account.'; +COMMENT ON INDEX vibetype_private.idx_account_private_location IS 'Spatial index on column location in vibetype_private.account.'; COMMIT; diff --git a/src/deploy/index_event_creator_username.sql b/src/deploy/index_event_creator_username.sql index af7102c5..0876b9c5 100644 --- a/src/deploy/index_event_creator_username.sql +++ b/src/deploy/index_event_creator_username.sql @@ -1,7 +1,7 @@ BEGIN; -CREATE INDEX idx_event_created_by ON maevsi.event (created_by); +CREATE INDEX idx_event_created_by ON vibetype.event (created_by); -COMMENT ON INDEX maevsi.idx_event_created_by IS 'Speeds up reverse foreign key lookups.'; +COMMENT ON INDEX vibetype.idx_event_created_by IS 'Speeds up reverse foreign key lookups.'; COMMIT; diff --git a/src/deploy/index_event_group_creator_username.sql b/src/deploy/index_event_group_creator_username.sql index ef52b5fd..5e256ec9 100644 --- a/src/deploy/index_event_group_creator_username.sql +++ b/src/deploy/index_event_group_creator_username.sql @@ -1,7 +1,7 @@ BEGIN; -CREATE INDEX idx_event_group_created_by ON maevsi.event_group (created_by); +CREATE INDEX idx_event_group_created_by ON vibetype.event_group (created_by); -COMMENT ON INDEX maevsi.idx_event_group_created_by IS 'Speeds up reverse foreign key lookups.'; +COMMENT ON INDEX vibetype.idx_event_group_created_by IS 'Speeds up reverse foreign key lookups.'; COMMIT; diff --git a/src/deploy/index_event_grouping_event_group_id.sql b/src/deploy/index_event_grouping_event_group_id.sql index 4cd5b927..bb987eae 100644 --- a/src/deploy/index_event_grouping_event_group_id.sql +++ b/src/deploy/index_event_grouping_event_group_id.sql @@ -1,7 +1,7 @@ BEGIN; -CREATE INDEX idx_event_grouping_event_group_id ON maevsi.event_grouping (event_group_id); +CREATE INDEX idx_event_grouping_event_group_id ON vibetype.event_grouping (event_group_id); -COMMENT ON INDEX maevsi.idx_event_grouping_event_group_id IS 'Speeds up reverse foreign key lookups.'; +COMMENT ON INDEX vibetype.idx_event_grouping_event_group_id IS 'Speeds up reverse foreign key lookups.'; COMMIT; diff --git a/src/deploy/index_event_grouping_event_id.sql b/src/deploy/index_event_grouping_event_id.sql index 253b12e5..1f551918 100644 --- a/src/deploy/index_event_grouping_event_id.sql +++ b/src/deploy/index_event_grouping_event_id.sql @@ -1,7 +1,7 @@ BEGIN; -CREATE INDEX idx_event_grouping_event_id ON maevsi.event_grouping (event_id); +CREATE INDEX idx_event_grouping_event_id ON vibetype.event_grouping (event_id); -COMMENT ON INDEX maevsi.idx_event_grouping_event_id IS 'Speeds up reverse foreign key lookups.'; +COMMENT ON INDEX vibetype.idx_event_grouping_event_id IS 'Speeds up reverse foreign key lookups.'; COMMIT; diff --git a/src/deploy/index_event_location.sql b/src/deploy/index_event_location.sql index 2c221e3f..cfb4fe1b 100644 --- a/src/deploy/index_event_location.sql +++ b/src/deploy/index_event_location.sql @@ -1,7 +1,7 @@ BEGIN; -CREATE INDEX idx_event_location ON maevsi.event USING GIST (location_geography); +CREATE INDEX idx_event_location ON vibetype.event USING GIST (location_geography); -COMMENT ON INDEX maevsi.idx_event_location IS 'Spatial index on column location in maevsi.event.'; +COMMENT ON INDEX vibetype.idx_event_location IS 'Spatial index on column location in vibetype.event.'; COMMIT; diff --git a/src/deploy/index_guest_contact_id.sql b/src/deploy/index_guest_contact_id.sql index 6218c1c4..c7519e81 100644 --- a/src/deploy/index_guest_contact_id.sql +++ b/src/deploy/index_guest_contact_id.sql @@ -1,7 +1,7 @@ BEGIN; -CREATE INDEX idx_guest_contact_id ON maevsi.guest(contact_id); +CREATE INDEX idx_guest_contact_id ON vibetype.guest(contact_id); -COMMENT ON INDEX maevsi.idx_guest_contact_id IS 'Speeds up reverse foreign key lookups.'; +COMMENT ON INDEX vibetype.idx_guest_contact_id IS 'Speeds up reverse foreign key lookups.'; COMMIT; diff --git a/src/deploy/index_guest_event_id.sql b/src/deploy/index_guest_event_id.sql index 38fcef9a..5d182d1c 100644 --- a/src/deploy/index_guest_event_id.sql +++ b/src/deploy/index_guest_event_id.sql @@ -1,7 +1,7 @@ BEGIN; -CREATE INDEX idx_guest_event_id ON maevsi.guest (event_id); +CREATE INDEX idx_guest_event_id ON vibetype.guest (event_id); -COMMENT ON INDEX maevsi.idx_guest_event_id IS 'Speeds up reverse foreign key lookups.'; +COMMENT ON INDEX vibetype.idx_guest_event_id IS 'Speeds up reverse foreign key lookups.'; COMMIT; diff --git a/src/deploy/role_account.sql b/src/deploy/role_account.sql index 49adaa71..a792c702 100644 --- a/src/deploy/role_account.sql +++ b/src/deploy/role_account.sql @@ -1,8 +1,8 @@ BEGIN; -DROP ROLE IF EXISTS maevsi_account; -CREATE ROLE maevsi_account; +DROP ROLE IF EXISTS vibetype_account; +CREATE ROLE vibetype_account; -GRANT maevsi_account to maevsi_postgraphile; +GRANT vibetype_account to vibetype_postgraphile; COMMIT; diff --git a/src/deploy/role_anonymous.sql b/src/deploy/role_anonymous.sql index f7daa6c6..ee90d88e 100644 --- a/src/deploy/role_anonymous.sql +++ b/src/deploy/role_anonymous.sql @@ -1,8 +1,8 @@ BEGIN; -DROP ROLE IF EXISTS maevsi_anonymous; -CREATE ROLE maevsi_anonymous; +DROP ROLE IF EXISTS vibetype_anonymous; +CREATE ROLE vibetype_anonymous; -GRANT maevsi_anonymous to maevsi_postgraphile; +GRANT vibetype_anonymous to vibetype_postgraphile; COMMIT; diff --git a/src/deploy/role_postgraphile.sql b/src/deploy/role_postgraphile.sql index 6b4223b3..244b0851 100644 --- a/src/deploy/role_postgraphile.sql +++ b/src/deploy/role_postgraphile.sql @@ -1,8 +1,8 @@ BEGIN; -\set role_maevsi_postgraphile_password `cat /run/secrets/postgres_role_maevsi-postgraphile_password` +\set role_vibetype_postgraphile_password `cat /run/secrets/postgres_role_vibetype-postgraphile_password` -DROP ROLE IF EXISTS maevsi_postgraphile; -CREATE ROLE maevsi_postgraphile LOGIN PASSWORD :'role_maevsi_postgraphile_password'; +DROP ROLE IF EXISTS vibetype_postgraphile; +CREATE ROLE vibetype_postgraphile LOGIN PASSWORD :'role_vibetype_postgraphile_password'; COMMIT; diff --git a/src/deploy/role_tusd.sql b/src/deploy/role_tusd.sql index a3f57012..6541a441 100644 --- a/src/deploy/role_tusd.sql +++ b/src/deploy/role_tusd.sql @@ -1,10 +1,10 @@ BEGIN; -\set role_maevsi_tusd_password `cat /run/secrets/postgres_role_maevsi-tusd_password` +\set role_vibetype_tusd_password `cat /run/secrets/postgres_role_vibetype-tusd_password` -DROP ROLE IF EXISTS maevsi_tusd; -CREATE ROLE maevsi_tusd LOGIN PASSWORD :'role_maevsi_tusd_password'; +DROP ROLE IF EXISTS vibetype_tusd; +CREATE ROLE vibetype_tusd LOGIN PASSWORD :'role_vibetype_tusd_password'; -GRANT maevsi_tusd to maevsi_postgraphile; +GRANT vibetype_tusd to vibetype_postgraphile; COMMIT; diff --git a/src/deploy/schema_private.sql b/src/deploy/schema_private.sql index 96960f64..e8f7c00f 100644 --- a/src/deploy/schema_private.sql +++ b/src/deploy/schema_private.sql @@ -1,7 +1,7 @@ BEGIN; -CREATE SCHEMA maevsi_private; +CREATE SCHEMA vibetype_private; -COMMENT ON SCHEMA maevsi_private IS 'Contains account information and is not used by PostGraphile.'; +COMMENT ON SCHEMA vibetype_private IS 'Contains account information and is not used by PostGraphile.'; COMMIT; diff --git a/src/deploy/schema_public.sql b/src/deploy/schema_public.sql index abc2f95b..7458c50a 100644 --- a/src/deploy/schema_public.sql +++ b/src/deploy/schema_public.sql @@ -1,9 +1,9 @@ BEGIN; -CREATE SCHEMA maevsi; +CREATE SCHEMA vibetype; -COMMENT ON SCHEMA maevsi IS 'Is used by PostGraphile.'; +COMMENT ON SCHEMA vibetype IS 'Is used by PostGraphile.'; -GRANT USAGE ON SCHEMA maevsi TO maevsi_anonymous, maevsi_account, maevsi_tusd; +GRANT USAGE ON SCHEMA vibetype TO vibetype_anonymous, vibetype_account, vibetype_tusd; COMMIT; diff --git a/src/deploy/schema_test.sql b/src/deploy/schema_test.sql index 3afbd2fd..0b14a3ec 100644 --- a/src/deploy/schema_test.sql +++ b/src/deploy/schema_test.sql @@ -1,9 +1,9 @@ BEGIN; -CREATE SCHEMA maevsi_test; +CREATE SCHEMA vibetype_test; -COMMENT ON SCHEMA maevsi_test IS 'Schema for test functions.'; +COMMENT ON SCHEMA vibetype_test IS 'Schema for test functions.'; -GRANT USAGE ON SCHEMA maevsi_test TO maevsi_anonymous, maevsi_account; +GRANT USAGE ON SCHEMA vibetype_test TO vibetype_anonymous, vibetype_account; COMMIT; diff --git a/src/deploy/table_account_block.sql b/src/deploy/table_account_block.sql index 8c628e8e..06fea862 100644 --- a/src/deploy/table_account_block.sql +++ b/src/deploy/table_account_block.sql @@ -1,21 +1,21 @@ BEGIN; -CREATE TABLE maevsi.account_block ( +CREATE TABLE vibetype.account_block ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - blocked_account_id UUID NOT NULL REFERENCES maevsi.account(id), + blocked_account_id UUID NOT NULL REFERENCES vibetype.account(id), created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, - created_by UUID NOT NULL REFERENCES maevsi.account(id), + created_by UUID NOT NULL REFERENCES vibetype.account(id), UNIQUE (created_by, blocked_account_id), CHECK (created_by != blocked_account_id) ); -COMMENT ON TABLE maevsi.account_block IS E'@omit update,delete\nBlocking of one account by another.'; -COMMENT ON COLUMN maevsi.account_block.id IS '@omit create\nThe account blocking''s internal id.'; -COMMENT ON COLUMN maevsi.account_block.blocked_account_id IS 'The account id of the user who is blocked.'; -COMMENT ON COLUMN maevsi.account_block.created_at IS E'@omit create,update,delete\nTimestamp of when the blocking was created.'; -COMMENT ON COLUMN maevsi.account_block.created_by IS 'The account id of the user who created the blocking.'; +COMMENT ON TABLE vibetype.account_block IS E'@omit update,delete\nBlocking of one account by another.'; +COMMENT ON COLUMN vibetype.account_block.id IS '@omit create\nThe account blocking''s internal id.'; +COMMENT ON COLUMN vibetype.account_block.blocked_account_id IS 'The account id of the user who is blocked.'; +COMMENT ON COLUMN vibetype.account_block.created_at IS E'@omit create,update,delete\nTimestamp of when the blocking was created.'; +COMMENT ON COLUMN vibetype.account_block.created_by IS 'The account id of the user who created the blocking.'; COMMIT; diff --git a/src/deploy/table_account_block_policy.sql b/src/deploy/table_account_block_policy.sql index 92044531..f7f72590 100644 --- a/src/deploy/table_account_block_policy.sql +++ b/src/deploy/table_account_block_policy.sql @@ -1,22 +1,22 @@ BEGIN; -GRANT INSERT, SELECT ON TABLE maevsi.account_block TO maevsi_account; -GRANT SELECT ON TABLE maevsi.account_block TO maevsi_anonymous; +GRANT INSERT, SELECT ON TABLE vibetype.account_block TO vibetype_account; +GRANT SELECT ON TABLE vibetype.account_block TO vibetype_anonymous; -ALTER TABLE maevsi.account_block ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.account_block ENABLE ROW LEVEL SECURITY; -- Only allow account blocking creation with accurate creator. -CREATE POLICY account_block_insert ON maevsi.account_block FOR INSERT WITH CHECK ( - maevsi.invoker_account_id() IS NOT NULL +CREATE POLICY account_block_insert ON vibetype.account_block FOR INSERT WITH CHECK ( + vibetype.invoker_account_id() IS NOT NULL AND - created_by = maevsi.invoker_account_id() + created_by = vibetype.invoker_account_id() ); -- Only show account blockings which are created by the current user or which affect the current user. -CREATE POLICY account_block_select ON maevsi.account_block FOR SELECT USING ( - created_by = maevsi.invoker_account_id() +CREATE POLICY account_block_select ON vibetype.account_block FOR SELECT USING ( + created_by = vibetype.invoker_account_id() OR - blocked_account_id = maevsi.invoker_account_id() + blocked_account_id = vibetype.invoker_account_id() ); COMMIT; diff --git a/src/deploy/table_account_interest.sql b/src/deploy/table_account_interest.sql index 2eec0a52..9cee9098 100644 --- a/src/deploy/table_account_interest.sql +++ b/src/deploy/table_account_interest.sql @@ -1,14 +1,14 @@ BEGIN; -CREATE TABLE maevsi.account_interest ( - account_id UUID NOT NULL REFERENCES maevsi.account(id) ON DELETE CASCADE, - category TEXT NOT NULL REFERENCES maevsi.event_category(category) ON DELETE CASCADE, +CREATE TABLE vibetype.account_interest ( + account_id UUID NOT NULL REFERENCES vibetype.account(id) ON DELETE CASCADE, + category TEXT NOT NULL REFERENCES vibetype.event_category(category) ON DELETE CASCADE, PRIMARY KEY (account_id, category) ); -COMMENT ON TABLE maevsi.account_interest IS 'Event categories a user account is interested in (M:N relationship).'; -COMMENT ON COLUMN maevsi.account_interest.account_id IS 'A user account id.'; -COMMENT ON COLUMN maevsi.account_interest.category IS 'An event category.'; +COMMENT ON TABLE vibetype.account_interest IS 'Event categories a user account is interested in (M:N relationship).'; +COMMENT ON COLUMN vibetype.account_interest.account_id IS 'A user account id.'; +COMMENT ON COLUMN vibetype.account_interest.category IS 'An event category.'; COMMIT; diff --git a/src/deploy/table_account_interest_policy.sql b/src/deploy/table_account_interest_policy.sql index 3f94072a..7cdcd4f5 100644 --- a/src/deploy/table_account_interest_policy.sql +++ b/src/deploy/table_account_interest_policy.sql @@ -1,22 +1,22 @@ BEGIN; -GRANT SELECT, INSERT, DELETE ON TABLE maevsi.account_interest TO maevsi_account; +GRANT SELECT, INSERT, DELETE ON TABLE vibetype.account_interest TO vibetype_account; -ALTER TABLE maevsi.account_interest ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.account_interest ENABLE ROW LEVEL SECURITY; -- Only allow selects by the current account. -CREATE POLICY account_interest_select ON maevsi.account_interest FOR SELECT USING ( - account_id = maevsi.invoker_account_id() +CREATE POLICY account_interest_select ON vibetype.account_interest FOR SELECT USING ( + account_id = vibetype.invoker_account_id() ); -- Only allow inserts by the current account. -CREATE POLICY account_interest_insert ON maevsi.account_interest FOR INSERT WITH CHECK ( - account_id = maevsi.invoker_account_id() +CREATE POLICY account_interest_insert ON vibetype.account_interest FOR INSERT WITH CHECK ( + account_id = vibetype.invoker_account_id() ); -- Only allow deletes by the current account. -CREATE POLICY account_interest_delete ON maevsi.account_interest FOR DELETE USING ( - account_id = maevsi.invoker_account_id() +CREATE POLICY account_interest_delete ON vibetype.account_interest FOR DELETE USING ( + account_id = vibetype.invoker_account_id() ); COMMIT; diff --git a/src/deploy/table_account_preference_event_size.sql b/src/deploy/table_account_preference_event_size.sql index 36252fe5..f7850879 100644 --- a/src/deploy/table_account_preference_event_size.sql +++ b/src/deploy/table_account_preference_event_size.sql @@ -1,17 +1,17 @@ BEGIN; -CREATE TABLE maevsi.account_preference_event_size ( - account_id UUID REFERENCES maevsi.account(id), - event_size maevsi.event_size, +CREATE TABLE vibetype.account_preference_event_size ( + account_id UUID REFERENCES vibetype.account(id), + event_size vibetype.event_size, created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (account_id, event_size) ); -COMMENT ON TABLE maevsi.account_preference_event_size IS 'Table for the user accounts'' preferred event sizes (M:N relationship).'; -COMMENT ON COLUMN maevsi.account_preference_event_size.account_id IS 'The account''s internal id.'; -COMMENT ON COLUMN maevsi.account_preference_event_size.event_size IS 'A preferred event sized'; -COMMENT ON COLUMN maevsi.account_preference_event_size.created_at IS E'@omit create,update\nTimestamp of when the event size preference was created, defaults to the current timestamp.'; +COMMENT ON TABLE vibetype.account_preference_event_size IS 'Table for the user accounts'' preferred event sizes (M:N relationship).'; +COMMENT ON COLUMN vibetype.account_preference_event_size.account_id IS 'The account''s internal id.'; +COMMENT ON COLUMN vibetype.account_preference_event_size.event_size IS 'A preferred event sized'; +COMMENT ON COLUMN vibetype.account_preference_event_size.created_at IS E'@omit create,update\nTimestamp of when the event size preference was created, defaults to the current timestamp.'; END; diff --git a/src/deploy/table_account_preference_event_size_policy.sql b/src/deploy/table_account_preference_event_size_policy.sql index 004d967d..d2462a06 100644 --- a/src/deploy/table_account_preference_event_size_policy.sql +++ b/src/deploy/table_account_preference_event_size_policy.sql @@ -1,22 +1,22 @@ BEGIN; -GRANT SELECT, INSERT, DELETE ON TABLE maevsi.account_preference_event_size TO maevsi_account; +GRANT SELECT, INSERT, DELETE ON TABLE vibetype.account_preference_event_size TO vibetype_account; -ALTER TABLE maevsi.account_preference_event_size ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.account_preference_event_size ENABLE ROW LEVEL SECURITY; -- Only allow selects by the current account. -CREATE POLICY account_preference_event_size_select ON maevsi.account_preference_event_size FOR SELECT USING ( - account_id = maevsi.invoker_account_id() +CREATE POLICY account_preference_event_size_select ON vibetype.account_preference_event_size FOR SELECT USING ( + account_id = vibetype.invoker_account_id() ); -- Only allow inserts by the current account. -CREATE POLICY account_preference_event_size_insert ON maevsi.account_preference_event_size FOR INSERT WITH CHECK ( - account_id = maevsi.invoker_account_id() +CREATE POLICY account_preference_event_size_insert ON vibetype.account_preference_event_size FOR INSERT WITH CHECK ( + account_id = vibetype.invoker_account_id() ); -- Only allow deletes by the current account. -CREATE POLICY account_preference_event_size_delete ON maevsi.account_preference_event_size FOR DELETE USING ( - account_id = maevsi.invoker_account_id() +CREATE POLICY account_preference_event_size_delete ON vibetype.account_preference_event_size FOR DELETE USING ( + account_id = vibetype.invoker_account_id() ); COMMIT; diff --git a/src/deploy/table_account_private.sql b/src/deploy/table_account_private.sql index c5e05abd..598089ce 100644 --- a/src/deploy/table_account_private.sql +++ b/src/deploy/table_account_private.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE TABLE maevsi_private.account ( +CREATE TABLE vibetype_private.account ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), birth_date DATE, -- TODO: evaluate if this should be `NOT NULL` for all new accounts @@ -17,21 +17,21 @@ CREATE TABLE maevsi_private.account ( last_activity TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP ); -COMMENT ON TABLE maevsi_private.account IS 'Private account data.'; -COMMENT ON COLUMN maevsi_private.account.id IS 'The account''s internal id.'; -COMMENT ON COLUMN maevsi_private.account.birth_date IS 'The account owner''s date of birth.'; -COMMENT ON COLUMN maevsi_private.account.email_address IS 'The account''s email address for account related information.'; -COMMENT ON COLUMN maevsi_private.account.email_address_verification IS 'The UUID used to verify an email address, or null if already verified.'; -COMMENT ON COLUMN maevsi_private.account.email_address_verification_valid_until IS 'The timestamp until which an email address verification is valid.'; -COMMENT ON COLUMN maevsi_private.account.location IS 'The account''s geometric location.'; -COMMENT ON COLUMN maevsi_private.account.password_hash IS 'The account''s password, hashed and salted.'; -COMMENT ON COLUMN maevsi_private.account.password_reset_verification IS 'The UUID used to reset a password, or null if there is no pending reset request.'; -COMMENT ON COLUMN maevsi_private.account.password_reset_verification_valid_until IS 'The timestamp until which a password reset is valid.'; -COMMENT ON COLUMN maevsi_private.account.upload_quota_bytes IS 'The account''s upload quota in bytes.'; -COMMENT ON COLUMN maevsi_private.account.created_at IS 'Timestamp at which the account was last active.'; -COMMENT ON COLUMN maevsi_private.account.last_activity IS 'Timestamp at which the account last requested an access token.'; +COMMENT ON TABLE vibetype_private.account IS 'Private account data.'; +COMMENT ON COLUMN vibetype_private.account.id IS 'The account''s internal id.'; +COMMENT ON COLUMN vibetype_private.account.birth_date IS 'The account owner''s date of birth.'; +COMMENT ON COLUMN vibetype_private.account.email_address IS 'The account''s email address for account related information.'; +COMMENT ON COLUMN vibetype_private.account.email_address_verification IS 'The UUID used to verify an email address, or null if already verified.'; +COMMENT ON COLUMN vibetype_private.account.email_address_verification_valid_until IS 'The timestamp until which an email address verification is valid.'; +COMMENT ON COLUMN vibetype_private.account.location IS 'The account''s geometric location.'; +COMMENT ON COLUMN vibetype_private.account.password_hash IS 'The account''s password, hashed and salted.'; +COMMENT ON COLUMN vibetype_private.account.password_reset_verification IS 'The UUID used to reset a password, or null if there is no pending reset request.'; +COMMENT ON COLUMN vibetype_private.account.password_reset_verification_valid_until IS 'The timestamp until which a password reset is valid.'; +COMMENT ON COLUMN vibetype_private.account.upload_quota_bytes IS 'The account''s upload quota in bytes.'; +COMMENT ON COLUMN vibetype_private.account.created_at IS 'Timestamp at which the account was last active.'; +COMMENT ON COLUMN vibetype_private.account.last_activity IS 'Timestamp at which the account last requested an access token.'; -CREATE FUNCTION maevsi_private.account_email_address_verification_valid_until() RETURNS TRIGGER AS $$ +CREATE FUNCTION vibetype_private.account_email_address_verification_valid_until() RETURNS TRIGGER AS $$ BEGIN IF (NEW.email_address_verification IS NULL) THEN NEW.email_address_verification_valid_until = NULL; @@ -45,11 +45,11 @@ CREATE FUNCTION maevsi_private.account_email_address_verification_valid_until() END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi_private.account_email_address_verification_valid_until() IS 'Sets the valid until column of the email address verification to it''s default value.'; +COMMENT ON FUNCTION vibetype_private.account_email_address_verification_valid_until() IS 'Sets the valid until column of the email address verification to it''s default value.'; -GRANT EXECUTE ON FUNCTION maevsi_private.account_email_address_verification_valid_until() TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype_private.account_email_address_verification_valid_until() TO vibetype_account; -CREATE FUNCTION maevsi_private.account_password_reset_verification_valid_until() RETURNS TRIGGER AS $$ +CREATE FUNCTION vibetype_private.account_password_reset_verification_valid_until() RETURNS TRIGGER AS $$ BEGIN IF (NEW.password_reset_verification IS NULL) THEN NEW.password_reset_verification_valid_until = NULL; @@ -63,24 +63,24 @@ CREATE FUNCTION maevsi_private.account_password_reset_verification_valid_until() END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi_private.account_password_reset_verification_valid_until() IS 'Sets the valid until column of the email address verification to it''s default value.'; +COMMENT ON FUNCTION vibetype_private.account_password_reset_verification_valid_until() IS 'Sets the valid until column of the email address verification to it''s default value.'; -GRANT EXECUTE ON FUNCTION maevsi_private.account_password_reset_verification_valid_until() TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype_private.account_password_reset_verification_valid_until() TO vibetype_account; -CREATE TRIGGER maevsi_private_account_email_address_verification_valid_until +CREATE TRIGGER vibetype_private_account_email_address_verification_valid_until BEFORE INSERT OR UPDATE OF email_address_verification - ON maevsi_private.account + ON vibetype_private.account FOR EACH ROW - EXECUTE PROCEDURE maevsi_private.account_email_address_verification_valid_until(); + EXECUTE PROCEDURE vibetype_private.account_email_address_verification_valid_until(); -CREATE TRIGGER maevsi_private_account_password_reset_verification_valid_until +CREATE TRIGGER vibetype_private_account_password_reset_verification_valid_until BEFORE INSERT OR UPDATE OF password_reset_verification - ON maevsi_private.account + ON vibetype_private.account FOR EACH ROW - EXECUTE PROCEDURE maevsi_private.account_password_reset_verification_valid_until(); + EXECUTE PROCEDURE vibetype_private.account_password_reset_verification_valid_until(); COMMIT; diff --git a/src/deploy/table_account_public.sql b/src/deploy/table_account_public.sql index b9229de8..b14f4b0d 100644 --- a/src/deploy/table_account_public.sql +++ b/src/deploy/table_account_public.sql @@ -1,21 +1,21 @@ BEGIN; -CREATE TABLE maevsi.account ( - id UUID PRIMARY KEY REFERENCES maevsi_private.account(id) ON DELETE CASCADE, +CREATE TABLE vibetype.account ( + id UUID PRIMARY KEY REFERENCES vibetype_private.account(id) ON DELETE CASCADE, username TEXT NOT NULL CHECK (char_length(username) < 100 AND username ~ '^[-A-Za-z0-9]+$') UNIQUE ); -COMMENT ON TABLE maevsi.account IS 'Public account data.'; -COMMENT ON COLUMN maevsi.account.id IS 'The account''s internal id.'; -COMMENT ON COLUMN maevsi.account.username IS 'The account''s username.'; +COMMENT ON TABLE vibetype.account IS 'Public account data.'; +COMMENT ON COLUMN vibetype.account.id IS 'The account''s internal id.'; +COMMENT ON COLUMN vibetype.account.username IS 'The account''s username.'; -GRANT SELECT ON TABLE maevsi.account TO maevsi_account, maevsi_anonymous; +GRANT SELECT ON TABLE vibetype.account TO vibetype_account, vibetype_anonymous; -ALTER TABLE maevsi.account ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.account ENABLE ROW LEVEL SECURITY; -- Make all accounts accessible by everyone. -CREATE POLICY account_select ON maevsi.account FOR SELECT USING ( +CREATE POLICY account_select ON vibetype.account FOR SELECT USING ( TRUE ); diff --git a/src/deploy/table_account_social_network.sql b/src/deploy/table_account_social_network.sql index b83cc143..8c3fc7ac 100644 --- a/src/deploy/table_account_social_network.sql +++ b/src/deploy/table_account_social_network.sql @@ -1,17 +1,17 @@ BEGIN; -CREATE TABLE maevsi.account_social_network ( - account_id UUID NOT NULL REFERENCES maevsi.account(id) ON DELETE CASCADE, - social_network maevsi.social_network NOT NULL, +CREATE TABLE vibetype.account_social_network ( + account_id UUID NOT NULL REFERENCES vibetype.account(id) ON DELETE CASCADE, + social_network vibetype.social_network NOT NULL, social_network_username TEXT NOT NULL, PRIMARY KEY (account_id, social_network) ); -COMMENT ON TABLE maevsi.account_social_network IS 'Links accounts to their social media profiles. Each entry represents a specific social network and associated username for an account.'; -COMMENT ON COLUMN maevsi.account_social_network.account_id IS 'The unique identifier of the account.'; -COMMENT ON COLUMN maevsi.account_social_network.social_network IS 'The social network to which the account is linked.'; -COMMENT ON COLUMN maevsi.account_social_network.social_network_username IS 'The username of the account on the specified social network.'; -COMMENT ON CONSTRAINT account_social_network_pkey ON maevsi.account_social_network IS 'Ensures uniqueness by combining the account ID and social network, allowing each account to have a single entry per social network.'; +COMMENT ON TABLE vibetype.account_social_network IS 'Links accounts to their social media profiles. Each entry represents a specific social network and associated username for an account.'; +COMMENT ON COLUMN vibetype.account_social_network.account_id IS 'The unique identifier of the account.'; +COMMENT ON COLUMN vibetype.account_social_network.social_network IS 'The social network to which the account is linked.'; +COMMENT ON COLUMN vibetype.account_social_network.social_network_username IS 'The username of the account on the specified social network.'; +COMMENT ON CONSTRAINT account_social_network_pkey ON vibetype.account_social_network IS 'Ensures uniqueness by combining the account ID and social network, allowing each account to have a single entry per social network.'; COMMIT; diff --git a/src/deploy/table_account_social_network_policy.sql b/src/deploy/table_account_social_network_policy.sql index 99c9eff9..f3fab044 100644 --- a/src/deploy/table_account_social_network_policy.sql +++ b/src/deploy/table_account_social_network_policy.sql @@ -1,23 +1,23 @@ BEGIN; -GRANT SELECT ON TABLE maevsi.account_social_network TO maevsi_anonymous; -GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE maevsi.account_social_network TO maevsi_account; +GRANT SELECT ON TABLE vibetype.account_social_network TO vibetype_anonymous; +GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE vibetype.account_social_network TO vibetype_account; -ALTER TABLE maevsi.account_social_network ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.account_social_network ENABLE ROW LEVEL SECURITY; -- Only allow inserting social links of the current account. -CREATE POLICY account_social_network_insert ON maevsi.account_social_network FOR INSERT WITH CHECK ( - account_id = maevsi.invoker_account_id() +CREATE POLICY account_social_network_insert ON vibetype.account_social_network FOR INSERT WITH CHECK ( + account_id = vibetype.invoker_account_id() ); -- Only allow updating social links of the current account. -CREATE POLICY account_social_network_update ON maevsi.account_social_network FOR UPDATE USING ( - account_id = maevsi.invoker_account_id() +CREATE POLICY account_social_network_update ON vibetype.account_social_network FOR UPDATE USING ( + account_id = vibetype.invoker_account_id() ); -- Only allow deleting social links of the current account.. -CREATE POLICY account_social_network_delete ON maevsi.account_social_network FOR DELETE USING ( - account_id = maevsi.invoker_account_id() +CREATE POLICY account_social_network_delete ON vibetype.account_social_network FOR DELETE USING ( + account_id = vibetype.invoker_account_id() ); COMMIT; diff --git a/src/deploy/table_achievement.sql b/src/deploy/table_achievement.sql index 1c96cccb..fc42e95b 100644 --- a/src/deploy/table_achievement.sql +++ b/src/deploy/table_achievement.sql @@ -1,27 +1,27 @@ BEGIN; -CREATE TABLE maevsi.achievement ( +CREATE TABLE vibetype.achievement ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - account_id UUID NOT NULL REFERENCES maevsi.account(id), - achievement maevsi.achievement_type NOT NULL, + account_id UUID NOT NULL REFERENCES vibetype.account(id), + achievement vibetype.achievement_type NOT NULL, level INTEGER NOT NULL CHECK (level > 0) DEFAULT 1, UNIQUE (account_id, achievement) ); -COMMENT ON TABLE maevsi.achievement IS 'Achievements unlocked by users.'; -COMMENT ON COLUMN maevsi.achievement.id IS 'The achievement unlock''s internal id.'; -COMMENT ON COLUMN maevsi.achievement.account_id IS 'The account which unlocked the achievement.'; -COMMENT ON COLUMN maevsi.achievement.achievement IS 'The unlock''s achievement.'; -COMMENT ON COLUMN maevsi.achievement.level IS 'The achievement unlock''s level.'; +COMMENT ON TABLE vibetype.achievement IS 'Achievements unlocked by users.'; +COMMENT ON COLUMN vibetype.achievement.id IS 'The achievement unlock''s internal id.'; +COMMENT ON COLUMN vibetype.achievement.account_id IS 'The account which unlocked the achievement.'; +COMMENT ON COLUMN vibetype.achievement.achievement IS 'The unlock''s achievement.'; +COMMENT ON COLUMN vibetype.achievement.level IS 'The achievement unlock''s level.'; -GRANT SELECT ON TABLE maevsi.achievement TO maevsi_account, maevsi_anonymous; +GRANT SELECT ON TABLE vibetype.achievement TO vibetype_account, vibetype_anonymous; -ALTER TABLE maevsi.achievement ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.achievement ENABLE ROW LEVEL SECURITY; -- Make all achievement unlocks accessible by everyone. -CREATE POLICY achievement_select ON maevsi.achievement FOR SELECT USING ( +CREATE POLICY achievement_select ON vibetype.achievement FOR SELECT USING ( TRUE ); diff --git a/src/deploy/table_achievement_code.sql b/src/deploy/table_achievement_code.sql index fae0126d..88a54ceb 100644 --- a/src/deploy/table_achievement_code.sql +++ b/src/deploy/table_achievement_code.sql @@ -1,24 +1,24 @@ BEGIN; -CREATE TABLE maevsi_private.achievement_code ( +CREATE TABLE vibetype_private.achievement_code ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), alias TEXT NOT NULL CHECK (char_length(alias) < 1000) UNIQUE, - achievement maevsi.achievement_type NOT NULL + achievement vibetype.achievement_type NOT NULL ); -COMMENT ON TABLE maevsi_private.achievement_code IS 'Codes that unlock achievements.'; -COMMENT ON COLUMN maevsi_private.achievement_code.id IS 'The code that unlocks an achievement.'; -COMMENT ON COLUMN maevsi_private.achievement_code.alias IS 'An alternative code, e.g. human readable, that unlocks an achievement.'; -COMMENT ON COLUMN maevsi_private.achievement_code.achievement IS 'The achievement that is unlocked by the code.'; +COMMENT ON TABLE vibetype_private.achievement_code IS 'Codes that unlock achievements.'; +COMMENT ON COLUMN vibetype_private.achievement_code.id IS 'The code that unlocks an achievement.'; +COMMENT ON COLUMN vibetype_private.achievement_code.alias IS 'An alternative code, e.g. human readable, that unlocks an achievement.'; +COMMENT ON COLUMN vibetype_private.achievement_code.achievement IS 'The achievement that is unlocked by the code.'; -GRANT SELECT ON TABLE maevsi_private.achievement_code TO maevsi_tusd; +GRANT SELECT ON TABLE vibetype_private.achievement_code TO vibetype_tusd; -ALTER TABLE maevsi_private.achievement_code ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype_private.achievement_code ENABLE ROW LEVEL SECURITY; -- TODO: replace role tusd by backend -- Make all achievement codes accessible by tusd. -CREATE POLICY achievement_code_select ON maevsi_private.achievement_code FOR SELECT USING ( +CREATE POLICY achievement_code_select ON vibetype_private.achievement_code FOR SELECT USING ( TRUE ); diff --git a/src/deploy/table_address.sql b/src/deploy/table_address.sql index fbb4ce32..8ec44270 100644 --- a/src/deploy/table_address.sql +++ b/src/deploy/table_address.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE TABLE maevsi.address ( +CREATE TABLE vibetype.address ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), name TEXT NOT NULL CHECK (char_length(name) > 0 AND char_length(name) <= 300), @@ -12,33 +12,33 @@ CREATE TABLE maevsi.address ( country TEXT NOT NULL CHECK (char_length(country) > 0 AND char_length(country) <= 300), created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, - created_by UUID REFERENCES maevsi.account(id) NOT NULL, + created_by UUID REFERENCES vibetype.account(id) NOT NULL, updated_at TIMESTAMP WITH TIME ZONE, - updated_by UUID REFERENCES maevsi.account(id) NOT NULL + updated_by UUID REFERENCES vibetype.account(id) NOT NULL ); -COMMENT ON TABLE maevsi.address IS 'Stores detailed address information, including lines, city, state, country, and metadata.'; - -COMMENT ON COLUMN maevsi.address.id IS E'@omit create,update\nPrimary key, uniquely identifies each address.'; -COMMENT ON COLUMN maevsi.address.name IS 'Person or company name. Must be between 1 and 300 characters.'; -COMMENT ON COLUMN maevsi.address.line_1 IS 'First line of the address (e.g., street address). Must be between 1 and 300 characters.'; -COMMENT ON COLUMN maevsi.address.line_2 IS 'Second line of the address, if needed. Must be between 1 and 300 characters.'; -COMMENT ON COLUMN maevsi.address.postal_code IS 'Postal or ZIP code for the address. Must be between 1 and 20 characters.'; -COMMENT ON COLUMN maevsi.address.city IS 'City of the address. Must be between 1 and 300 characters.'; -COMMENT ON COLUMN maevsi.address.region IS 'Region of the address (e.g., state, province, county, department or territory). Must be between 1 and 300 characters.'; -COMMENT ON COLUMN maevsi.address.country IS 'Country of the address. Must be between 1 and 300 characters.'; -COMMENT ON COLUMN maevsi.address.created_at IS E'@omit create,update\nTimestamp when the address was created. Defaults to the current timestamp.'; -COMMENT ON COLUMN maevsi.address.created_by IS E'@omit create,update\nReference to the account that created the address.'; -COMMENT ON COLUMN maevsi.address.updated_at IS E'@omit create,update\nTimestamp when the address was last updated.'; -COMMENT ON COLUMN maevsi.address.updated_by IS E'@omit create,update\nReference to the account that last updated the address.'; +COMMENT ON TABLE vibetype.address IS 'Stores detailed address information, including lines, city, state, country, and metadata.'; + +COMMENT ON COLUMN vibetype.address.id IS E'@omit create,update\nPrimary key, uniquely identifies each address.'; +COMMENT ON COLUMN vibetype.address.name IS 'Person or company name. Must be between 1 and 300 characters.'; +COMMENT ON COLUMN vibetype.address.line_1 IS 'First line of the address (e.g., street address). Must be between 1 and 300 characters.'; +COMMENT ON COLUMN vibetype.address.line_2 IS 'Second line of the address, if needed. Must be between 1 and 300 characters.'; +COMMENT ON COLUMN vibetype.address.postal_code IS 'Postal or ZIP code for the address. Must be between 1 and 20 characters.'; +COMMENT ON COLUMN vibetype.address.city IS 'City of the address. Must be between 1 and 300 characters.'; +COMMENT ON COLUMN vibetype.address.region IS 'Region of the address (e.g., state, province, county, department or territory). Must be between 1 and 300 characters.'; +COMMENT ON COLUMN vibetype.address.country IS 'Country of the address. Must be between 1 and 300 characters.'; +COMMENT ON COLUMN vibetype.address.created_at IS E'@omit create,update\nTimestamp when the address was created. Defaults to the current timestamp.'; +COMMENT ON COLUMN vibetype.address.created_by IS E'@omit create,update\nReference to the account that created the address.'; +COMMENT ON COLUMN vibetype.address.updated_at IS E'@omit create,update\nTimestamp when the address was last updated.'; +COMMENT ON COLUMN vibetype.address.updated_by IS E'@omit create,update\nReference to the account that last updated the address.'; -- GRANTs, RLS and POLICYs are specified in 'table_address_policy`. -CREATE TRIGGER maevsi_trigger_address_update +CREATE TRIGGER vibetype_trigger_address_update BEFORE UPDATE - ON maevsi.address + ON vibetype.address FOR EACH ROW - EXECUTE PROCEDURE maevsi.trigger_metadata_update(); + EXECUTE PROCEDURE vibetype.trigger_metadata_update(); COMMIT; diff --git a/src/deploy/table_address_policy.sql b/src/deploy/table_address_policy.sql index 37f116ad..47ec30dd 100644 --- a/src/deploy/table_address_policy.sql +++ b/src/deploy/table_address_policy.sql @@ -1,33 +1,33 @@ BEGIN; -GRANT SELECT ON TABLE maevsi.address TO maevsi_account, maevsi_anonymous; -GRANT INSERT, UPDATE, DELETE ON TABLE maevsi.address TO maevsi_account; +GRANT SELECT ON TABLE vibetype.address TO vibetype_account, vibetype_anonymous; +GRANT INSERT, UPDATE, DELETE ON TABLE vibetype.address TO vibetype_account; -ALTER TABLE maevsi.address ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.address ENABLE ROW LEVEL SECURITY; -- Only allow selects for addresses created by the invoker's account. -- Disallow selects for addresses created by a blocked account. -CREATE POLICY address_select ON maevsi.address FOR SELECT USING ( - created_by = maevsi.invoker_account_id() +CREATE POLICY address_select ON vibetype.address FOR SELECT USING ( + created_by = vibetype.invoker_account_id() AND created_by NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) ); -- Only allow inserts for addresses created by the invoker's account. -CREATE POLICY address_insert ON maevsi.address FOR INSERT WITH CHECK ( - created_by = maevsi.invoker_account_id() +CREATE POLICY address_insert ON vibetype.address FOR INSERT WITH CHECK ( + created_by = vibetype.invoker_account_id() ); -- Only allow updates for addresses created by the invoker's account. -CREATE POLICY address_update ON maevsi.address FOR UPDATE USING ( - created_by = maevsi.invoker_account_id() +CREATE POLICY address_update ON vibetype.address FOR UPDATE USING ( + created_by = vibetype.invoker_account_id() ); -- Only allow deletes for addresses created by the invoker's account. -CREATE POLICY address_delete ON maevsi.address FOR DELETE USING ( - created_by = maevsi.invoker_account_id() +CREATE POLICY address_delete ON vibetype.address FOR DELETE USING ( + created_by = vibetype.invoker_account_id() ); COMMIT; diff --git a/src/deploy/table_contact.sql b/src/deploy/table_contact.sql index c1ab863f..453e6b09 100644 --- a/src/deploy/table_contact.sql +++ b/src/deploy/table_contact.sql @@ -1,14 +1,14 @@ BEGIN; -CREATE TABLE maevsi.contact ( +CREATE TABLE vibetype.contact ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - account_id UUID REFERENCES maevsi.account(id), - address_id UUID REFERENCES maevsi.address(id), + account_id UUID REFERENCES vibetype.account(id), + address_id UUID REFERENCES vibetype.address(id), email_address TEXT CHECK (char_length(email_address) < 255), -- no regex check as "a valid email address is one that you can send emails to" (http://www.dominicsayers.com/isemail/) email_address_hash TEXT GENERATED ALWAYS AS (md5(lower(substring(email_address, '\S(?:.*\S)*')))) STORED, -- for gravatar profile pictures first_name TEXT CHECK (char_length(first_name) > 0 AND char_length(first_name) <= 100), - language maevsi.language, + language vibetype.language, last_name TEXT CHECK (char_length(last_name) > 0 AND char_length(last_name) <= 100), nickname TEXT CHECK (char_length(nickname) > 0 AND char_length(nickname) <= 100), note TEXT CHECK (char_length(note) > 0 AND char_length(note) <= 1000), @@ -17,44 +17,44 @@ CREATE TABLE maevsi.contact ( url TEXT CHECK (char_length("url") <= 300 AND "url" ~ '^https:\/\/'), created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, - created_by UUID NOT NULL REFERENCES maevsi.account(id) ON DELETE CASCADE, + created_by UUID NOT NULL REFERENCES vibetype.account(id) ON DELETE CASCADE, UNIQUE (created_by, account_id) ); -COMMENT ON TABLE maevsi.contact IS 'Stores contact information related to accounts, including personal details, communication preferences, and metadata.'; -COMMENT ON COLUMN maevsi.contact.id IS E'@omit create,update\nPrimary key, uniquely identifies each contact.'; -COMMENT ON COLUMN maevsi.contact.account_id IS 'Optional reference to an associated account.'; -COMMENT ON COLUMN maevsi.contact.address_id IS 'Optional reference to the physical address of the contact.'; -COMMENT ON COLUMN maevsi.contact.email_address IS 'Email address of the contact. Must be shorter than 256 characters.'; -COMMENT ON COLUMN maevsi.contact.email_address_hash IS E'@omit create,update\nHash of the email address, generated using md5 on the lowercased trimmed version of the email. Useful to display a profile picture from Gravatar.'; -COMMENT ON COLUMN maevsi.contact.first_name IS 'First name of the contact. Must be between 1 and 100 characters.'; -COMMENT ON COLUMN maevsi.contact.language IS 'Reference to the preferred language of the contact.'; -COMMENT ON COLUMN maevsi.contact.last_name IS 'Last name of the contact. Must be between 1 and 100 characters.'; -COMMENT ON COLUMN maevsi.contact.nickname IS 'Nickname of the contact. Must be between 1 and 100 characters. Useful when the contact is not commonly referred to by their legal name.'; -COMMENT ON COLUMN maevsi.contact.note IS 'Additional notes about the contact. Must be between 1 and 1.000 characters. Useful for providing context or distinguishing details if the name alone is insufficient.'; -COMMENT ON COLUMN maevsi.contact.phone_number IS 'The international phone number of the contact, formatted according to E.164 (https://wikipedia.org/wiki/E.164).'; -COMMENT ON COLUMN maevsi.contact.timezone IS 'Timezone of the contact in ISO 8601 format, e.g., `+02:00`, `-05:30`, or `Z`.'; -COMMENT ON COLUMN maevsi.contact.url IS 'URL associated with the contact, must start with "https://" and be up to 300 characters.'; -COMMENT ON COLUMN maevsi.contact.created_at IS E'@omit create,update\nTimestamp when the contact was created. Defaults to the current timestamp.'; -COMMENT ON COLUMN maevsi.contact.created_by IS 'Reference to the account that created this contact. Enforces cascading deletion.'; -COMMENT ON CONSTRAINT contact_created_by_account_id_key ON maevsi.contact IS 'Ensures the uniqueness of the combination of `created_by` and `account_id` for a contact.'; +COMMENT ON TABLE vibetype.contact IS 'Stores contact information related to accounts, including personal details, communication preferences, and metadata.'; +COMMENT ON COLUMN vibetype.contact.id IS E'@omit create,update\nPrimary key, uniquely identifies each contact.'; +COMMENT ON COLUMN vibetype.contact.account_id IS 'Optional reference to an associated account.'; +COMMENT ON COLUMN vibetype.contact.address_id IS 'Optional reference to the physical address of the contact.'; +COMMENT ON COLUMN vibetype.contact.email_address IS 'Email address of the contact. Must be shorter than 256 characters.'; +COMMENT ON COLUMN vibetype.contact.email_address_hash IS E'@omit create,update\nHash of the email address, generated using md5 on the lowercased trimmed version of the email. Useful to display a profile picture from Gravatar.'; +COMMENT ON COLUMN vibetype.contact.first_name IS 'First name of the contact. Must be between 1 and 100 characters.'; +COMMENT ON COLUMN vibetype.contact.language IS 'Reference to the preferred language of the contact.'; +COMMENT ON COLUMN vibetype.contact.last_name IS 'Last name of the contact. Must be between 1 and 100 characters.'; +COMMENT ON COLUMN vibetype.contact.nickname IS 'Nickname of the contact. Must be between 1 and 100 characters. Useful when the contact is not commonly referred to by their legal name.'; +COMMENT ON COLUMN vibetype.contact.note IS 'Additional notes about the contact. Must be between 1 and 1.000 characters. Useful for providing context or distinguishing details if the name alone is insufficient.'; +COMMENT ON COLUMN vibetype.contact.phone_number IS 'The international phone number of the contact, formatted according to E.164 (https://wikipedia.org/wiki/E.164).'; +COMMENT ON COLUMN vibetype.contact.timezone IS 'Timezone of the contact in ISO 8601 format, e.g., `+02:00`, `-05:30`, or `Z`.'; +COMMENT ON COLUMN vibetype.contact.url IS 'URL associated with the contact, must start with "https://" and be up to 300 characters.'; +COMMENT ON COLUMN vibetype.contact.created_at IS E'@omit create,update\nTimestamp when the contact was created. Defaults to the current timestamp.'; +COMMENT ON COLUMN vibetype.contact.created_by IS 'Reference to the account that created this contact. Enforces cascading deletion.'; +COMMENT ON CONSTRAINT contact_created_by_account_id_key ON vibetype.contact IS 'Ensures the uniqueness of the combination of `created_by` and `account_id` for a contact.'; -- GRANTs, RLS and POLICYs are specified in 'table_contact_policy`. -CREATE FUNCTION maevsi.trigger_contact_update_account_id() RETURNS TRIGGER AS $$ +CREATE FUNCTION vibetype.trigger_contact_update_account_id() RETURNS TRIGGER AS $$ BEGIN IF ( -- invoked without account it - maevsi.invoker_account_id() IS NULL + vibetype.invoker_account_id() IS NULL OR -- invoked with account it -- and ( -- updating own account's contact - OLD.account_id = maevsi.invoker_account_id() + OLD.account_id = vibetype.invoker_account_id() AND - OLD.created_by = maevsi.invoker_account_id() + OLD.created_by = vibetype.invoker_account_id() AND ( -- trying to detach from account @@ -71,15 +71,15 @@ CREATE FUNCTION maevsi.trigger_contact_update_account_id() RETURNS TRIGGER AS $$ END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.trigger_contact_update_account_id() IS 'Prevents invalid updates to contacts.'; +COMMENT ON FUNCTION vibetype.trigger_contact_update_account_id() IS 'Prevents invalid updates to contacts.'; -GRANT EXECUTE ON FUNCTION maevsi.trigger_contact_update_account_id() TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype.trigger_contact_update_account_id() TO vibetype_account; -CREATE TRIGGER maevsi_trigger_contact_update_account_id +CREATE TRIGGER vibetype_trigger_contact_update_account_id BEFORE UPDATE OF account_id, created_by - ON maevsi.contact + ON vibetype.contact FOR EACH ROW - EXECUTE PROCEDURE maevsi.trigger_contact_update_account_id(); + EXECUTE PROCEDURE vibetype.trigger_contact_update_account_id(); COMMIT; diff --git a/src/deploy/table_contact_policy.sql b/src/deploy/table_contact_policy.sql index da463899..e9f3eca4 100644 --- a/src/deploy/table_contact_policy.sql +++ b/src/deploy/table_contact_policy.sql @@ -1,67 +1,67 @@ BEGIN; -GRANT SELECT ON TABLE maevsi.contact TO maevsi_account, maevsi_anonymous; -GRANT INSERT, UPDATE, DELETE ON TABLE maevsi.contact TO maevsi_account; +GRANT SELECT ON TABLE vibetype.contact TO vibetype_account, vibetype_anonymous; +GRANT INSERT, UPDATE, DELETE ON TABLE vibetype.contact TO vibetype_account; -ALTER TABLE maevsi.contact ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.contact ENABLE ROW LEVEL SECURITY; -- 1) Display contacts referencing the invoker's account, omit contacts created by an account -- blocked by the invoker or by an account that blocked the invoker. -- 2) Display contacts created by the invoker's account, omit contacts referring to an account -- blocked by the invoker or by an account that blocked the invoker. -- 3) Display contacts for which an accessible guest exists. -CREATE POLICY contact_select ON maevsi.contact FOR SELECT USING ( +CREATE POLICY contact_select ON vibetype.contact FOR SELECT USING ( ( - account_id = maevsi.invoker_account_id() + account_id = vibetype.invoker_account_id() AND created_by NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) ) OR ( - created_by = maevsi.invoker_account_id() + created_by = vibetype.invoker_account_id() AND ( account_id IS NULL OR account_id NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) ) ) - OR id IN (SELECT maevsi.guest_contact_ids()) + OR id IN (SELECT vibetype.guest_contact_ids()) ); -- Only allow inserts for contacts created by the invoker's account. -- Disallow inserts for contacts that refer to a blocked account. -CREATE POLICY contact_insert ON maevsi.contact FOR INSERT WITH CHECK ( - created_by = maevsi.invoker_account_id() +CREATE POLICY contact_insert ON vibetype.contact FOR INSERT WITH CHECK ( + created_by = vibetype.invoker_account_id() AND account_id NOT IN ( SELECT blocked_account_id - FROM maevsi.account_block - WHERE created_by = maevsi.invoker_account_id() + FROM vibetype.account_block + WHERE created_by = vibetype.invoker_account_id() ) ); -- Only allow updates for contacts created by the invoker's account. -- No contact referring to a blocked account can be updated. -CREATE POLICY contact_update ON maevsi.contact FOR UPDATE USING ( - created_by = maevsi.invoker_account_id() +CREATE POLICY contact_update ON vibetype.contact FOR UPDATE USING ( + created_by = vibetype.invoker_account_id() AND account_id NOT IN ( SELECT blocked_account_id - FROM maevsi.account_block - WHERE created_by = maevsi.invoker_account_id() + FROM vibetype.account_block + WHERE created_by = vibetype.invoker_account_id() ) ); -- Only allow deletes for contacts created by the invoker's account except for the own account's contact. -CREATE POLICY contact_delete ON maevsi.contact FOR DELETE USING ( - maevsi.invoker_account_id() IS NOT NULL +CREATE POLICY contact_delete ON vibetype.contact FOR DELETE USING ( + vibetype.invoker_account_id() IS NOT NULL AND - created_by = maevsi.invoker_account_id() + created_by = vibetype.invoker_account_id() AND - account_id IS DISTINCT FROM maevsi.invoker_account_id() + account_id IS DISTINCT FROM vibetype.invoker_account_id() ); COMMIT; diff --git a/src/deploy/table_event.sql b/src/deploy/table_event.sql index 50efabe1..a9adb676 100644 --- a/src/deploy/table_event.sql +++ b/src/deploy/table_event.sql @@ -1,58 +1,58 @@ BEGIN; -CREATE TABLE maevsi.event ( +CREATE TABLE vibetype.event ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - address_id UUID REFERENCES maevsi.address(id), + address_id UUID REFERENCES vibetype.address(id), description TEXT CHECK (char_length("description") > 0 AND char_length("description") < 1000000), "end" TIMESTAMP WITH TIME ZONE, guest_count_maximum INTEGER CHECK (guest_count_maximum > 0), is_archived BOOLEAN NOT NULL DEFAULT FALSE, is_in_person BOOLEAN, is_remote BOOLEAN, - language maevsi.language, + language vibetype.language, location TEXT CHECK (char_length("location") > 0 AND char_length("location") < 300), location_geography GEOGRAPHY(Point, 4326), name TEXT NOT NULL CHECK (char_length("name") > 0 AND char_length("name") < 100), slug TEXT NOT NULL CHECK (char_length(slug) < 100 AND slug ~ '^[-A-Za-z0-9]+$'), start TIMESTAMP WITH TIME ZONE NOT NULL, url TEXT CHECK (char_length("url") < 300 AND "url" ~ '^https:\/\/'), - visibility maevsi.event_visibility NOT NULL, + visibility vibetype.event_visibility NOT NULL, created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, - created_by UUID NOT NULL REFERENCES maevsi.account(id), + created_by UUID NOT NULL REFERENCES vibetype.account(id), search_vector TSVECTOR, UNIQUE (created_by, slug) ); -COMMENT ON TABLE maevsi.event IS 'An event.'; -COMMENT ON COLUMN maevsi.event.id IS E'@omit create,update\nThe event''s internal id.'; -COMMENT ON COLUMN maevsi.event.address_id IS 'Optional reference to the physical address of the event.'; -COMMENT ON COLUMN maevsi.event.description IS 'The event''s description.'; -COMMENT ON COLUMN maevsi.event.end IS 'The event''s end date and time, with timezone.'; -COMMENT ON COLUMN maevsi.event.guest_count_maximum IS 'The event''s maximum guest count.'; -COMMENT ON COLUMN maevsi.event.is_archived IS 'Indicates whether the event is archived.'; -COMMENT ON COLUMN maevsi.event.is_in_person IS 'Indicates whether the event takes place in person.'; -COMMENT ON COLUMN maevsi.event.is_remote IS 'Indicates whether the event takes place remotely.'; -COMMENT ON COLUMN maevsi.event.location IS 'The event''s location as it can be shown on a map.'; -COMMENT ON COLUMN maevsi.event.location_geography IS 'The event''s geographic location.'; -COMMENT ON COLUMN maevsi.event.name IS 'The event''s name.'; -COMMENT ON COLUMN maevsi.event.slug IS 'The event''s name, slugified.'; -COMMENT ON COLUMN maevsi.event.start IS 'The event''s start date and time, with timezone.'; -COMMENT ON COLUMN maevsi.event.url IS 'The event''s unified resource locator.'; -COMMENT ON COLUMN maevsi.event.visibility IS 'The event''s visibility.'; -COMMENT ON COLUMN maevsi.event.created_at IS E'@omit create,update\nTimestamp of when the event was created, defaults to the current timestamp.'; -COMMENT ON COLUMN maevsi.event.created_by IS 'The event creator''s id.'; -COMMENT ON COLUMN maevsi.event.search_vector IS E'@omit\nA vector used for full-text search on events.'; +COMMENT ON TABLE vibetype.event IS 'An event.'; +COMMENT ON COLUMN vibetype.event.id IS E'@omit create,update\nThe event''s internal id.'; +COMMENT ON COLUMN vibetype.event.address_id IS 'Optional reference to the physical address of the event.'; +COMMENT ON COLUMN vibetype.event.description IS 'The event''s description.'; +COMMENT ON COLUMN vibetype.event.end IS 'The event''s end date and time, with timezone.'; +COMMENT ON COLUMN vibetype.event.guest_count_maximum IS 'The event''s maximum guest count.'; +COMMENT ON COLUMN vibetype.event.is_archived IS 'Indicates whether the event is archived.'; +COMMENT ON COLUMN vibetype.event.is_in_person IS 'Indicates whether the event takes place in person.'; +COMMENT ON COLUMN vibetype.event.is_remote IS 'Indicates whether the event takes place remotely.'; +COMMENT ON COLUMN vibetype.event.location IS 'The event''s location as it can be shown on a map.'; +COMMENT ON COLUMN vibetype.event.location_geography IS 'The event''s geographic location.'; +COMMENT ON COLUMN vibetype.event.name IS 'The event''s name.'; +COMMENT ON COLUMN vibetype.event.slug IS 'The event''s name, slugified.'; +COMMENT ON COLUMN vibetype.event.start IS 'The event''s start date and time, with timezone.'; +COMMENT ON COLUMN vibetype.event.url IS 'The event''s unified resource locator.'; +COMMENT ON COLUMN vibetype.event.visibility IS 'The event''s visibility.'; +COMMENT ON COLUMN vibetype.event.created_at IS E'@omit create,update\nTimestamp of when the event was created, defaults to the current timestamp.'; +COMMENT ON COLUMN vibetype.event.created_by IS 'The event creator''s id.'; +COMMENT ON COLUMN vibetype.event.search_vector IS E'@omit\nA vector used for full-text search on events.'; -CREATE INDEX idx_event_search_vector ON maevsi.event USING GIN(search_vector); +CREATE INDEX idx_event_search_vector ON vibetype.event USING GIN(search_vector); -CREATE FUNCTION maevsi.trigger_event_search_vector() RETURNS TRIGGER AS $$ +CREATE FUNCTION vibetype.trigger_event_search_vector() RETURNS TRIGGER AS $$ DECLARE ts_config regconfig; BEGIN - ts_config := maevsi.language_iso_full_text_search(NEW.language); + ts_config := vibetype.language_iso_full_text_search(NEW.language); NEW.search_vector := setweight(to_tsvector(ts_config, NEW.name), 'A') || @@ -62,17 +62,17 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi.trigger_event_search_vector() IS 'Generates a search vector for the event based on the name and description columns, weighted by their relevance and language configuration.'; +COMMENT ON FUNCTION vibetype.trigger_event_search_vector() IS 'Generates a search vector for the event based on the name and description columns, weighted by their relevance and language configuration.'; -GRANT EXECUTE ON FUNCTION maevsi.trigger_event_search_vector() TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.trigger_event_search_vector() TO vibetype_account, vibetype_anonymous; -CREATE TRIGGER maevsi_trigger_event_search_vector +CREATE TRIGGER vibetype_trigger_event_search_vector BEFORE INSERT OR UPDATE OF name, description, language - ON maevsi.event + ON vibetype.event FOR EACH ROW - EXECUTE FUNCTION maevsi.trigger_event_search_vector(); + EXECUTE FUNCTION vibetype.trigger_event_search_vector(); -- GRANTs, RLS and POLICYs are specified in 'table_event_policy`. diff --git a/src/deploy/table_event_category.sql b/src/deploy/table_event_category.sql index c22efef6..d1a01e03 100644 --- a/src/deploy/table_event_category.sql +++ b/src/deploy/table_event_category.sql @@ -1,10 +1,10 @@ BEGIN; -CREATE TABLE maevsi.event_category( +CREATE TABLE vibetype.event_category( category TEXT PRIMARY KEY ); -COMMENT ON TABLE maevsi.event_category IS 'Event categories.'; -COMMENT ON COLUMN maevsi.event_category.category IS 'A category name.'; +COMMENT ON TABLE vibetype.event_category IS 'Event categories.'; +COMMENT ON COLUMN vibetype.event_category.category IS 'A category name.'; END; diff --git a/src/deploy/table_event_category_mapping.sql b/src/deploy/table_event_category_mapping.sql index 0977a8a2..d4a612d0 100644 --- a/src/deploy/table_event_category_mapping.sql +++ b/src/deploy/table_event_category_mapping.sql @@ -1,14 +1,14 @@ BEGIN; -CREATE TABLE maevsi.event_category_mapping ( - event_id uuid NOT NULL REFERENCES maevsi.event(id) ON DELETE CASCADE, - category TEXT NOT NULL REFERENCES maevsi.event_category(category) ON DELETE CASCADE, +CREATE TABLE vibetype.event_category_mapping ( + event_id uuid NOT NULL REFERENCES vibetype.event(id) ON DELETE CASCADE, + category TEXT NOT NULL REFERENCES vibetype.event_category(category) ON DELETE CASCADE, PRIMARY KEY (event_id, category) ); -COMMENT ON TABLE maevsi.event_category_mapping IS 'Mapping events to categories (M:N relationship).'; -COMMENT ON COLUMN maevsi.event_category_mapping.event_id IS 'An event id.'; -COMMENT ON COLUMN maevsi.event_category_mapping.category IS 'A category name.'; +COMMENT ON TABLE vibetype.event_category_mapping IS 'Mapping events to categories (M:N relationship).'; +COMMENT ON COLUMN vibetype.event_category_mapping.event_id IS 'An event id.'; +COMMENT ON COLUMN vibetype.event_category_mapping.category IS 'A category name.'; COMMIT; diff --git a/src/deploy/table_event_category_mapping_policy.sql b/src/deploy/table_event_category_mapping_policy.sql index 0ce7bb1c..a4f3214c 100644 --- a/src/deploy/table_event_category_mapping_policy.sql +++ b/src/deploy/table_event_category_mapping_policy.sql @@ -1,42 +1,42 @@ BEGIN; -GRANT SELECT ON TABLE maevsi.event_category_mapping TO maevsi_anonymous; -GRANT SELECT, INSERT, DELETE ON TABLE maevsi.event_category_mapping TO maevsi_account; +GRANT SELECT ON TABLE vibetype.event_category_mapping TO vibetype_anonymous; +GRANT SELECT, INSERT, DELETE ON TABLE vibetype.event_category_mapping TO vibetype_account; -ALTER TABLE maevsi.event_category_mapping ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event_category_mapping ENABLE ROW LEVEL SECURITY; -- Allow selects for events created by the current user. -- Allow events that are public or that the user is invited to, but exclude events -- created by a blocked user and events created by a user who blocked the current user. -CREATE POLICY event_category_mapping_select ON maevsi.event_category_mapping FOR SELECT USING ( +CREATE POLICY event_category_mapping_select ON vibetype.event_category_mapping FOR SELECT USING ( ( - maevsi.invoker_account_id() IS NOT NULL + vibetype.invoker_account_id() IS NOT NULL AND ( - (SELECT created_by FROM maevsi.event WHERE id = event_id) = maevsi.invoker_account_id() + (SELECT created_by FROM vibetype.event WHERE id = event_id) = vibetype.invoker_account_id() ) ) OR - event_id IN (SELECT maevsi_private.events_invited()) + event_id IN (SELECT vibetype_private.events_invited()) OR ( - (SELECT visibility FROM maevsi.event WHERE id = event_id) = 'public' - AND (SELECT created_by FROM maevsi.event WHERE id = event_id) NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + (SELECT visibility FROM vibetype.event WHERE id = event_id) = 'public' + AND (SELECT created_by FROM vibetype.event WHERE id = event_id) NOT IN ( + SELECT id FROM vibetype_private.account_block_ids() ) ) ); -- Only allow inserts for events created by user. -CREATE POLICY event_category_mapping_insert ON maevsi.event_category_mapping FOR INSERT WITH CHECK ( - maevsi.invoker_account_id() IS NOT NULL +CREATE POLICY event_category_mapping_insert ON vibetype.event_category_mapping FOR INSERT WITH CHECK ( + vibetype.invoker_account_id() IS NOT NULL AND - (SELECT created_by FROM maevsi.event WHERE id = event_id) = maevsi.invoker_account_id() + (SELECT created_by FROM vibetype.event WHERE id = event_id) = vibetype.invoker_account_id() ); -- Only allow deletes for events created by user. -CREATE POLICY event_category_mapping_delete ON maevsi.event_category_mapping FOR DELETE USING ( - maevsi.invoker_account_id() IS NOT NULL +CREATE POLICY event_category_mapping_delete ON vibetype.event_category_mapping FOR DELETE USING ( + vibetype.invoker_account_id() IS NOT NULL AND - (SELECT created_by FROM maevsi.event WHERE id = event_id) = maevsi.invoker_account_id() + (SELECT created_by FROM vibetype.event WHERE id = event_id) = vibetype.invoker_account_id() ); COMMIT; diff --git a/src/deploy/table_event_category_policy.sql b/src/deploy/table_event_category_policy.sql index 12e81b89..72cec890 100644 --- a/src/deploy/table_event_category_policy.sql +++ b/src/deploy/table_event_category_policy.sql @@ -1,6 +1,6 @@ BEGIN; -GRANT SELECT ON TABLE maevsi.event_category TO maevsi_anonymous, maevsi_account; +GRANT SELECT ON TABLE vibetype.event_category TO vibetype_anonymous, vibetype_account; -- no row level security necessary for this table as it does not contain user data diff --git a/src/deploy/table_event_favorite.sql b/src/deploy/table_event_favorite.sql index f59cc7ed..d3b89e55 100644 --- a/src/deploy/table_event_favorite.sql +++ b/src/deploy/table_event_favorite.sql @@ -1,22 +1,22 @@ BEGIN; -CREATE TABLE maevsi.event_favorite ( +CREATE TABLE vibetype.event_favorite ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - event_id UUID REFERENCES maevsi.event(id), + event_id UUID REFERENCES vibetype.event(id), created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, - created_by UUID REFERENCES maevsi.account(id) NOT NULL, + created_by UUID REFERENCES vibetype.account(id) NOT NULL, UNIQUE (created_by, event_id) ); -COMMENT ON TABLE maevsi.event_favorite IS 'Stores user-specific event favorites, linking an event to the account that marked it as a favorite.'; -COMMENT ON COLUMN maevsi.event_favorite.id IS E'@omit create,update\nPrimary key, uniquely identifies each favorite entry.'; -COMMENT ON COLUMN maevsi.event_favorite.event_id IS 'Reference to the event that is marked as a favorite.'; -COMMENT ON COLUMN maevsi.event_favorite.created_at IS E'@omit create,update\nTimestamp when the favorite was created. Defaults to the current timestamp.'; -COMMENT ON COLUMN maevsi.event_favorite.created_by IS E'@omit create,update\nReference to the account that created the event favorite.'; -COMMENT ON CONSTRAINT event_favorite_created_by_event_id_key ON maevsi.event_favorite IS 'Ensures that each user can mark an event as a favorite only once.'; +COMMENT ON TABLE vibetype.event_favorite IS 'Stores user-specific event favorites, linking an event to the account that marked it as a favorite.'; +COMMENT ON COLUMN vibetype.event_favorite.id IS E'@omit create,update\nPrimary key, uniquely identifies each favorite entry.'; +COMMENT ON COLUMN vibetype.event_favorite.event_id IS 'Reference to the event that is marked as a favorite.'; +COMMENT ON COLUMN vibetype.event_favorite.created_at IS E'@omit create,update\nTimestamp when the favorite was created. Defaults to the current timestamp.'; +COMMENT ON COLUMN vibetype.event_favorite.created_by IS E'@omit create,update\nReference to the account that created the event favorite.'; +COMMENT ON CONSTRAINT event_favorite_created_by_event_id_key ON vibetype.event_favorite IS 'Ensures that each user can mark an event as a favorite only once.'; -- GRANTs, RLS and POLICYs are specified in 'table_event_favorite_policy`. diff --git a/src/deploy/table_event_favorite_policy.sql b/src/deploy/table_event_favorite_policy.sql index 13a70874..5f0a550c 100644 --- a/src/deploy/table_event_favorite_policy.sql +++ b/src/deploy/table_event_favorite_policy.sql @@ -1,22 +1,22 @@ BEGIN; -GRANT SELECT, INSERT, DELETE ON TABLE maevsi.event_favorite TO maevsi_account; +GRANT SELECT, INSERT, DELETE ON TABLE vibetype.event_favorite TO vibetype_account; -ALTER TABLE maevsi.event_favorite ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event_favorite ENABLE ROW LEVEL SECURITY; -- Only display event favorites that were created by the invoker. -CREATE POLICY event_favorite_select ON maevsi.event_favorite FOR SELECT USING ( - created_by = maevsi.invoker_account_id() +CREATE POLICY event_favorite_select ON vibetype.event_favorite FOR SELECT USING ( + created_by = vibetype.invoker_account_id() ); -- Only allow inserts for event favorites created by the invoker. -CREATE POLICY event_favorite_insert ON maevsi.event_favorite FOR INSERT WITH CHECK ( - created_by = maevsi.invoker_account_id() +CREATE POLICY event_favorite_insert ON vibetype.event_favorite FOR INSERT WITH CHECK ( + created_by = vibetype.invoker_account_id() ); -- Only allow deletes for event favorites created by the invoker. -CREATE POLICY event_favorite_delete ON maevsi.event_favorite FOR DELETE USING ( - created_by = maevsi.invoker_account_id() +CREATE POLICY event_favorite_delete ON vibetype.event_favorite FOR DELETE USING ( + created_by = vibetype.invoker_account_id() ); COMMIT; diff --git a/src/deploy/table_event_group.sql b/src/deploy/table_event_group.sql index 72bd3fd5..e610d147 100644 --- a/src/deploy/table_event_group.sql +++ b/src/deploy/table_event_group.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE TABLE maevsi.event_group ( +CREATE TABLE vibetype.event_group ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), description TEXT CHECK (char_length("description") < 1000000), @@ -9,29 +9,29 @@ CREATE TABLE maevsi.event_group ( slug TEXT NOT NULL CHECK (char_length(slug) < 100 AND slug ~ '^[-A-Za-z0-9]+$'), created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, - created_by UUID NOT NULL REFERENCES maevsi.account(id), + created_by UUID NOT NULL REFERENCES vibetype.account(id), UNIQUE (created_by, slug) ); -COMMENT ON TABLE maevsi.event_group IS 'A group of events.'; -COMMENT ON COLUMN maevsi.event_group.id IS E'@omit create,update\nThe event group''s internal id.'; -COMMENT ON COLUMN maevsi.event_group.description IS 'The event group''s description.'; -COMMENT ON COLUMN maevsi.event_group.is_archived IS 'Indicates whether the event group is archived.'; -COMMENT ON COLUMN maevsi.event_group.name IS 'The event group''s name.'; -COMMENT ON COLUMN maevsi.event_group.slug IS E'@omit create,update\nThe event group''s name, slugified.'; -COMMENT ON COLUMN maevsi.event_group.created_at IS E'@omit create,update\nTimestamp of when the event group was created, defaults to the current timestamp.'; -COMMENT ON COLUMN maevsi.event_group.created_by IS 'The event group creator''s id.'; +COMMENT ON TABLE vibetype.event_group IS 'A group of events.'; +COMMENT ON COLUMN vibetype.event_group.id IS E'@omit create,update\nThe event group''s internal id.'; +COMMENT ON COLUMN vibetype.event_group.description IS 'The event group''s description.'; +COMMENT ON COLUMN vibetype.event_group.is_archived IS 'Indicates whether the event group is archived.'; +COMMENT ON COLUMN vibetype.event_group.name IS 'The event group''s name.'; +COMMENT ON COLUMN vibetype.event_group.slug IS E'@omit create,update\nThe event group''s name, slugified.'; +COMMENT ON COLUMN vibetype.event_group.created_at IS E'@omit create,update\nTimestamp of when the event group was created, defaults to the current timestamp.'; +COMMENT ON COLUMN vibetype.event_group.created_by IS 'The event group creator''s id.'; -GRANT SELECT ON TABLE maevsi.event_group TO maevsi_account, maevsi_anonymous; -GRANT INSERT, UPDATE, DELETE ON TABLE maevsi.event_group TO maevsi_account; +GRANT SELECT ON TABLE vibetype.event_group TO vibetype_account, vibetype_anonymous; +GRANT INSERT, UPDATE, DELETE ON TABLE vibetype.event_group TO vibetype_account; -ALTER TABLE maevsi.event_group ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event_group ENABLE ROW LEVEL SECURITY; -- TODO: --- CREATE POLICY event_group_select ON maevsi.event_group FOR SELECT USING ( +-- CREATE POLICY event_group_select ON vibetype.event_group FOR SELECT USING ( -- id IN ( --- SELECT event_group_id FROM maevsi.event_grouping +-- SELECT event_group_id FROM vibetype.event_grouping -- ) -- ); diff --git a/src/deploy/table_event_grouping.sql b/src/deploy/table_event_grouping.sql index 5aed651f..e1009fd7 100644 --- a/src/deploy/table_event_grouping.sql +++ b/src/deploy/table_event_grouping.sql @@ -1,28 +1,28 @@ BEGIN; -CREATE TABLE maevsi.event_grouping ( +CREATE TABLE vibetype.event_grouping ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - event_group_id UUID NOT NULL REFERENCES maevsi.event_group(id), - event_id UUID NOT NULL REFERENCES maevsi.event(id), + event_group_id UUID NOT NULL REFERENCES vibetype.event_group(id), + event_id UUID NOT NULL REFERENCES vibetype.event(id), UNIQUE (event_id, event_group_id) ); -COMMENT ON TABLE maevsi.event_grouping IS 'A bidirectional mapping between an event and an event group.'; -COMMENT ON COLUMN maevsi.event_grouping.id IS E'@omit create,update\nThe event grouping''s internal id.'; -COMMENT ON COLUMN maevsi.event_grouping.event_group_id IS 'The event grouping''s internal event group id.'; -COMMENT ON COLUMN maevsi.event_grouping.event_id IS 'The event grouping''s internal event id.'; +COMMENT ON TABLE vibetype.event_grouping IS 'A bidirectional mapping between an event and an event group.'; +COMMENT ON COLUMN vibetype.event_grouping.id IS E'@omit create,update\nThe event grouping''s internal id.'; +COMMENT ON COLUMN vibetype.event_grouping.event_group_id IS 'The event grouping''s internal event group id.'; +COMMENT ON COLUMN vibetype.event_grouping.event_id IS 'The event grouping''s internal event id.'; -GRANT SELECT ON TABLE maevsi.event_grouping TO maevsi_account, maevsi_anonymous; -GRANT INSERT, UPDATE, DELETE ON TABLE maevsi.event_grouping TO maevsi_account; +GRANT SELECT ON TABLE vibetype.event_grouping TO vibetype_account, vibetype_anonymous; +GRANT INSERT, UPDATE, DELETE ON TABLE vibetype.event_grouping TO vibetype_account; -ALTER TABLE maevsi.event_grouping ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event_grouping ENABLE ROW LEVEL SECURITY; -- TODO: --- CREATE POLICY event_grouping_select ON maevsi.event_grouping FOR SELECT USING ( +-- CREATE POLICY event_grouping_select ON vibetype.event_grouping FOR SELECT USING ( -- event_id IN ( --- SELECT id FROM maevsi.event +-- SELECT id FROM vibetype.event -- ) -- ); diff --git a/src/deploy/table_event_policy.sql b/src/deploy/table_event_policy.sql index 622ab588..b04e4aa8 100644 --- a/src/deploy/table_event_policy.sql +++ b/src/deploy/table_event_policy.sql @@ -1,51 +1,51 @@ BEGIN; -GRANT SELECT ON TABLE maevsi.event TO maevsi_account, maevsi_anonymous; -GRANT INSERT, UPDATE, DELETE ON TABLE maevsi.event TO maevsi_account; +GRANT SELECT ON TABLE vibetype.event TO vibetype_account, vibetype_anonymous; +GRANT INSERT, UPDATE, DELETE ON TABLE vibetype.event TO vibetype_account; -ALTER TABLE maevsi.event ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event ENABLE ROW LEVEL SECURITY; -- Only display events that are public and not full and not organized by a blocked account. -- Only display events that are organized by oneself. -- Only display events to which oneself is invited, but not by a guest created by a blocked account. -CREATE POLICY event_select ON maevsi.event FOR SELECT USING ( +CREATE POLICY event_select ON vibetype.event FOR SELECT USING ( ( visibility = 'public' AND ( guest_count_maximum IS NULL OR - guest_count_maximum > (maevsi.guest_count(id)) -- Using the function here is required as there would otherwise be infinite recursion. + guest_count_maximum > (vibetype.guest_count(id)) -- Using the function here is required as there would otherwise be infinite recursion. ) AND created_by NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) ) OR ( - created_by = maevsi.invoker_account_id() + created_by = vibetype.invoker_account_id() ) OR ( - id IN (SELECT maevsi_private.events_invited()) + id IN (SELECT vibetype_private.events_invited()) ) ); -- Only allow inserts for events created by the current user. -CREATE POLICY event_insert ON maevsi.event FOR INSERT WITH CHECK ( - maevsi.invoker_account_id() IS NOT NULL +CREATE POLICY event_insert ON vibetype.event FOR INSERT WITH CHECK ( + vibetype.invoker_account_id() IS NOT NULL AND - created_by = maevsi.invoker_account_id() + created_by = vibetype.invoker_account_id() ); -- Only allow updates for events created by the current user. -CREATE POLICY event_update ON maevsi.event FOR UPDATE USING ( - maevsi.invoker_account_id() IS NOT NULL +CREATE POLICY event_update ON vibetype.event FOR UPDATE USING ( + vibetype.invoker_account_id() IS NOT NULL AND - created_by = maevsi.invoker_account_id() + created_by = vibetype.invoker_account_id() ); -- Only allow deletes for events created by the current user. -CREATE POLICY event_delete ON maevsi.event FOR DELETE USING ( - created_by = maevsi.invoker_account_id() +CREATE POLICY event_delete ON vibetype.event FOR DELETE USING ( + created_by = vibetype.invoker_account_id() ); COMMIT; diff --git a/src/deploy/table_event_recommendation.sql b/src/deploy/table_event_recommendation.sql index 5921c689..3ed62cbb 100644 --- a/src/deploy/table_event_recommendation.sql +++ b/src/deploy/table_event_recommendation.sql @@ -1,19 +1,19 @@ BEGIN; -CREATE TABLE maevsi.event_recommendation ( - account_id uuid NOT NULL REFERENCES maevsi.account(id) ON DELETE CASCADE, - event_id uuid NOT NULL REFERENCES maevsi.event(id) ON DELETE CASCADE, +CREATE TABLE vibetype.event_recommendation ( + account_id uuid NOT NULL REFERENCES vibetype.account(id) ON DELETE CASCADE, + event_id uuid NOT NULL REFERENCES vibetype.event(id) ON DELETE CASCADE, score float(8), predicted_score float(8), PRIMARY KEY (account_id, event_id) ); -COMMENT ON TABLE maevsi.event_recommendation IS 'Events recommended to a user account (M:N relationship).'; -COMMENT ON COLUMN maevsi.event_recommendation.account_id IS 'A user account id.'; -COMMENT ON COLUMN maevsi.event_recommendation.event_id IS 'An event id.'; -COMMENT ON COLUMN maevsi.event_recommendation.score IS 'An event id.'; -COMMENT ON COLUMN maevsi.event_recommendation.predicted_score IS 'The score of the recommendation.'; -COMMENT ON COLUMN maevsi.event_recommendation.event_id IS 'The predicted score of the recommendation.'; +COMMENT ON TABLE vibetype.event_recommendation IS 'Events recommended to a user account (M:N relationship).'; +COMMENT ON COLUMN vibetype.event_recommendation.account_id IS 'A user account id.'; +COMMENT ON COLUMN vibetype.event_recommendation.event_id IS 'An event id.'; +COMMENT ON COLUMN vibetype.event_recommendation.score IS 'An event id.'; +COMMENT ON COLUMN vibetype.event_recommendation.predicted_score IS 'The score of the recommendation.'; +COMMENT ON COLUMN vibetype.event_recommendation.event_id IS 'The predicted score of the recommendation.'; COMMIT; diff --git a/src/deploy/table_event_recommendation_policy.sql b/src/deploy/table_event_recommendation_policy.sql index 569f54bb..44bc50bb 100644 --- a/src/deploy/table_event_recommendation_policy.sql +++ b/src/deploy/table_event_recommendation_policy.sql @@ -1,14 +1,14 @@ BEGIN; -GRANT SELECT, INSERT, DELETE ON TABLE maevsi.event_recommendation TO maevsi_account; +GRANT SELECT, INSERT, DELETE ON TABLE vibetype.event_recommendation TO vibetype_account; -ALTER TABLE maevsi.event_recommendation ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event_recommendation ENABLE ROW LEVEL SECURITY; -- Only allow selects by the current user. -CREATE POLICY event_recommendation_select ON maevsi.event_recommendation FOR SELECT USING ( - maevsi.invoker_account_id() IS NOT NULL +CREATE POLICY event_recommendation_select ON vibetype.event_recommendation FOR SELECT USING ( + vibetype.invoker_account_id() IS NOT NULL AND - account_id = maevsi.invoker_account_id() + account_id = vibetype.invoker_account_id() ); COMMIT; diff --git a/src/deploy/table_event_upload.sql b/src/deploy/table_event_upload.sql index a5446202..11d79901 100644 --- a/src/deploy/table_event_upload.sql +++ b/src/deploy/table_event_upload.sql @@ -1,17 +1,17 @@ BEGIN; -CREATE TABLE maevsi.event_upload ( +CREATE TABLE vibetype.event_upload ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - event_id UUID NOT NULL REFERENCES maevsi.event(id), - upload_id UUID NOT NULL REFERENCES maevsi.upload(id), + event_id UUID NOT NULL REFERENCES vibetype.event(id), + upload_id UUID NOT NULL REFERENCES vibetype.upload(id), UNIQUE (event_id, upload_id) ); -COMMENT ON TABLE maevsi.event_upload IS 'An assignment of an uploaded content (e.g. an image) to an event.'; -COMMENT ON COLUMN maevsi.event_upload.id IS E'@omit create,update\nThe event uploads''s internal id.'; -COMMENT ON COLUMN maevsi.event_upload.event_id IS E'@omit update\nThe event uploads''s internal event id.'; -COMMENT ON COLUMN maevsi.event_upload.upload_id IS E'@omit update\nThe event upload''s internal upload id.'; +COMMENT ON TABLE vibetype.event_upload IS 'An assignment of an uploaded content (e.g. an image) to an event.'; +COMMENT ON COLUMN vibetype.event_upload.id IS E'@omit create,update\nThe event uploads''s internal id.'; +COMMENT ON COLUMN vibetype.event_upload.event_id IS E'@omit update\nThe event uploads''s internal event id.'; +COMMENT ON COLUMN vibetype.event_upload.upload_id IS E'@omit update\nThe event upload''s internal upload id.'; END; diff --git a/src/deploy/table_event_upload_policy.sql b/src/deploy/table_event_upload_policy.sql index 5c74fb0e..bded7a03 100644 --- a/src/deploy/table_event_upload_policy.sql +++ b/src/deploy/table_event_upload_policy.sql @@ -1,36 +1,36 @@ BEGIN; -GRANT SELECT ON TABLE maevsi.event_upload TO maevsi_account, maevsi_anonymous; -GRANT INSERT, DELETE ON TABLE maevsi.event_upload TO maevsi_account; +GRANT SELECT ON TABLE vibetype.event_upload TO vibetype_account, vibetype_anonymous; +GRANT INSERT, DELETE ON TABLE vibetype.event_upload TO vibetype_account; -ALTER TABLE maevsi.event_upload ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event_upload ENABLE ROW LEVEL SECURITY; -- Only select rows for accessable events where accessability is specified -- by the event_select policy for table event. -CREATE POLICY event_upload_select ON maevsi.event_upload FOR SELECT USING ( +CREATE POLICY event_upload_select ON vibetype.event_upload FOR SELECT USING ( event_id IN ( - SELECT id FROM maevsi.event + SELECT id FROM vibetype.event ) ); -- Only allow inserts for events created by the current user and for uploads of the current_user. -CREATE POLICY event_upload_insert ON maevsi.event_upload FOR INSERT WITH CHECK ( +CREATE POLICY event_upload_insert ON vibetype.event_upload FOR INSERT WITH CHECK ( event_id IN ( - SELECT id FROM maevsi.event - WHERE created_by = maevsi.invoker_account_id() + SELECT id FROM vibetype.event + WHERE created_by = vibetype.invoker_account_id() ) AND upload_id IN ( - SELECT id FROM maevsi.upload - WHERE account_id = maevsi.invoker_account_id() + SELECT id FROM vibetype.upload + WHERE account_id = vibetype.invoker_account_id() ) ); -- Only allow deletes if event is created by the current user. -CREATE POLICY event_upload_delete ON maevsi.event_upload FOR DELETE USING ( +CREATE POLICY event_upload_delete ON vibetype.event_upload FOR DELETE USING ( event_id IN ( - SELECT id FROM maevsi.event - WHERE created_by = maevsi.invoker_account_id() + SELECT id FROM vibetype.event + WHERE created_by = vibetype.invoker_account_id() ) ); diff --git a/src/deploy/table_guest.sql b/src/deploy/table_guest.sql index c8fa119f..04e84173 100644 --- a/src/deploy/table_guest.sql +++ b/src/deploy/table_guest.sql @@ -1,29 +1,29 @@ BEGIN; -CREATE TABLE maevsi.guest ( +CREATE TABLE vibetype.guest ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - contact_id UUID NOT NULL REFERENCES maevsi.contact(id), - event_id UUID NOT NULL REFERENCES maevsi.event(id), - feedback maevsi.invitation_feedback, - feedback_paper maevsi.invitation_feedback_paper, + contact_id UUID NOT NULL REFERENCES vibetype.contact(id), + event_id UUID NOT NULL REFERENCES vibetype.event(id), + feedback vibetype.invitation_feedback, + feedback_paper vibetype.invitation_feedback_paper, created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP WITH TIME ZONE, - updated_by UUID REFERENCES maevsi.account(id), + updated_by UUID REFERENCES vibetype.account(id), UNIQUE (event_id, contact_id) ); -COMMENT ON TABLE maevsi.guest IS 'A guest for a contact. A bidirectional mapping between an event and a contact.'; -COMMENT ON COLUMN maevsi.guest.id IS E'@omit create,update\nThe guests''s internal id.'; -COMMENT ON COLUMN maevsi.guest.contact_id IS 'The internal id of the guest''s contact.'; -COMMENT ON COLUMN maevsi.guest.event_id IS 'The internal id of the guest''s event.'; -COMMENT ON COLUMN maevsi.guest.feedback IS 'The guest''s general feedback status.'; -COMMENT ON COLUMN maevsi.guest.feedback_paper IS 'The guest''s paper feedback status.'; -COMMENT ON COLUMN maevsi.guest.created_at IS E'@omit create,update\nTimestamp of when the guest was created, defaults to the current timestamp.'; -COMMENT ON COLUMN maevsi.guest.updated_at IS E'@omit create,update\nTimestamp of when the guest was last updated.'; -COMMENT ON COLUMN maevsi.guest.updated_by IS E'@omit create,update\nThe id of the account which last updated the guest. `NULL` if the guest was updated by an anonymous user.'; +COMMENT ON TABLE vibetype.guest IS 'A guest for a contact. A bidirectional mapping between an event and a contact.'; +COMMENT ON COLUMN vibetype.guest.id IS E'@omit create,update\nThe guests''s internal id.'; +COMMENT ON COLUMN vibetype.guest.contact_id IS 'The internal id of the guest''s contact.'; +COMMENT ON COLUMN vibetype.guest.event_id IS 'The internal id of the guest''s event.'; +COMMENT ON COLUMN vibetype.guest.feedback IS 'The guest''s general feedback status.'; +COMMENT ON COLUMN vibetype.guest.feedback_paper IS 'The guest''s paper feedback status.'; +COMMENT ON COLUMN vibetype.guest.created_at IS E'@omit create,update\nTimestamp of when the guest was created, defaults to the current timestamp.'; +COMMENT ON COLUMN vibetype.guest.updated_at IS E'@omit create,update\nTimestamp of when the guest was last updated.'; +COMMENT ON COLUMN vibetype.guest.updated_by IS E'@omit create,update\nThe id of the account which last updated the guest. `NULL` if the guest was updated by an anonymous user.'; -- GRANTs, RLS and POLICYs are specified in 'table_guest_policy`. diff --git a/src/deploy/table_guest_policy.sql b/src/deploy/table_guest_policy.sql index 9f425622..8fc43276 100644 --- a/src/deploy/table_guest_policy.sql +++ b/src/deploy/table_guest_policy.sql @@ -1,48 +1,48 @@ BEGIN; -GRANT SELECT, UPDATE ON TABLE maevsi.guest TO maevsi_account, maevsi_anonymous; -GRANT INSERT, DELETE ON TABLE maevsi.guest TO maevsi_account; +GRANT SELECT, UPDATE ON TABLE vibetype.guest TO vibetype_account, vibetype_anonymous; +GRANT INSERT, DELETE ON TABLE vibetype.guest TO vibetype_account; -ALTER TABLE maevsi.guest ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.guest ENABLE ROW LEVEL SECURITY; -- Only display guests accessible through guest claims. -- Only display guests accessible through the account, omit guests created by a blocked user. -- Only display guests of events organized by oneself, omit guests created by a blocked user and guests issued for a blocked user. -CREATE POLICY guest_select ON maevsi.guest FOR SELECT USING ( - id = ANY (maevsi.guest_claim_array()) +CREATE POLICY guest_select ON vibetype.guest FOR SELECT USING ( + id = ANY (vibetype.guest_claim_array()) OR ( contact_id IN ( SELECT id - FROM maevsi.contact - WHERE account_id = maevsi.invoker_account_id() + FROM vibetype.contact + WHERE account_id = vibetype.invoker_account_id() EXCEPT -- contacts created by a blocked account SELECT c.id - FROM maevsi.contact c - JOIN maevsi.account_block b + FROM vibetype.contact c + JOIN vibetype.account_block b ON c.account_id = b.created_by AND c.created_by = b.blocked_account_id WHERE - c.account_id = maevsi.invoker_account_id() + c.account_id = vibetype.invoker_account_id() ) ) OR ( - event_id IN (SELECT maevsi.events_organized()) + event_id IN (SELECT vibetype.events_organized()) AND contact_id IN ( SELECT c.id - FROM maevsi.contact c + FROM vibetype.contact c WHERE c.account_id IS NULL OR c.account_id NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) ) ) @@ -52,91 +52,91 @@ CREATE POLICY guest_select ON maevsi.guest FOR SELECT USING ( -- Only allow inserts for guests of events for which the maximum guest count is not yet reached. -- Only allow inserts for guests for a contact that was created by oneself. -- Do not allow inserts for guests for a contact referring a blocked account. -CREATE POLICY guest_insert ON maevsi.guest FOR INSERT WITH CHECK ( - event_id IN (SELECT maevsi.events_organized()) +CREATE POLICY guest_insert ON vibetype.guest FOR INSERT WITH CHECK ( + event_id IN (SELECT vibetype.events_organized()) AND ( - maevsi.event_guest_count_maximum(event_id) IS NULL + vibetype.event_guest_count_maximum(event_id) IS NULL OR - maevsi.event_guest_count_maximum(event_id) > maevsi.guest_count(event_id) + vibetype.event_guest_count_maximum(event_id) > vibetype.guest_count(event_id) ) AND contact_id IN ( SELECT id - FROM maevsi.contact - WHERE created_by = maevsi.invoker_account_id() + FROM vibetype.contact + WHERE created_by = vibetype.invoker_account_id() EXCEPT SELECT c.id - FROM maevsi.contact c - JOIN maevsi.account_block b + FROM vibetype.contact c + JOIN vibetype.account_block b ON c.account_id = b.blocked_account_id AND c.created_by = b.created_by WHERE - c.created_by = maevsi.invoker_account_id() + c.created_by = vibetype.invoker_account_id() ) ); -- Only allow updates to guests accessible through guest claims. -- Only allow updates to guests accessible through the account, but not guests auhored by a blocked account. -- Only allow updates to guests to events organized by oneself, but not guests referencing a blocked account or authored by a blocked account. -CREATE POLICY guest_update ON maevsi.guest FOR UPDATE USING ( - id = ANY (maevsi.guest_claim_array()) +CREATE POLICY guest_update ON vibetype.guest FOR UPDATE USING ( + id = ANY (vibetype.guest_claim_array()) OR ( contact_id IN ( SELECT id - FROM maevsi.contact - WHERE account_id = maevsi.invoker_account_id() + FROM vibetype.contact + WHERE account_id = vibetype.invoker_account_id() EXCEPT SELECT c.id - FROM maevsi.contact c - JOIN maevsi.account_block b ON c.account_id = b.created_by and c.created_by = b.blocked_account_id - WHERE c.account_id = maevsi.invoker_account_id() + FROM vibetype.contact c + JOIN vibetype.account_block b ON c.account_id = b.created_by and c.created_by = b.blocked_account_id + WHERE c.account_id = vibetype.invoker_account_id() ) ) OR ( - event_id IN (SELECT maevsi.events_organized()) + event_id IN (SELECT vibetype.events_organized()) AND -- omit contacts created by a blocked account or referring to a blocked account contact_id IN ( SELECT c.id - FROM maevsi.contact c + FROM vibetype.contact c WHERE c.account_id IS NULL OR c.account_id NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) ) ) ); -- Only allow deletes for guests of events organized by oneself. -CREATE POLICY guest_delete ON maevsi.guest FOR DELETE USING ( - event_id IN (SELECT maevsi.events_organized()) +CREATE POLICY guest_delete ON vibetype.guest FOR DELETE USING ( + event_id IN (SELECT vibetype.events_organized()) ); -CREATE FUNCTION maevsi.trigger_guest_update() RETURNS TRIGGER AS $$ +CREATE FUNCTION vibetype.trigger_guest_update() RETURNS TRIGGER AS $$ DECLARE whitelisted_cols TEXT[] := ARRAY['feedback', 'feedback_paper']; BEGIN IF TG_OP = 'UPDATE' AND ( -- Invited. - OLD.id = ANY (maevsi.guest_claim_array()) + OLD.id = ANY (vibetype.guest_claim_array()) OR ( - maevsi.invoker_account_id() IS NOT NULL + vibetype.invoker_account_id() IS NOT NULL AND OLD.contact_id IN ( SELECT id - FROM maevsi.contact - WHERE contact.account_id = maevsi.invoker_account_id() + FROM vibetype.contact + WHERE contact.account_id = vibetype.invoker_account_id() ) ) ) @@ -151,19 +151,19 @@ BEGIN RAISE 'You''re only allowed to alter these rows: %!', whitelisted_cols USING ERRCODE = 'insufficient_privilege'; ELSE NEW.updated_at = CURRENT_TIMESTAMP; - NEW.updated_by = maevsi.invoker_account_id(); + NEW.updated_by = vibetype.invoker_account_id(); RETURN NEW; END IF; END $$ LANGUAGE PLPGSQL STRICT VOLATILE SECURITY INVOKER; -COMMENT ON FUNCTION maevsi.trigger_guest_update() IS 'Checks if the caller has permissions to alter the desired columns.'; +COMMENT ON FUNCTION vibetype.trigger_guest_update() IS 'Checks if the caller has permissions to alter the desired columns.'; -GRANT EXECUTE ON FUNCTION maevsi.trigger_guest_update() TO maevsi_account, maevsi_anonymous; +GRANT EXECUTE ON FUNCTION vibetype.trigger_guest_update() TO vibetype_account, vibetype_anonymous; -CREATE TRIGGER maevsi_guest_update +CREATE TRIGGER vibetype_guest_update BEFORE UPDATE - ON maevsi.guest + ON vibetype.guest FOR EACH ROW - EXECUTE PROCEDURE maevsi.trigger_guest_update(); + EXECUTE PROCEDURE vibetype.trigger_guest_update(); COMMIT; diff --git a/src/deploy/table_invitation.sql b/src/deploy/table_invitation.sql index afecdf29..a953c121 100644 --- a/src/deploy/table_invitation.sql +++ b/src/deploy/table_invitation.sql @@ -1,14 +1,14 @@ BEGIN; -CREATE TABLE maevsi.invitation ( - guest_id UUID NOT NULL REFERENCES maevsi.guest(id), +CREATE TABLE vibetype.invitation ( + guest_id UUID NOT NULL REFERENCES vibetype.guest(id), -- created_at is already column of table notification - created_by UUID NOT NULL REFERENCES maevsi.account(id) + created_by UUID NOT NULL REFERENCES vibetype.account(id) ) -INHERITS (maevsi.notification); +INHERITS (vibetype.notification); -COMMENT ON TABLE maevsi.invitation IS '@omit update,delete\nStores invitations and their statuses.'; -COMMENT ON COLUMN maevsi.invitation.guest_id IS 'The ID of the guest associated with this invitation.'; -COMMENT ON COLUMN maevsi.invitation.created_by IS E'@omit create\nReference to the account that created the invitation.'; +COMMENT ON TABLE vibetype.invitation IS '@omit update,delete\nStores invitations and their statuses.'; +COMMENT ON COLUMN vibetype.invitation.guest_id IS 'The ID of the guest associated with this invitation.'; +COMMENT ON COLUMN vibetype.invitation.created_by IS E'@omit create\nReference to the account that created the invitation.'; COMMIT; diff --git a/src/deploy/table_invitation_policy.sql b/src/deploy/table_invitation_policy.sql index e8f11ba7..ece1b928 100644 --- a/src/deploy/table_invitation_policy.sql +++ b/src/deploy/table_invitation_policy.sql @@ -1,20 +1,20 @@ BEGIN; -GRANT SELECT, INSERT ON maevsi.invitation TO maevsi_account; +GRANT SELECT, INSERT ON vibetype.invitation TO vibetype_account; -ALTER TABLE maevsi.invitation ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.invitation ENABLE ROW LEVEL SECURITY; -CREATE POLICY invitation_select ON maevsi.invitation FOR SELECT USING ( - created_by = maevsi.invoker_account_id() +CREATE POLICY invitation_select ON vibetype.invitation FOR SELECT USING ( + created_by = vibetype.invoker_account_id() ); -CREATE POLICY invitation_insert ON maevsi.invitation FOR INSERT WITH CHECK ( - created_by = maevsi.invoker_account_id() +CREATE POLICY invitation_insert ON vibetype.invitation FOR INSERT WITH CHECK ( + created_by = vibetype.invoker_account_id() AND - maevsi.invoker_account_id() = ( + vibetype.invoker_account_id() = ( SELECT e.created_by - FROM maevsi.guest g - JOIN maevsi.event e ON g.event_id = e.id + FROM vibetype.guest g + JOIN vibetype.event e ON g.event_id = e.id WHERE g.id = guest_id ) ); diff --git a/src/deploy/table_jwt.sql b/src/deploy/table_jwt.sql index 4ae8bd43..33d63586 100644 --- a/src/deploy/table_jwt.sql +++ b/src/deploy/table_jwt.sql @@ -1,13 +1,13 @@ BEGIN; -CREATE TABLE maevsi_private.jwt ( +CREATE TABLE vibetype_private.jwt ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - token maevsi.jwt NOT NULL UNIQUE + token vibetype.jwt NOT NULL UNIQUE ); -COMMENT ON TABLE maevsi_private.jwt IS 'A list of tokens.'; -COMMENT ON COLUMN maevsi_private.jwt.id IS 'The token''s id.'; -COMMENT ON COLUMN maevsi_private.jwt.token IS 'The token.'; +COMMENT ON TABLE vibetype_private.jwt IS 'A list of tokens.'; +COMMENT ON COLUMN vibetype_private.jwt.id IS 'The token''s id.'; +COMMENT ON COLUMN vibetype_private.jwt.token IS 'The token.'; COMMIT; diff --git a/src/deploy/table_legal_term.sql b/src/deploy/table_legal_term.sql index 197b4564..03047ffd 100644 --- a/src/deploy/table_legal_term.sql +++ b/src/deploy/table_legal_term.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE TABLE maevsi.legal_term ( +CREATE TABLE vibetype.legal_term ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), language VARCHAR(5) NOT NULL DEFAULT 'en' CHECK (language ~ '^[a-z]{2}(_[A-Z]{2})?$'), @@ -27,14 +27,14 @@ CREATE TABLE maevsi.legal_term ( -- - law (like "GDPR") ); -COMMENT ON TABLE maevsi.legal_term IS E'@omit create,update,delete\nLegal terms like privacy policies or terms of service.'; -COMMENT ON COLUMN maevsi.legal_term.id IS 'Unique identifier for each legal term.'; -COMMENT ON COLUMN maevsi.legal_term.language IS 'Language code in ISO 639-1 format with optional region (e.g., `en` for English, `en_GB` for British English)'; -COMMENT ON COLUMN maevsi.legal_term.term IS 'Text of the legal term. Markdown is expected to be used. It must be non-empty and cannot exceed 500,000 characters.'; -COMMENT ON COLUMN maevsi.legal_term.version IS 'Semantic versioning string to track changes to the legal terms (format: `X.Y.Z`).'; -COMMENT ON COLUMN maevsi.legal_term.created_at IS 'Timestamp when the term was created. Set to the current time by default.'; +COMMENT ON TABLE vibetype.legal_term IS E'@omit create,update,delete\nLegal terms like privacy policies or terms of service.'; +COMMENT ON COLUMN vibetype.legal_term.id IS 'Unique identifier for each legal term.'; +COMMENT ON COLUMN vibetype.legal_term.language IS 'Language code in ISO 639-1 format with optional region (e.g., `en` for English, `en_GB` for British English)'; +COMMENT ON COLUMN vibetype.legal_term.term IS 'Text of the legal term. Markdown is expected to be used. It must be non-empty and cannot exceed 500,000 characters.'; +COMMENT ON COLUMN vibetype.legal_term.version IS 'Semantic versioning string to track changes to the legal terms (format: `X.Y.Z`).'; +COMMENT ON COLUMN vibetype.legal_term.created_at IS 'Timestamp when the term was created. Set to the current time by default.'; -CREATE FUNCTION maevsi.legal_term_change() RETURNS trigger +CREATE FUNCTION vibetype.legal_term_change() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN @@ -43,22 +43,22 @@ BEGIN END; $$; -CREATE TRIGGER maevsi_legal_term_update -BEFORE UPDATE ON maevsi.legal_term +CREATE TRIGGER vibetype_legal_term_update +BEFORE UPDATE ON vibetype.legal_term FOR EACH ROW -EXECUTE FUNCTION maevsi.legal_term_change(); +EXECUTE FUNCTION vibetype.legal_term_change(); -CREATE TRIGGER maevsi_legal_term_delete -BEFORE DELETE ON maevsi.legal_term +CREATE TRIGGER vibetype_legal_term_delete +BEFORE DELETE ON vibetype.legal_term FOR EACH ROW -EXECUTE FUNCTION maevsi.legal_term_change(); +EXECUTE FUNCTION vibetype.legal_term_change(); -GRANT SELECT ON TABLE maevsi.legal_term TO maevsi_account, maevsi_anonymous; +GRANT SELECT ON TABLE vibetype.legal_term TO vibetype_account, vibetype_anonymous; -ALTER TABLE maevsi.legal_term ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.legal_term ENABLE ROW LEVEL SECURITY; -- Make all legal terms accessible by anyone. -CREATE POLICY legal_term_select ON maevsi.legal_term FOR SELECT USING ( +CREATE POLICY legal_term_select ON vibetype.legal_term FOR SELECT USING ( TRUE ); diff --git a/src/deploy/table_legal_term_acceptance.sql b/src/deploy/table_legal_term_acceptance.sql index aa8615dc..aa5beb37 100644 --- a/src/deploy/table_legal_term_acceptance.sql +++ b/src/deploy/table_legal_term_acceptance.sql @@ -1,35 +1,35 @@ BEGIN; -CREATE TABLE maevsi.legal_term_acceptance ( +CREATE TABLE vibetype.legal_term_acceptance ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - account_id UUID NOT NULL REFERENCES maevsi.account(id) ON DELETE CASCADE, - legal_term_id UUID NOT NULL REFERENCES maevsi.legal_term(id) ON DELETE RESTRICT, -- deletion of the parent row should not be possible + account_id UUID NOT NULL REFERENCES vibetype.account(id) ON DELETE CASCADE, + legal_term_id UUID NOT NULL REFERENCES vibetype.legal_term(id) ON DELETE RESTRICT, -- deletion of the parent row should not be possible created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP ); -COMMENT ON TABLE maevsi.legal_term_acceptance IS '@omit update,delete\nTracks each user account''s acceptance of legal terms and conditions.'; -COMMENT ON COLUMN maevsi.legal_term_acceptance.id IS E'@omit create\nUnique identifier for this legal term acceptance record. Automatically generated for each new acceptance.'; -COMMENT ON COLUMN maevsi.legal_term_acceptance.account_id IS 'The user account ID that accepted the legal terms. If the account is deleted, this acceptance record will also be deleted.'; -COMMENT ON COLUMN maevsi.legal_term_acceptance.legal_term_id IS 'The ID of the legal terms that were accepted. Deletion of these legal terms is restricted while they are still referenced in this table.'; -COMMENT ON COLUMN maevsi.legal_term_acceptance.created_at IS E'@omit create\nTimestamp showing when the legal terms were accepted, set automatically at the time of acceptance.'; +COMMENT ON TABLE vibetype.legal_term_acceptance IS '@omit update,delete\nTracks each user account''s acceptance of legal terms and conditions.'; +COMMENT ON COLUMN vibetype.legal_term_acceptance.id IS E'@omit create\nUnique identifier for this legal term acceptance record. Automatically generated for each new acceptance.'; +COMMENT ON COLUMN vibetype.legal_term_acceptance.account_id IS 'The user account ID that accepted the legal terms. If the account is deleted, this acceptance record will also be deleted.'; +COMMENT ON COLUMN vibetype.legal_term_acceptance.legal_term_id IS 'The ID of the legal terms that were accepted. Deletion of these legal terms is restricted while they are still referenced in this table.'; +COMMENT ON COLUMN vibetype.legal_term_acceptance.created_at IS E'@omit create\nTimestamp showing when the legal terms were accepted, set automatically at the time of acceptance.'; -GRANT SELECT, INSERT ON TABLE maevsi.legal_term_acceptance TO maevsi_account; +GRANT SELECT, INSERT ON TABLE vibetype.legal_term_acceptance TO vibetype_account; -ALTER TABLE maevsi.legal_term_acceptance ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.legal_term_acceptance ENABLE ROW LEVEL SECURITY; -- Allow to select legal term acceptances for the own account. -CREATE POLICY legal_term_acceptance_select ON maevsi.legal_term_acceptance FOR SELECT USING ( - maevsi.invoker_account_id() IS NOT NULL +CREATE POLICY legal_term_acceptance_select ON vibetype.legal_term_acceptance FOR SELECT USING ( + vibetype.invoker_account_id() IS NOT NULL AND - account_id = maevsi.invoker_account_id() + account_id = vibetype.invoker_account_id() ); -CREATE POLICY legal_term_acceptance_insert ON maevsi.legal_term_acceptance FOR INSERT WITH CHECK ( - maevsi.invoker_account_id() IS NOT NULL +CREATE POLICY legal_term_acceptance_insert ON vibetype.legal_term_acceptance FOR INSERT WITH CHECK ( + vibetype.invoker_account_id() IS NOT NULL AND - account_id = maevsi.invoker_account_id() + account_id = vibetype.invoker_account_id() ); COMMIT; diff --git a/src/deploy/table_notification.sql b/src/deploy/table_notification.sql index 80d83995..31a646b0 100644 --- a/src/deploy/table_notification.sql +++ b/src/deploy/table_notification.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE TABLE maevsi.notification ( +CREATE TABLE vibetype.notification ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), channel TEXT NOT NULL, @@ -10,11 +10,11 @@ CREATE TABLE maevsi.notification ( created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP ); -COMMENT ON TABLE maevsi.notification IS 'A notification.'; -COMMENT ON COLUMN maevsi.notification.id IS 'The notification''s internal id.'; -COMMENT ON COLUMN maevsi.notification.channel IS 'The notification''s channel.'; -COMMENT ON COLUMN maevsi.notification.is_acknowledged IS 'Whether the notification was acknowledged.'; -COMMENT ON COLUMN maevsi.notification.payload IS 'The notification''s payload.'; -COMMENT ON COLUMN maevsi.notification.created_at IS 'The timestamp of the notification''s creation.'; +COMMENT ON TABLE vibetype.notification IS 'A notification.'; +COMMENT ON COLUMN vibetype.notification.id IS 'The notification''s internal id.'; +COMMENT ON COLUMN vibetype.notification.channel IS 'The notification''s channel.'; +COMMENT ON COLUMN vibetype.notification.is_acknowledged IS 'Whether the notification was acknowledged.'; +COMMENT ON COLUMN vibetype.notification.payload IS 'The notification''s payload.'; +COMMENT ON COLUMN vibetype.notification.created_at IS 'The timestamp of the notification''s creation.'; COMMIT; diff --git a/src/deploy/table_profile_picture.sql b/src/deploy/table_profile_picture.sql index 0ea84cf7..48070a2a 100644 --- a/src/deploy/table_profile_picture.sql +++ b/src/deploy/table_profile_picture.sql @@ -1,50 +1,50 @@ BEGIN; -CREATE TABLE maevsi.profile_picture ( +CREATE TABLE vibetype.profile_picture ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - account_id UUID NOT NULL REFERENCES maevsi.account(id) UNIQUE, - upload_id UUID NOT NULL REFERENCES maevsi.upload(id) + account_id UUID NOT NULL REFERENCES vibetype.account(id) UNIQUE, + upload_id UUID NOT NULL REFERENCES vibetype.upload(id) ); -COMMENT ON TABLE maevsi.profile_picture IS 'Mapping of account ids to upload ids.'; -COMMENT ON COLUMN maevsi.profile_picture.id IS E'@omit create,update\nThe profile picture''s internal id.'; -COMMENT ON COLUMN maevsi.profile_picture.account_id IS 'The account''s id.'; -COMMENT ON COLUMN maevsi.profile_picture.upload_id IS 'The upload''s id.'; +COMMENT ON TABLE vibetype.profile_picture IS 'Mapping of account ids to upload ids.'; +COMMENT ON COLUMN vibetype.profile_picture.id IS E'@omit create,update\nThe profile picture''s internal id.'; +COMMENT ON COLUMN vibetype.profile_picture.account_id IS 'The account''s id.'; +COMMENT ON COLUMN vibetype.profile_picture.upload_id IS 'The upload''s id.'; -GRANT SELECT ON TABLE maevsi.profile_picture TO maevsi_account, maevsi_anonymous, maevsi_tusd; -GRANT INSERT, DELETE, UPDATE ON TABLE maevsi.profile_picture TO maevsi_account; -GRANT DELETE ON TABLE maevsi.profile_picture TO maevsi_tusd; +GRANT SELECT ON TABLE vibetype.profile_picture TO vibetype_account, vibetype_anonymous, vibetype_tusd; +GRANT INSERT, DELETE, UPDATE ON TABLE vibetype.profile_picture TO vibetype_account; +GRANT DELETE ON TABLE vibetype.profile_picture TO vibetype_tusd; -ALTER TABLE maevsi.profile_picture ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.profile_picture ENABLE ROW LEVEL SECURITY; -- Make all profile pictures accessible by everyone. -CREATE POLICY profile_picture_select ON maevsi.profile_picture FOR SELECT USING ( +CREATE POLICY profile_picture_select ON vibetype.profile_picture FOR SELECT USING ( TRUE ); -- Only allow inserts with a account id that matches the invoker's account id. -CREATE POLICY profile_picture_insert ON maevsi.profile_picture FOR INSERT WITH CHECK ( - maevsi.invoker_account_id() IS NOT NULL +CREATE POLICY profile_picture_insert ON vibetype.profile_picture FOR INSERT WITH CHECK ( + vibetype.invoker_account_id() IS NOT NULL AND - account_id = maevsi.invoker_account_id() + account_id = vibetype.invoker_account_id() ); -- Only allow updates to the item with the account id that matches the invoker's account id. -CREATE POLICY profile_picture_update ON maevsi.profile_picture FOR UPDATE USING ( - maevsi.invoker_account_id() IS NOT NULL +CREATE POLICY profile_picture_update ON vibetype.profile_picture FOR UPDATE USING ( + vibetype.invoker_account_id() IS NOT NULL AND - account_id = maevsi.invoker_account_id() + account_id = vibetype.invoker_account_id() ); -- Only allow deletes for the item with the account id that matches the invoker's account id. -CREATE POLICY profile_picture_delete ON maevsi.profile_picture FOR DELETE USING ( - (SELECT current_user) = 'maevsi_tusd' +CREATE POLICY profile_picture_delete ON vibetype.profile_picture FOR DELETE USING ( + (SELECT current_user) = 'vibetype_tusd' OR ( - maevsi.invoker_account_id() IS NOT NULL + vibetype.invoker_account_id() IS NOT NULL AND - account_id = maevsi.invoker_account_id() + account_id = vibetype.invoker_account_id() ) ); diff --git a/src/deploy/table_report.sql b/src/deploy/table_report.sql index fd0a8132..fa43ade9 100644 --- a/src/deploy/table_report.sql +++ b/src/deploy/table_report.sql @@ -1,30 +1,30 @@ BEGIN; -CREATE TABLE maevsi.report ( +CREATE TABLE vibetype.report ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), reason TEXT NOT NULL CHECK (char_length("reason") > 0 AND char_length("reason") < 2000), - target_account_id UUID REFERENCES maevsi.account(id), - target_event_id UUID REFERENCES maevsi.event(id), - target_upload_id UUID REFERENCES maevsi.upload(id), + target_account_id UUID REFERENCES vibetype.account(id), + target_event_id UUID REFERENCES vibetype.event(id), + target_upload_id UUID REFERENCES vibetype.upload(id), created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP, - created_by UUID NOT NULL REFERENCES maevsi.account(id), + created_by UUID NOT NULL REFERENCES vibetype.account(id), CHECK (num_nonnulls(target_account_id, target_event_id, target_upload_id) = 1), UNIQUE (created_by, target_account_id, target_event_id, target_upload_id) ); -COMMENT ON TABLE maevsi.report IS E'@omit update,delete\nStores reports made by users on other users, events, or uploads for moderation purposes.'; -COMMENT ON COLUMN maevsi.report.id IS E'@omit create\nUnique identifier for the report, generated randomly using UUIDs.'; -COMMENT ON COLUMN maevsi.report.reason IS 'The reason for the report, provided by the reporting user. Must be non-empty and less than 2000 characters.'; -COMMENT ON COLUMN maevsi.report.target_account_id IS 'The ID of the account being reported, if applicable.'; -COMMENT ON COLUMN maevsi.report.target_event_id IS 'The ID of the event being reported, if applicable.'; -COMMENT ON COLUMN maevsi.report.target_upload_id IS 'The ID of the upload being reported, if applicable.'; -COMMENT ON COLUMN maevsi.report.created_at IS E'@omit create\nTimestamp of when the report was created, defaults to the current timestamp.'; -COMMENT ON COLUMN maevsi.report.created_by IS 'The ID of the user who created the report.'; -COMMENT ON CONSTRAINT report_reason_check ON maevsi.report IS 'Ensures the reason field contains between 1 and 2000 characters.'; -COMMENT ON CONSTRAINT report_check ON maevsi.report IS 'Ensures that the report targets exactly one element (account, event, or upload).'; -COMMENT ON CONSTRAINT report_created_by_target_account_id_target_event_id_target__key ON maevsi.report IS 'Ensures that the same user cannot submit multiple reports on the same element (account, event, or upload).'; +COMMENT ON TABLE vibetype.report IS E'@omit update,delete\nStores reports made by users on other users, events, or uploads for moderation purposes.'; +COMMENT ON COLUMN vibetype.report.id IS E'@omit create\nUnique identifier for the report, generated randomly using UUIDs.'; +COMMENT ON COLUMN vibetype.report.reason IS 'The reason for the report, provided by the reporting user. Must be non-empty and less than 2000 characters.'; +COMMENT ON COLUMN vibetype.report.target_account_id IS 'The ID of the account being reported, if applicable.'; +COMMENT ON COLUMN vibetype.report.target_event_id IS 'The ID of the event being reported, if applicable.'; +COMMENT ON COLUMN vibetype.report.target_upload_id IS 'The ID of the upload being reported, if applicable.'; +COMMENT ON COLUMN vibetype.report.created_at IS E'@omit create\nTimestamp of when the report was created, defaults to the current timestamp.'; +COMMENT ON COLUMN vibetype.report.created_by IS 'The ID of the user who created the report.'; +COMMENT ON CONSTRAINT report_reason_check ON vibetype.report IS 'Ensures the reason field contains between 1 and 2000 characters.'; +COMMENT ON CONSTRAINT report_check ON vibetype.report IS 'Ensures that the report targets exactly one element (account, event, or upload).'; +COMMENT ON CONSTRAINT report_created_by_target_account_id_target_event_id_target__key ON vibetype.report IS 'Ensures that the same user cannot submit multiple reports on the same element (account, event, or upload).'; COMMIT; diff --git a/src/deploy/table_report_policy.sql b/src/deploy/table_report_policy.sql index b2400f4c..2e8aeb87 100644 --- a/src/deploy/table_report_policy.sql +++ b/src/deploy/table_report_policy.sql @@ -1,21 +1,21 @@ BEGIN; -GRANT INSERT, SELECT ON TABLE maevsi.report TO maevsi_account; +GRANT INSERT, SELECT ON TABLE vibetype.report TO vibetype_account; -ALTER TABLE maevsi.report ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.report ENABLE ROW LEVEL SECURITY; -- Only allow inserts for reports created by the current user. -CREATE POLICY report_insert ON maevsi.report FOR INSERT WITH CHECK ( - maevsi.invoker_account_id() IS NOT NULL +CREATE POLICY report_insert ON vibetype.report FOR INSERT WITH CHECK ( + vibetype.invoker_account_id() IS NOT NULL AND - created_by = maevsi.invoker_account_id() + created_by = vibetype.invoker_account_id() ); -- Only allow selects for reports created by the current user. -CREATE POLICY report_select ON maevsi.report FOR SELECT USING ( - maevsi.invoker_account_id() IS NOT NULL +CREATE POLICY report_select ON vibetype.report FOR SELECT USING ( + vibetype.invoker_account_id() IS NOT NULL AND - created_by = maevsi.invoker_account_id() + created_by = vibetype.invoker_account_id() ); COMMIT; diff --git a/src/deploy/table_upload.sql b/src/deploy/table_upload.sql index 925563a5..34b26f58 100644 --- a/src/deploy/table_upload.sql +++ b/src/deploy/table_upload.sql @@ -1,9 +1,9 @@ BEGIN; -CREATE TABLE maevsi.upload ( +CREATE TABLE vibetype.upload ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - account_id UUID NOT NULL REFERENCES maevsi.account(id), + account_id UUID NOT NULL REFERENCES vibetype.account(id), name TEXT CHECK (char_length("name") > 0 AND char_length("name") < 300), size_byte BIGINT NOT NULL CHECK (size_byte > 0), storage_key TEXT UNIQUE, @@ -12,13 +12,13 @@ CREATE TABLE maevsi.upload ( created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP ); -COMMENT ON TABLE maevsi.upload IS 'An upload.'; -COMMENT ON COLUMN maevsi.upload.id IS E'@omit create,update\nThe upload''s internal id.'; -COMMENT ON COLUMN maevsi.upload.account_id IS 'The uploader''s account id.'; -COMMENT ON COLUMN maevsi.upload.name IS 'The name of the uploaded file.'; -COMMENT ON COLUMN maevsi.upload.size_byte IS 'The upload''s size in bytes.'; -COMMENT ON COLUMN maevsi.upload.storage_key IS 'The upload''s storage key.'; -COMMENT ON COLUMN maevsi.upload.type IS 'The type of the uploaded file, default is ''image''.'; -COMMENT ON COLUMN maevsi.upload.created_at IS E'@omit create,update\nTimestamp of when the upload was created, defaults to the current timestamp.'; +COMMENT ON TABLE vibetype.upload IS 'An upload.'; +COMMENT ON COLUMN vibetype.upload.id IS E'@omit create,update\nThe upload''s internal id.'; +COMMENT ON COLUMN vibetype.upload.account_id IS 'The uploader''s account id.'; +COMMENT ON COLUMN vibetype.upload.name IS 'The name of the uploaded file.'; +COMMENT ON COLUMN vibetype.upload.size_byte IS 'The upload''s size in bytes.'; +COMMENT ON COLUMN vibetype.upload.storage_key IS 'The upload''s storage key.'; +COMMENT ON COLUMN vibetype.upload.type IS 'The type of the uploaded file, default is ''image''.'; +COMMENT ON COLUMN vibetype.upload.created_at IS E'@omit create,update\nTimestamp of when the upload was created, defaults to the current timestamp.'; COMMIT; diff --git a/src/deploy/table_upload_policy.sql b/src/deploy/table_upload_policy.sql index d573d8b9..f69b449b 100644 --- a/src/deploy/table_upload_policy.sql +++ b/src/deploy/table_upload_policy.sql @@ -1,35 +1,35 @@ BEGIN; -GRANT SELECT ON TABLE maevsi.upload TO maevsi_account, maevsi_anonymous, maevsi_tusd; -GRANT UPDATE ON TABLE maevsi.upload TO maevsi_tusd; -GRANT DELETE ON TABLE maevsi.upload TO maevsi_tusd; +GRANT SELECT ON TABLE vibetype.upload TO vibetype_account, vibetype_anonymous, vibetype_tusd; +GRANT UPDATE ON TABLE vibetype.upload TO vibetype_tusd; +GRANT DELETE ON TABLE vibetype.upload TO vibetype_tusd; -ALTER TABLE maevsi.upload ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.upload ENABLE ROW LEVEL SECURITY; -- Display -- - all uploads for `tusd` or -- - the uploads that are linked to the requesting account or -- - the uploads which are used as profile picture. -CREATE POLICY upload_select_using ON maevsi.upload FOR SELECT USING ( - (SELECT current_user) = 'maevsi_tusd' +CREATE POLICY upload_select_using ON vibetype.upload FOR SELECT USING ( + (SELECT current_user) = 'vibetype_tusd' OR ( - maevsi.invoker_account_id() IS NOT NULL + vibetype.invoker_account_id() IS NOT NULL AND - account_id = maevsi.invoker_account_id() + account_id = vibetype.invoker_account_id() ) OR - id IN (SELECT upload_id FROM maevsi.profile_picture) + id IN (SELECT upload_id FROM vibetype.profile_picture) ); -- Only allow tusd to update rows. -CREATE POLICY upload_update_using ON maevsi.upload FOR UPDATE USING ( - (SELECT current_user) = 'maevsi_tusd' +CREATE POLICY upload_update_using ON vibetype.upload FOR UPDATE USING ( + (SELECT current_user) = 'vibetype_tusd' ); -- Only allow tusd to delete rows. -CREATE POLICY upload_delete_using ON maevsi.upload FOR DELETE USING ( - (SELECT current_user) = 'maevsi_tusd' +CREATE POLICY upload_delete_using ON vibetype.upload FOR DELETE USING ( + (SELECT current_user) = 'vibetype_tusd' ); COMMIT; diff --git a/src/deploy/test_location.sql b/src/deploy/test_location.sql index 47c9500c..8934ca12 100644 --- a/src/deploy/test_location.sql +++ b/src/deploy/test_location.sql @@ -1,7 +1,7 @@ BEGIN; -CREATE FUNCTION maevsi_test.account_filter_radius_event( +CREATE FUNCTION vibetype_test.account_filter_radius_event( _event_id UUID, _distance_max DOUBLE PRECISION ) @@ -13,7 +13,7 @@ BEGIN RETURN QUERY WITH event AS ( SELECT location_geography - FROM maevsi.event + FROM vibetype.event WHERE id = _event_id ) SELECT @@ -21,18 +21,18 @@ BEGIN ST_Distance(e.location_geography, a.location) AS distance FROM event e, - maevsi_private.account a + vibetype_private.account a WHERE ST_DWithin(e.location_geography, a.location, _distance_max * 1000); END; $$ LANGUAGE PLPGSQL STRICT STABLE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi_test.account_filter_radius_event(UUID, DOUBLE PRECISION) IS 'Returns account locations within a given radius around the location of an event.'; +COMMENT ON FUNCTION vibetype_test.account_filter_radius_event(UUID, DOUBLE PRECISION) IS 'Returns account locations within a given radius around the location of an event.'; -GRANT EXECUTE ON FUNCTION maevsi_test.account_filter_radius_event(UUID, DOUBLE PRECISION) TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype_test.account_filter_radius_event(UUID, DOUBLE PRECISION) TO vibetype_account; -CREATE FUNCTION maevsi_test.event_filter_radius_account( +CREATE FUNCTION vibetype_test.event_filter_radius_account( _account_id UUID, _distance_max DOUBLE PRECISION ) @@ -44,7 +44,7 @@ BEGIN RETURN QUERY WITH account AS ( SELECT location - FROM maevsi_private.account + FROM vibetype_private.account WHERE id = _account_id ) SELECT @@ -52,25 +52,25 @@ BEGIN ST_Distance(a.location, e.location_geography) AS distance FROM account a, - maevsi.event e + vibetype.event e WHERE ST_DWithin(a.location, e.location_geography, _distance_max * 1000); END; $$ LANGUAGE PLPGSQL STRICT STABLE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi_test.event_filter_radius_account(UUID, DOUBLE PRECISION) IS 'Returns event locations within a given radius around the location of an account.'; +COMMENT ON FUNCTION vibetype_test.event_filter_radius_account(UUID, DOUBLE PRECISION) IS 'Returns event locations within a given radius around the location of an account.'; -GRANT EXECUTE ON FUNCTION maevsi_test.event_filter_radius_account(UUID, DOUBLE PRECISION) TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype_test.event_filter_radius_account(UUID, DOUBLE PRECISION) TO vibetype_account; -CREATE FUNCTION maevsi_test.account_location_update( +CREATE FUNCTION vibetype_test.account_location_update( _account_id UUID, _latitude DOUBLE PRECISION, _longitude DOUBLE PRECISION ) RETURNS VOID AS $$ BEGIN - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET location = ST_Point(_longitude, _latitude, 4326) WHERE @@ -78,19 +78,19 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi_test.account_location_update(UUID, DOUBLE PRECISION, DOUBLE PRECISION) IS 'Updates an account''s location based on latitude and longitude (GPS coordinates).'; +COMMENT ON FUNCTION vibetype_test.account_location_update(UUID, DOUBLE PRECISION, DOUBLE PRECISION) IS 'Updates an account''s location based on latitude and longitude (GPS coordinates).'; -GRANT EXECUTE ON FUNCTION maevsi_test.account_location_update(UUID, DOUBLE PRECISION, DOUBLE PRECISION) TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype_test.account_location_update(UUID, DOUBLE PRECISION, DOUBLE PRECISION) TO vibetype_account; -CREATE FUNCTION maevsi_test.event_location_update( +CREATE FUNCTION vibetype_test.event_location_update( _event_id UUID, _latitude DOUBLE PRECISION, _longitude DOUBLE PRECISION ) RETURNS VOID AS $$ BEGIN - UPDATE maevsi.event + UPDATE vibetype.event SET location_geography = ST_Point(_longitude, _latitude, 4326) WHERE @@ -98,12 +98,12 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT SECURITY DEFINER; -COMMENT ON FUNCTION maevsi_test.event_location_update(UUID, DOUBLE PRECISION, DOUBLE PRECISION) IS 'Updates an event''s location based on latitude and longitude (GPS coordinates).'; +COMMENT ON FUNCTION vibetype_test.event_location_update(UUID, DOUBLE PRECISION, DOUBLE PRECISION) IS 'Updates an event''s location based on latitude and longitude (GPS coordinates).'; -GRANT EXECUTE ON FUNCTION maevsi_test.event_location_update(UUID, DOUBLE PRECISION, DOUBLE PRECISION) TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype_test.event_location_update(UUID, DOUBLE PRECISION, DOUBLE PRECISION) TO vibetype_account; -CREATE FUNCTION maevsi_test.account_location_coordinates( +CREATE FUNCTION vibetype_test.account_location_coordinates( _account_id UUID ) RETURNS DOUBLE PRECISION[] AS $$ @@ -118,7 +118,7 @@ BEGIN _latitude, _longitude FROM - maevsi_private.account + vibetype_private.account WHERE id = _account_id; @@ -126,12 +126,12 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT STABLE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi_test.account_location_coordinates(UUID) IS 'Returns an array with latitude and longitude of the account''s current location data'; +COMMENT ON FUNCTION vibetype_test.account_location_coordinates(UUID) IS 'Returns an array with latitude and longitude of the account''s current location data'; -GRANT EXECUTE ON FUNCTION maevsi_test.account_location_coordinates(UUID) TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype_test.account_location_coordinates(UUID) TO vibetype_account; -CREATE FUNCTION maevsi_test.event_location_coordinates( +CREATE FUNCTION vibetype_test.event_location_coordinates( _event_id UUID ) RETURNS DOUBLE PRECISION[] AS $$ @@ -146,7 +146,7 @@ BEGIN _latitude, _longitude FROM - maevsi.event + vibetype.event WHERE id = _event_id; @@ -154,9 +154,9 @@ BEGIN END; $$ LANGUAGE PLPGSQL STRICT STABLE SECURITY DEFINER; -COMMENT ON FUNCTION maevsi_test.event_location_coordinates(UUID) IS 'Returns an array with latitude and longitude of the event''s current location data.'; +COMMENT ON FUNCTION vibetype_test.event_location_coordinates(UUID) IS 'Returns an array with latitude and longitude of the event''s current location data.'; -GRANT EXECUTE ON FUNCTION maevsi_test.event_location_coordinates(UUID) TO maevsi_account; +GRANT EXECUTE ON FUNCTION vibetype_test.event_location_coordinates(UUID) TO vibetype_account; COMMIT; diff --git a/src/deploy/type_event_unlock_response.sql b/src/deploy/type_event_unlock_response.sql index 0cc6344b..a46b79ac 100644 --- a/src/deploy/type_event_unlock_response.sql +++ b/src/deploy/type_event_unlock_response.sql @@ -1,10 +1,10 @@ BEGIN; -- TODO: remove type -CREATE TYPE maevsi.event_unlock_response AS ( +CREATE TYPE vibetype.event_unlock_response AS ( creator_username TEXT, event_slug TEXT, - jwt maevsi.jwt + jwt vibetype.jwt ); COMMIT; diff --git a/src/deploy/type_jwt.sql b/src/deploy/type_jwt.sql index 196dc68a..675f5ecf 100644 --- a/src/deploy/type_jwt.sql +++ b/src/deploy/type_jwt.sql @@ -1,6 +1,6 @@ BEGIN; -CREATE TYPE maevsi.jwt AS ( +CREATE TYPE vibetype.jwt AS ( id UUID, account_id UUID, account_username TEXT, diff --git a/src/deploy/view_guest_flat.sql b/src/deploy/view_guest_flat.sql index 8cabb2ce..733848c2 100644 --- a/src/deploy/view_guest_flat.sql +++ b/src/deploy/view_guest_flat.sql @@ -1,5 +1,5 @@ BEGIN; -CREATE VIEW maevsi.guest_flat WITH (security_invoker) AS +CREATE VIEW vibetype.guest_flat WITH (security_invoker) AS SELECT guest.id AS guest_id, guest.contact_id AS guest_contact_id, @@ -32,12 +32,12 @@ CREATE VIEW maevsi.guest_flat WITH (security_invoker) AS event.url AS event_url, event.visibility AS event_visibility, event.created_by AS event_created_by - FROM maevsi.guest - JOIN maevsi.contact ON guest.contact_id = contact.id - JOIN maevsi.event ON guest.event_id = event.id; + FROM vibetype.guest + JOIN vibetype.contact ON guest.contact_id = contact.id + JOIN vibetype.event ON guest.event_id = event.id; -COMMENT ON VIEW maevsi.guest_flat IS 'View returning flattened guests.'; +COMMENT ON VIEW vibetype.guest_flat IS 'View returning flattened guests.'; -GRANT SELECT ON maevsi.guest_flat TO maevsi_account, maevsi_anonymous; +GRANT SELECT ON vibetype.guest_flat TO vibetype_account, vibetype_anonymous; END; diff --git a/src/revert/enum_achievement_type.sql b/src/revert/enum_achievement_type.sql index 2b6351e3..a8672672 100644 --- a/src/revert/enum_achievement_type.sql +++ b/src/revert/enum_achievement_type.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TYPE maevsi.achievement_type; +DROP TYPE vibetype.achievement_type; COMMIT; diff --git a/src/revert/enum_event_size.sql b/src/revert/enum_event_size.sql index 21b19e74..48068225 100644 --- a/src/revert/enum_event_size.sql +++ b/src/revert/enum_event_size.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TYPE maevsi.event_size; +DROP TYPE vibetype.event_size; COMMIT; diff --git a/src/revert/enum_event_visibility.sql b/src/revert/enum_event_visibility.sql index c68614b7..dc28ed5c 100644 --- a/src/revert/enum_event_visibility.sql +++ b/src/revert/enum_event_visibility.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TYPE maevsi.event_visibility; +DROP TYPE vibetype.event_visibility; COMMIT; diff --git a/src/revert/enum_invitation_feedback.sql b/src/revert/enum_invitation_feedback.sql index 4963783e..3eb5f8ed 100644 --- a/src/revert/enum_invitation_feedback.sql +++ b/src/revert/enum_invitation_feedback.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TYPE maevsi.invitation_feedback; +DROP TYPE vibetype.invitation_feedback; COMMIT; diff --git a/src/revert/enum_invitation_feedback_paper.sql b/src/revert/enum_invitation_feedback_paper.sql index b75f81c0..d5025bbd 100644 --- a/src/revert/enum_invitation_feedback_paper.sql +++ b/src/revert/enum_invitation_feedback_paper.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TYPE maevsi.invitation_feedback_paper; +DROP TYPE vibetype.invitation_feedback_paper; COMMIT; diff --git a/src/revert/enum_language.sql b/src/revert/enum_language.sql index 328d537b..7c78cfaa 100644 --- a/src/revert/enum_language.sql +++ b/src/revert/enum_language.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TYPE maevsi.language; +DROP TYPE vibetype.language; COMMIT; diff --git a/src/revert/enum_social_network.sql b/src/revert/enum_social_network.sql index 418c38a0..f0b9c8f9 100644 --- a/src/revert/enum_social_network.sql +++ b/src/revert/enum_social_network.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TYPE maevsi.social_network; +DROP TYPE vibetype.social_network; COMMIT; diff --git a/src/revert/extension_postgis.sql b/src/revert/extension_postgis.sql index aa435f50..78b4ebe2 100644 --- a/src/revert/extension_postgis.sql +++ b/src/revert/extension_postgis.sql @@ -9,7 +9,7 @@ REVOKE EXECUTE ON FUNCTION geometrytype(geography), geometry(text), geography(geometry) -FROM maevsi_anonymous, maevsi_account; +FROM vibetype_anonymous, vibetype_account; DROP EXTENSION postgis; diff --git a/src/revert/function_account_block_ids.sql b/src/revert/function_account_block_ids.sql index 88cf2e4d..4fffa1e0 100644 --- a/src/revert/function_account_block_ids.sql +++ b/src/revert/function_account_block_ids.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi_private.account_block_ids(); +DROP FUNCTION vibetype_private.account_block_ids(); COMMIT; diff --git a/src/revert/function_account_delete.sql b/src/revert/function_account_delete.sql index 428cc715..401c8c31 100644 --- a/src/revert/function_account_delete.sql +++ b/src/revert/function_account_delete.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.account_delete; +DROP FUNCTION vibetype.account_delete; COMMIT; diff --git a/src/revert/function_account_email_address_verification.sql b/src/revert/function_account_email_address_verification.sql index 752433bf..85a4f949 100644 --- a/src/revert/function_account_email_address_verification.sql +++ b/src/revert/function_account_email_address_verification.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.account_email_address_verification; +DROP FUNCTION vibetype.account_email_address_verification; COMMIT; diff --git a/src/revert/function_account_password_change.sql b/src/revert/function_account_password_change.sql index 44d12043..70a8cc63 100644 --- a/src/revert/function_account_password_change.sql +++ b/src/revert/function_account_password_change.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.account_password_change; +DROP FUNCTION vibetype.account_password_change; COMMIT; diff --git a/src/revert/function_account_password_reset.sql b/src/revert/function_account_password_reset.sql index ea6a50bc..c7d5c484 100644 --- a/src/revert/function_account_password_reset.sql +++ b/src/revert/function_account_password_reset.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.account_password_reset; +DROP FUNCTION vibetype.account_password_reset; COMMIT; diff --git a/src/revert/function_account_password_reset_request.sql b/src/revert/function_account_password_reset_request.sql index 2fa920f8..f3b76de3 100644 --- a/src/revert/function_account_password_reset_request.sql +++ b/src/revert/function_account_password_reset_request.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.account_password_reset_request; +DROP FUNCTION vibetype.account_password_reset_request; COMMIT; diff --git a/src/revert/function_account_registration.sql b/src/revert/function_account_registration.sql index 789d9b7f..06065e0e 100644 --- a/src/revert/function_account_registration.sql +++ b/src/revert/function_account_registration.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.account_registration; +DROP FUNCTION vibetype.account_registration; COMMIT; diff --git a/src/revert/function_account_registration_refresh.sql b/src/revert/function_account_registration_refresh.sql index a402c1aa..e5286981 100644 --- a/src/revert/function_account_registration_refresh.sql +++ b/src/revert/function_account_registration_refresh.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.account_registration_refresh; +DROP FUNCTION vibetype.account_registration_refresh; COMMIT; diff --git a/src/revert/function_account_upload_quota_bytes.sql b/src/revert/function_account_upload_quota_bytes.sql index 205466a7..5047b5a9 100644 --- a/src/revert/function_account_upload_quota_bytes.sql +++ b/src/revert/function_account_upload_quota_bytes.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.account_upload_quota_bytes; +DROP FUNCTION vibetype.account_upload_quota_bytes; COMMIT; diff --git a/src/revert/function_achievement_unlock.sql b/src/revert/function_achievement_unlock.sql index d2372760..d9eddcbf 100644 --- a/src/revert/function_achievement_unlock.sql +++ b/src/revert/function_achievement_unlock.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.achievement_unlock; +DROP FUNCTION vibetype.achievement_unlock; COMMIT; diff --git a/src/revert/function_authenticate.sql b/src/revert/function_authenticate.sql index 94dea8f7..a93523a8 100644 --- a/src/revert/function_authenticate.sql +++ b/src/revert/function_authenticate.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.authenticate; +DROP FUNCTION vibetype.authenticate; COMMIT; diff --git a/src/revert/function_event_delete.sql b/src/revert/function_event_delete.sql index b8172a1c..c3054a59 100644 --- a/src/revert/function_event_delete.sql +++ b/src/revert/function_event_delete.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.event_delete; +DROP FUNCTION vibetype.event_delete; COMMIT; diff --git a/src/revert/function_event_guest_count_maximum.sql b/src/revert/function_event_guest_count_maximum.sql index c008aaaa..6a1bbe90 100644 --- a/src/revert/function_event_guest_count_maximum.sql +++ b/src/revert/function_event_guest_count_maximum.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.event_guest_count_maximum; +DROP FUNCTION vibetype.event_guest_count_maximum; COMMIT; diff --git a/src/revert/function_event_is_existing.sql b/src/revert/function_event_is_existing.sql index 72be1ce0..173e8d75 100644 --- a/src/revert/function_event_is_existing.sql +++ b/src/revert/function_event_is_existing.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.event_is_existing; +DROP FUNCTION vibetype.event_is_existing; COMMIT; diff --git a/src/revert/function_event_search.sql b/src/revert/function_event_search.sql index 7a8891d0..a9c5c9a2 100644 --- a/src/revert/function_event_search.sql +++ b/src/revert/function_event_search.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.event_search; +DROP FUNCTION vibetype.event_search; COMMIT; diff --git a/src/revert/function_event_unlock.sql b/src/revert/function_event_unlock.sql index 5b1a6302..71d6aee6 100644 --- a/src/revert/function_event_unlock.sql +++ b/src/revert/function_event_unlock.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.event_unlock; +DROP FUNCTION vibetype.event_unlock; COMMIT; diff --git a/src/revert/function_events_invited.sql b/src/revert/function_events_invited.sql index 2ae2dbc0..8cce7946 100644 --- a/src/revert/function_events_invited.sql +++ b/src/revert/function_events_invited.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi_private.events_invited; +DROP FUNCTION vibetype_private.events_invited; COMMIT; diff --git a/src/revert/function_events_organized.sql b/src/revert/function_events_organized.sql index f588f241..554a642d 100644 --- a/src/revert/function_events_organized.sql +++ b/src/revert/function_events_organized.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.events_organized; +DROP FUNCTION vibetype.events_organized; COMMIT; diff --git a/src/revert/function_guest_claim_array.sql b/src/revert/function_guest_claim_array.sql index 3df4a43d..434e4c28 100644 --- a/src/revert/function_guest_claim_array.sql +++ b/src/revert/function_guest_claim_array.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.guest_claim_array(); +DROP FUNCTION vibetype.guest_claim_array(); COMMIT; diff --git a/src/revert/function_guest_contact_ids.sql b/src/revert/function_guest_contact_ids.sql index 1b82f1bd..7d6f60d4 100644 --- a/src/revert/function_guest_contact_ids.sql +++ b/src/revert/function_guest_contact_ids.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.guest_contact_ids; +DROP FUNCTION vibetype.guest_contact_ids; COMMIT; diff --git a/src/revert/function_guest_count.sql b/src/revert/function_guest_count.sql index 57e684c1..48c3a307 100644 --- a/src/revert/function_guest_count.sql +++ b/src/revert/function_guest_count.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.guest_count; +DROP FUNCTION vibetype.guest_count; COMMIT; diff --git a/src/revert/function_invite.sql b/src/revert/function_invite.sql index 747ed328..fc7dc248 100644 --- a/src/revert/function_invite.sql +++ b/src/revert/function_invite.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.invite; +DROP FUNCTION vibetype.invite; COMMIT; diff --git a/src/revert/function_invoker_account_id.sql b/src/revert/function_invoker_account_id.sql index d20fbd7c..4b17c1cf 100644 --- a/src/revert/function_invoker_account_id.sql +++ b/src/revert/function_invoker_account_id.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.invoker_account_id; +DROP FUNCTION vibetype.invoker_account_id; COMMIT; diff --git a/src/revert/function_jwt_refresh.sql b/src/revert/function_jwt_refresh.sql index 11a70ca6..cceab331 100644 --- a/src/revert/function_jwt_refresh.sql +++ b/src/revert/function_jwt_refresh.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.jwt_refresh; +DROP FUNCTION vibetype.jwt_refresh; COMMIT; diff --git a/src/revert/function_language_iso_full_text_search.sql b/src/revert/function_language_iso_full_text_search.sql index 4441a966..02026eab 100644 --- a/src/revert/function_language_iso_full_text_search.sql +++ b/src/revert/function_language_iso_full_text_search.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.language_iso_full_text_search; +DROP FUNCTION vibetype.language_iso_full_text_search; COMMIT; diff --git a/src/revert/function_notification_acknowledge.sql b/src/revert/function_notification_acknowledge.sql index 0bd570fd..3bb09ee4 100644 --- a/src/revert/function_notification_acknowledge.sql +++ b/src/revert/function_notification_acknowledge.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.notification_acknowledge; +DROP FUNCTION vibetype.notification_acknowledge; COMMIT; diff --git a/src/revert/function_profile_picture_set.sql b/src/revert/function_profile_picture_set.sql index be7e68a9..76faae81 100644 --- a/src/revert/function_profile_picture_set.sql +++ b/src/revert/function_profile_picture_set.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.profile_picture_set; +DROP FUNCTION vibetype.profile_picture_set; COMMIT; diff --git a/src/revert/function_test_utilities.sql b/src/revert/function_test_utilities.sql index 68ba0b89..0d3a4c85 100644 --- a/src/revert/function_test_utilities.sql +++ b/src/revert/function_test_utilities.sql @@ -1,22 +1,22 @@ BEGIN; -DROP FUNCTION maevsi_test.account_block_create(UUID, UUID); -DROP FUNCTION maevsi_test.account_block_remove(UUID, UUID); -DROP FUNCTION maevsi_test.account_create(TEXT, TEXT); -DROP FUNCTION maevsi_test.account_remove(TEXT); -DROP FUNCTION maevsi_test.contact_create(UUID, TEXT); -DROP FUNCTION maevsi_test.contact_select_by_account_id(UUID); -DROP FUNCTION maevsi_test.contact_test(TEXT, UUID, UUID[]); -DROP FUNCTION maevsi_test.event_category_create(TEXT); -DROP FUNCTION maevsi_test.event_category_mapping_create(UUID, UUID, TEXT); -DROP FUNCTION maevsi_test.event_category_mapping_test(TEXT, UUID, UUID[]); -DROP FUNCTION maevsi_test.event_create(UUID, TEXT, TEXT, TEXT, TEXT); -DROP FUNCTION maevsi_test.event_test(TEXT, UUID, UUID[]); -DROP FUNCTION maevsi_test.guest_create(UUID, UUID, UUID); -DROP FUNCTION maevsi_test.guest_test(TEXT, UUID, UUID[]); -DROP FUNCTION maevsi_test.guest_claim_from_account_guest(UUID); -DROP FUNCTION maevsi_test.invoker_set(UUID); -DROP FUNCTION maevsi_test.invoker_unset(); -DROP FUNCTION maevsi_test.uuid_array_test(TEXT, UUID[], UUID[]); +DROP FUNCTION vibetype_test.account_block_create(UUID, UUID); +DROP FUNCTION vibetype_test.account_block_remove(UUID, UUID); +DROP FUNCTION vibetype_test.account_create(TEXT, TEXT); +DROP FUNCTION vibetype_test.account_remove(TEXT); +DROP FUNCTION vibetype_test.contact_create(UUID, TEXT); +DROP FUNCTION vibetype_test.contact_select_by_account_id(UUID); +DROP FUNCTION vibetype_test.contact_test(TEXT, UUID, UUID[]); +DROP FUNCTION vibetype_test.event_category_create(TEXT); +DROP FUNCTION vibetype_test.event_category_mapping_create(UUID, UUID, TEXT); +DROP FUNCTION vibetype_test.event_category_mapping_test(TEXT, UUID, UUID[]); +DROP FUNCTION vibetype_test.event_create(UUID, TEXT, TEXT, TEXT, TEXT); +DROP FUNCTION vibetype_test.event_test(TEXT, UUID, UUID[]); +DROP FUNCTION vibetype_test.guest_create(UUID, UUID, UUID); +DROP FUNCTION vibetype_test.guest_test(TEXT, UUID, UUID[]); +DROP FUNCTION vibetype_test.guest_claim_from_account_guest(UUID); +DROP FUNCTION vibetype_test.invoker_set(UUID); +DROP FUNCTION vibetype_test.invoker_unset(); +DROP FUNCTION vibetype_test.uuid_array_test(TEXT, UUID[], UUID[]); COMMIT; diff --git a/src/revert/function_trigger_metadata_update.sql b/src/revert/function_trigger_metadata_update.sql index 9e3cc209..eb0b8478 100644 --- a/src/revert/function_trigger_metadata_update.sql +++ b/src/revert/function_trigger_metadata_update.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.trigger_metadata_update; +DROP FUNCTION vibetype.trigger_metadata_update; COMMIT; diff --git a/src/revert/function_upload_create.sql b/src/revert/function_upload_create.sql index 47722b1e..47f1621d 100644 --- a/src/revert/function_upload_create.sql +++ b/src/revert/function_upload_create.sql @@ -1,5 +1,5 @@ BEGIN; -DROP FUNCTION maevsi.upload_create; +DROP FUNCTION vibetype.upload_create; COMMIT; diff --git a/src/revert/index_account_private_location.sql b/src/revert/index_account_private_location.sql index 3ebd791a..64e179a3 100644 --- a/src/revert/index_account_private_location.sql +++ b/src/revert/index_account_private_location.sql @@ -1,5 +1,5 @@ BEGIN; -DROP INDEX maevsi_private.idx_account_private_location; +DROP INDEX vibetype_private.idx_account_private_location; COMMIT; diff --git a/src/revert/index_event_creator_username.sql b/src/revert/index_event_creator_username.sql index 14924c7d..1f71ee78 100644 --- a/src/revert/index_event_creator_username.sql +++ b/src/revert/index_event_creator_username.sql @@ -1,5 +1,5 @@ BEGIN; -DROP INDEX maevsi.idx_event_created_by; +DROP INDEX vibetype.idx_event_created_by; COMMIT; diff --git a/src/revert/index_event_group_creator_username.sql b/src/revert/index_event_group_creator_username.sql index d87f0522..ed17c1c0 100644 --- a/src/revert/index_event_group_creator_username.sql +++ b/src/revert/index_event_group_creator_username.sql @@ -1,5 +1,5 @@ BEGIN; -DROP INDEX maevsi.idx_event_group_created_by; +DROP INDEX vibetype.idx_event_group_created_by; COMMIT; diff --git a/src/revert/index_event_grouping_event_group_id.sql b/src/revert/index_event_grouping_event_group_id.sql index 12fa6c00..a78399ba 100644 --- a/src/revert/index_event_grouping_event_group_id.sql +++ b/src/revert/index_event_grouping_event_group_id.sql @@ -1,5 +1,5 @@ BEGIN; -DROP INDEX maevsi.idx_event_grouping_event_group_id; +DROP INDEX vibetype.idx_event_grouping_event_group_id; COMMIT; diff --git a/src/revert/index_event_grouping_event_id.sql b/src/revert/index_event_grouping_event_id.sql index ce5d392e..15b609f9 100644 --- a/src/revert/index_event_grouping_event_id.sql +++ b/src/revert/index_event_grouping_event_id.sql @@ -1,5 +1,5 @@ BEGIN; -DROP INDEX maevsi.idx_event_grouping_event_id; +DROP INDEX vibetype.idx_event_grouping_event_id; COMMIT; diff --git a/src/revert/index_event_location.sql b/src/revert/index_event_location.sql index 3ad46c6c..56476ccb 100644 --- a/src/revert/index_event_location.sql +++ b/src/revert/index_event_location.sql @@ -1,5 +1,5 @@ BEGIN; -DROP INDEX maevsi.idx_event_location; +DROP INDEX vibetype.idx_event_location; COMMIT; diff --git a/src/revert/index_guest_contact_id.sql b/src/revert/index_guest_contact_id.sql index 9f6c2ec9..f3c06fa6 100644 --- a/src/revert/index_guest_contact_id.sql +++ b/src/revert/index_guest_contact_id.sql @@ -1,5 +1,5 @@ BEGIN; -DROP INDEX maevsi.idx_guest_contact_id; +DROP INDEX vibetype.idx_guest_contact_id; COMMIT; diff --git a/src/revert/index_guest_event_id.sql b/src/revert/index_guest_event_id.sql index 6c31eeca..51471f40 100644 --- a/src/revert/index_guest_event_id.sql +++ b/src/revert/index_guest_event_id.sql @@ -1,5 +1,5 @@ BEGIN; -DROP INDEX maevsi.idx_guest_event_id; +DROP INDEX vibetype.idx_guest_event_id; COMMIT; diff --git a/src/revert/role_account.sql b/src/revert/role_account.sql index 127d8b68..204388cf 100644 --- a/src/revert/role_account.sql +++ b/src/revert/role_account.sql @@ -1,5 +1,5 @@ BEGIN; -DROP ROLE maevsi_account; +DROP ROLE vibetype_account; COMMIT; diff --git a/src/revert/role_anonymous.sql b/src/revert/role_anonymous.sql index f903c5d2..1d3452cf 100644 --- a/src/revert/role_anonymous.sql +++ b/src/revert/role_anonymous.sql @@ -1,5 +1,5 @@ BEGIN; -DROP ROLE maevsi_anonymous; +DROP ROLE vibetype_anonymous; COMMIT; diff --git a/src/revert/role_postgraphile.sql b/src/revert/role_postgraphile.sql index cf46f8e2..81d659d4 100644 --- a/src/revert/role_postgraphile.sql +++ b/src/revert/role_postgraphile.sql @@ -1,6 +1,6 @@ BEGIN; -DROP OWNED BY maevsi_postgraphile; -DROP ROLE maevsi_postgraphile; +DROP OWNED BY vibetype_postgraphile; +DROP ROLE vibetype_postgraphile; COMMIT; diff --git a/src/revert/role_tusd.sql b/src/revert/role_tusd.sql index 334783d5..d7a9095d 100644 --- a/src/revert/role_tusd.sql +++ b/src/revert/role_tusd.sql @@ -1,6 +1,6 @@ BEGIN; -DROP OWNED BY maevsi_tusd; -DROP ROLE maevsi_tusd; +DROP OWNED BY vibetype_tusd; +DROP ROLE vibetype_tusd; COMMIT; diff --git a/src/revert/schema_private.sql b/src/revert/schema_private.sql index baf6816f..7da9974e 100644 --- a/src/revert/schema_private.sql +++ b/src/revert/schema_private.sql @@ -1,5 +1,5 @@ BEGIN; -DROP SCHEMA maevsi_private; +DROP SCHEMA vibetype_private; COMMIT; diff --git a/src/revert/schema_public.sql b/src/revert/schema_public.sql index 542da575..e7a10f73 100644 --- a/src/revert/schema_public.sql +++ b/src/revert/schema_public.sql @@ -1,5 +1,5 @@ BEGIN; -DROP SCHEMA maevsi; +DROP SCHEMA vibetype; COMMIT; diff --git a/src/revert/schema_test.sql b/src/revert/schema_test.sql index 88c40150..672ec2e4 100644 --- a/src/revert/schema_test.sql +++ b/src/revert/schema_test.sql @@ -1,5 +1,5 @@ BEGIN; -DROP SCHEMA maevsi_test; +DROP SCHEMA vibetype_test; COMMIT; diff --git a/src/revert/table_account_block.sql b/src/revert/table_account_block.sql index 57b147d3..8b6cb153 100644 --- a/src/revert/table_account_block.sql +++ b/src/revert/table_account_block.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.account_block; +DROP TABLE vibetype.account_block; COMMIT; diff --git a/src/revert/table_account_block_policy.sql b/src/revert/table_account_block_policy.sql index c2a68ed8..c1f29d11 100644 --- a/src/revert/table_account_block_policy.sql +++ b/src/revert/table_account_block_policy.sql @@ -1,6 +1,6 @@ BEGIN; -DROP POLICY account_block_insert ON maevsi.account_block; -DROP POLICY account_block_select ON maevsi.account_block; +DROP POLICY account_block_insert ON vibetype.account_block; +DROP POLICY account_block_select ON vibetype.account_block; COMMIT; diff --git a/src/revert/table_account_interest.sql b/src/revert/table_account_interest.sql index 1359236b..257a7b26 100644 --- a/src/revert/table_account_interest.sql +++ b/src/revert/table_account_interest.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.account_interest; +DROP TABLE vibetype.account_interest; COMMIT; diff --git a/src/revert/table_account_interest_policy.sql b/src/revert/table_account_interest_policy.sql index b2604c7e..eb7a5998 100644 --- a/src/revert/table_account_interest_policy.sql +++ b/src/revert/table_account_interest_policy.sql @@ -1,7 +1,7 @@ BEGIN; -DROP POLICY account_interest_select ON maevsi.account_interest; -DROP POLICY account_interest_insert ON maevsi.account_interest; -DROP POLICY account_interest_delete ON maevsi.account_interest; +DROP POLICY account_interest_select ON vibetype.account_interest; +DROP POLICY account_interest_insert ON vibetype.account_interest; +DROP POLICY account_interest_delete ON vibetype.account_interest; COMMIT; diff --git a/src/revert/table_account_preference_event_size.sql b/src/revert/table_account_preference_event_size.sql index 2789e92f..f486b908 100644 --- a/src/revert/table_account_preference_event_size.sql +++ b/src/revert/table_account_preference_event_size.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.account_preference_event_size; +DROP TABLE vibetype.account_preference_event_size; COMMIT; diff --git a/src/revert/table_account_preference_event_size_policy.sql b/src/revert/table_account_preference_event_size_policy.sql index 36b32c3b..11e6b667 100644 --- a/src/revert/table_account_preference_event_size_policy.sql +++ b/src/revert/table_account_preference_event_size_policy.sql @@ -1,7 +1,7 @@ BEGIN; -DROP POLICY account_preference_event_size_select ON maevsi.account_preference_event_size; -DROP POLICY account_preference_event_size_insert ON maevsi.account_preference_event_size; -DROP POLICY account_preference_event_size_delete ON maevsi.account_preference_event_size; +DROP POLICY account_preference_event_size_select ON vibetype.account_preference_event_size; +DROP POLICY account_preference_event_size_insert ON vibetype.account_preference_event_size; +DROP POLICY account_preference_event_size_delete ON vibetype.account_preference_event_size; COMMIT; diff --git a/src/revert/table_account_private.sql b/src/revert/table_account_private.sql index dd74a4d0..8b6efae5 100644 --- a/src/revert/table_account_private.sql +++ b/src/revert/table_account_private.sql @@ -1,9 +1,9 @@ BEGIN; -DROP TRIGGER maevsi_private_account_password_reset_verification_valid_until ON maevsi_private.account; -DROP TRIGGER maevsi_private_account_email_address_verification_valid_until ON maevsi_private.account; -DROP FUNCTION maevsi_private.account_password_reset_verification_valid_until; -DROP FUNCTION maevsi_private.account_email_address_verification_valid_until; -DROP TABLE maevsi_private.account; +DROP TRIGGER vibetype_private_account_password_reset_verification_valid_until ON vibetype_private.account; +DROP TRIGGER vibetype_private_account_email_address_verification_valid_until ON vibetype_private.account; +DROP FUNCTION vibetype_private.account_password_reset_verification_valid_until; +DROP FUNCTION vibetype_private.account_email_address_verification_valid_until; +DROP TABLE vibetype_private.account; COMMIT; diff --git a/src/revert/table_account_public.sql b/src/revert/table_account_public.sql index cc12edbf..9970368e 100644 --- a/src/revert/table_account_public.sql +++ b/src/revert/table_account_public.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.account; +DROP TABLE vibetype.account; COMMIT; diff --git a/src/revert/table_account_social_network.sql b/src/revert/table_account_social_network.sql index fd426820..84df1713 100644 --- a/src/revert/table_account_social_network.sql +++ b/src/revert/table_account_social_network.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.account_social_network ; +DROP TABLE vibetype.account_social_network ; COMMIT; diff --git a/src/revert/table_account_social_network_policy.sql b/src/revert/table_account_social_network_policy.sql index 740760f0..070a55b3 100644 --- a/src/revert/table_account_social_network_policy.sql +++ b/src/revert/table_account_social_network_policy.sql @@ -1,7 +1,7 @@ BEGIN; -DROP POLICY account_social_network_insert ON maevsi.account_social_network; -DROP POLICY account_social_network_update ON maevsi.account_social_network; -DROP POLICY account_social_network_delete ON maevsi.account_social_network; +DROP POLICY account_social_network_insert ON vibetype.account_social_network; +DROP POLICY account_social_network_update ON vibetype.account_social_network; +DROP POLICY account_social_network_delete ON vibetype.account_social_network; COMMIT; diff --git a/src/revert/table_achievement.sql b/src/revert/table_achievement.sql index 9e715529..644f4b60 100644 --- a/src/revert/table_achievement.sql +++ b/src/revert/table_achievement.sql @@ -1,6 +1,6 @@ BEGIN; -DROP POLICY achievement_select ON maevsi.achievement; -DROP TABLE maevsi.achievement; +DROP POLICY achievement_select ON vibetype.achievement; +DROP TABLE vibetype.achievement; COMMIT; diff --git a/src/revert/table_achievement_code.sql b/src/revert/table_achievement_code.sql index 5583eec2..c85468b2 100644 --- a/src/revert/table_achievement_code.sql +++ b/src/revert/table_achievement_code.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi_private.achievement_code; +DROP TABLE vibetype_private.achievement_code; COMMIT; diff --git a/src/revert/table_address.sql b/src/revert/table_address.sql index ba2ab7cb..01aab1c8 100644 --- a/src/revert/table_address.sql +++ b/src/revert/table_address.sql @@ -1,7 +1,7 @@ BEGIN; -DROP TRIGGER maevsi_trigger_address_update ON maevsi.address; +DROP TRIGGER vibetype_trigger_address_update ON vibetype.address; -DROP TABLE maevsi.address; +DROP TABLE vibetype.address; COMMIT; diff --git a/src/revert/table_address_policy.sql b/src/revert/table_address_policy.sql index 3ab3bac6..b5146a10 100644 --- a/src/revert/table_address_policy.sql +++ b/src/revert/table_address_policy.sql @@ -1,8 +1,8 @@ BEGIN; -DROP POLICY address_delete ON maevsi.address; -DROP POLICY address_update ON maevsi.address; -DROP POLICY address_insert ON maevsi.address; -DROP POLICY address_select ON maevsi.address; +DROP POLICY address_delete ON vibetype.address; +DROP POLICY address_update ON vibetype.address; +DROP POLICY address_insert ON vibetype.address; +DROP POLICY address_select ON vibetype.address; COMMIT; diff --git a/src/revert/table_contact.sql b/src/revert/table_contact.sql index 2e74c355..a824dd57 100644 --- a/src/revert/table_contact.sql +++ b/src/revert/table_contact.sql @@ -1,9 +1,9 @@ BEGIN; -DROP TRIGGER maevsi_trigger_contact_update_account_id ON maevsi.contact; +DROP TRIGGER vibetype_trigger_contact_update_account_id ON vibetype.contact; -DROP FUNCTION maevsi.trigger_contact_update_account_id; +DROP FUNCTION vibetype.trigger_contact_update_account_id; -DROP TABLE maevsi.contact; +DROP TABLE vibetype.contact; COMMIT; diff --git a/src/revert/table_contact_policy.sql b/src/revert/table_contact_policy.sql index a1da8c27..baf33d7b 100644 --- a/src/revert/table_contact_policy.sql +++ b/src/revert/table_contact_policy.sql @@ -1,8 +1,8 @@ BEGIN; -DROP POLICY contact_delete ON maevsi.contact; -DROP POLICY contact_update ON maevsi.contact; -DROP POLICY contact_insert ON maevsi.contact; -DROP POLICY contact_select ON maevsi.contact; +DROP POLICY contact_delete ON vibetype.contact; +DROP POLICY contact_update ON vibetype.contact; +DROP POLICY contact_insert ON vibetype.contact; +DROP POLICY contact_select ON vibetype.contact; COMMIT; diff --git a/src/revert/table_event.sql b/src/revert/table_event.sql index a98b5813..d459c524 100644 --- a/src/revert/table_event.sql +++ b/src/revert/table_event.sql @@ -1,7 +1,7 @@ BEGIN; -DROP TRIGGER maevsi_trigger_event_search_vector ON maevsi.event; -DROP FUNCTION maevsi.trigger_event_search_vector(); -DROP TABLE maevsi.event; +DROP TRIGGER vibetype_trigger_event_search_vector ON vibetype.event; +DROP FUNCTION vibetype.trigger_event_search_vector(); +DROP TABLE vibetype.event; COMMIT; diff --git a/src/revert/table_event_category.sql b/src/revert/table_event_category.sql index 11c54528..e49e9d89 100644 --- a/src/revert/table_event_category.sql +++ b/src/revert/table_event_category.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.event_category; +DROP TABLE vibetype.event_category; COMMIT; diff --git a/src/revert/table_event_category_mapping.sql b/src/revert/table_event_category_mapping.sql index c0104d8f..35b80c8c 100644 --- a/src/revert/table_event_category_mapping.sql +++ b/src/revert/table_event_category_mapping.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.event_category_mapping; +DROP TABLE vibetype.event_category_mapping; COMMIT; diff --git a/src/revert/table_event_category_mapping_policy.sql b/src/revert/table_event_category_mapping_policy.sql index 07325561..0f8a5873 100644 --- a/src/revert/table_event_category_mapping_policy.sql +++ b/src/revert/table_event_category_mapping_policy.sql @@ -1,7 +1,7 @@ BEGIN; -DROP POLICY event_category_mapping_select ON maevsi.event_category_mapping; -DROP POLICY event_category_mapping_insert ON maevsi.event_category_mapping; -DROP POLICY event_category_mapping_delete ON maevsi.event_category_mapping; +DROP POLICY event_category_mapping_select ON vibetype.event_category_mapping; +DROP POLICY event_category_mapping_insert ON vibetype.event_category_mapping; +DROP POLICY event_category_mapping_delete ON vibetype.event_category_mapping; COMMIT; diff --git a/src/revert/table_event_favorite.sql b/src/revert/table_event_favorite.sql index 393e3aa1..e334a00d 100644 --- a/src/revert/table_event_favorite.sql +++ b/src/revert/table_event_favorite.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.event_favorite; +DROP TABLE vibetype.event_favorite; COMMIT; diff --git a/src/revert/table_event_favorite_policy.sql b/src/revert/table_event_favorite_policy.sql index e568e888..bd587cb2 100644 --- a/src/revert/table_event_favorite_policy.sql +++ b/src/revert/table_event_favorite_policy.sql @@ -1,7 +1,7 @@ BEGIN; -DROP POLICY event_favorite_select ON maevsi.event_favorite; -DROP POLICY event_favorite_insert ON maevsi.event_favorite; -DROP POLICY event_favorite_delete ON maevsi.event_favorite; +DROP POLICY event_favorite_select ON vibetype.event_favorite; +DROP POLICY event_favorite_insert ON vibetype.event_favorite; +DROP POLICY event_favorite_delete ON vibetype.event_favorite; COMMIT; diff --git a/src/revert/table_event_group.sql b/src/revert/table_event_group.sql index 01bf43c0..c3c1ab37 100644 --- a/src/revert/table_event_group.sql +++ b/src/revert/table_event_group.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.event_group; +DROP TABLE vibetype.event_group; COMMIT; diff --git a/src/revert/table_event_grouping.sql b/src/revert/table_event_grouping.sql index fa5d1aaa..08b558e2 100644 --- a/src/revert/table_event_grouping.sql +++ b/src/revert/table_event_grouping.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.event_grouping; +DROP TABLE vibetype.event_grouping; COMMIT; diff --git a/src/revert/table_event_policy.sql b/src/revert/table_event_policy.sql index bb9918bb..f769fce9 100644 --- a/src/revert/table_event_policy.sql +++ b/src/revert/table_event_policy.sql @@ -1,7 +1,7 @@ BEGIN; -DROP POLICY event_update ON maevsi.event; -DROP POLICY event_insert ON maevsi.event; -DROP POLICY event_select ON maevsi.event; +DROP POLICY event_update ON vibetype.event; +DROP POLICY event_insert ON vibetype.event; +DROP POLICY event_select ON vibetype.event; COMMIT; diff --git a/src/revert/table_event_recommendation.sql b/src/revert/table_event_recommendation.sql index 58928388..fc74aca2 100644 --- a/src/revert/table_event_recommendation.sql +++ b/src/revert/table_event_recommendation.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.event_recommendation; +DROP TABLE vibetype.event_recommendation; COMMIT; diff --git a/src/revert/table_event_recommendation_policy.sql b/src/revert/table_event_recommendation_policy.sql index 2d38bd4b..612414bd 100644 --- a/src/revert/table_event_recommendation_policy.sql +++ b/src/revert/table_event_recommendation_policy.sql @@ -1,5 +1,5 @@ BEGIN; -DROP POLICY event_recommendation_select ON maevsi.event_recommendation; +DROP POLICY event_recommendation_select ON vibetype.event_recommendation; COMMIT; diff --git a/src/revert/table_event_upload.sql b/src/revert/table_event_upload.sql index b8e71493..70a629e8 100644 --- a/src/revert/table_event_upload.sql +++ b/src/revert/table_event_upload.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.event_upload; +DROP TABLE vibetype.event_upload; COMMIT; diff --git a/src/revert/table_event_upload_policy.sql b/src/revert/table_event_upload_policy.sql index b88850a2..cccb0f41 100644 --- a/src/revert/table_event_upload_policy.sql +++ b/src/revert/table_event_upload_policy.sql @@ -1,7 +1,7 @@ BEGIN; -DROP POLICY event_upload_select ON maevsi.event_upload; -DROP POLICY event_upload_insert ON maevsi.event_upload; -DROP POLICY event_upload_delete ON maevsi.event_upload; +DROP POLICY event_upload_select ON vibetype.event_upload; +DROP POLICY event_upload_insert ON vibetype.event_upload; +DROP POLICY event_upload_delete ON vibetype.event_upload; COMMIT; diff --git a/src/revert/table_guest.sql b/src/revert/table_guest.sql index 51d6ec67..46a84d97 100644 --- a/src/revert/table_guest.sql +++ b/src/revert/table_guest.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.guest; +DROP TABLE vibetype.guest; COMMIT; diff --git a/src/revert/table_guest_policy.sql b/src/revert/table_guest_policy.sql index 1e70854f..e0fa5ef5 100644 --- a/src/revert/table_guest_policy.sql +++ b/src/revert/table_guest_policy.sql @@ -1,12 +1,12 @@ BEGIN; -DROP TRIGGER maevsi_guest_update ON maevsi.guest; +DROP TRIGGER vibetype_guest_update ON vibetype.guest; -DROP FUNCTION maevsi.trigger_guest_update; +DROP FUNCTION vibetype.trigger_guest_update; -DROP POLICY guest_select ON maevsi.guest; -DROP POLICY guest_insert ON maevsi.guest; -DROP POLICY guest_update ON maevsi.guest; -DROP POLICY guest_delete ON maevsi.guest; +DROP POLICY guest_select ON vibetype.guest; +DROP POLICY guest_insert ON vibetype.guest; +DROP POLICY guest_update ON vibetype.guest; +DROP POLICY guest_delete ON vibetype.guest; COMMIT; diff --git a/src/revert/table_invitation.sql b/src/revert/table_invitation.sql index 82cd0bee..31d314d0 100644 --- a/src/revert/table_invitation.sql +++ b/src/revert/table_invitation.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.invitation; +DROP TABLE vibetype.invitation; COMMIT; diff --git a/src/revert/table_invitation_policy.sql b/src/revert/table_invitation_policy.sql index 88309e83..aead7aa2 100644 --- a/src/revert/table_invitation_policy.sql +++ b/src/revert/table_invitation_policy.sql @@ -1,6 +1,6 @@ BEGIN; -DROP POLICY invitation_insert ON maevsi.invitation; -DROP POLICY invitation_select ON maevsi.invitation; +DROP POLICY invitation_insert ON vibetype.invitation; +DROP POLICY invitation_select ON vibetype.invitation; COMMIT; diff --git a/src/revert/table_jwt.sql b/src/revert/table_jwt.sql index 7f67a80f..0245dd2b 100644 --- a/src/revert/table_jwt.sql +++ b/src/revert/table_jwt.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi_private.jwt; +DROP TABLE vibetype_private.jwt; COMMIT; diff --git a/src/revert/table_legal_term.sql b/src/revert/table_legal_term.sql index 4a8db85a..9a446d0c 100644 --- a/src/revert/table_legal_term.sql +++ b/src/revert/table_legal_term.sql @@ -1,9 +1,9 @@ BEGIN; -DROP POLICY legal_term_select ON maevsi.legal_term; -DROP TRIGGER maevsi_legal_term_delete ON maevsi.legal_term; -DROP TRIGGER maevsi_legal_term_update ON maevsi.legal_term; -DROP FUNCTION maevsi.legal_term_change; -DROP TABLE maevsi.legal_term; +DROP POLICY legal_term_select ON vibetype.legal_term; +DROP TRIGGER vibetype_legal_term_delete ON vibetype.legal_term; +DROP TRIGGER vibetype_legal_term_update ON vibetype.legal_term; +DROP FUNCTION vibetype.legal_term_change; +DROP TABLE vibetype.legal_term; COMMIT; diff --git a/src/revert/table_legal_term_acceptance.sql b/src/revert/table_legal_term_acceptance.sql index 6808d751..fda5b9e1 100644 --- a/src/revert/table_legal_term_acceptance.sql +++ b/src/revert/table_legal_term_acceptance.sql @@ -1,8 +1,8 @@ BEGIN; -DROP POLICY legal_term_acceptance_select ON maevsi.legal_term_acceptance; -DROP POLICY legal_term_acceptance_insert ON maevsi.legal_term_acceptance; +DROP POLICY legal_term_acceptance_select ON vibetype.legal_term_acceptance; +DROP POLICY legal_term_acceptance_insert ON vibetype.legal_term_acceptance; -DROP TABLE maevsi.legal_term_acceptance; +DROP TABLE vibetype.legal_term_acceptance; COMMIT; diff --git a/src/revert/table_notification.sql b/src/revert/table_notification.sql index ccaf2f81..bb85e7c9 100644 --- a/src/revert/table_notification.sql +++ b/src/revert/table_notification.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.notification; +DROP TABLE vibetype.notification; COMMIT; diff --git a/src/revert/table_profile_picture.sql b/src/revert/table_profile_picture.sql index 0ee2f5c1..487e0742 100644 --- a/src/revert/table_profile_picture.sql +++ b/src/revert/table_profile_picture.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.profile_picture; +DROP TABLE vibetype.profile_picture; COMMIT; diff --git a/src/revert/table_report.sql b/src/revert/table_report.sql index df03a553..c3d19552 100644 --- a/src/revert/table_report.sql +++ b/src/revert/table_report.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.report; +DROP TABLE vibetype.report; COMMIT; diff --git a/src/revert/table_report_policy.sql b/src/revert/table_report_policy.sql index b90b8742..cd0b9995 100644 --- a/src/revert/table_report_policy.sql +++ b/src/revert/table_report_policy.sql @@ -1,6 +1,6 @@ BEGIN; -DROP POLICY report_select ON maevsi.report; -DROP POLICY report_insert ON maevsi.report; +DROP POLICY report_select ON vibetype.report; +DROP POLICY report_insert ON vibetype.report; COMMIT; diff --git a/src/revert/table_upload.sql b/src/revert/table_upload.sql index a6066f5b..88336131 100644 --- a/src/revert/table_upload.sql +++ b/src/revert/table_upload.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TABLE maevsi.upload; +DROP TABLE vibetype.upload; COMMIT; diff --git a/src/revert/table_upload_policy.sql b/src/revert/table_upload_policy.sql index 099ad350..428b4a62 100644 --- a/src/revert/table_upload_policy.sql +++ b/src/revert/table_upload_policy.sql @@ -1,7 +1,7 @@ BEGIN; -DROP POLICY upload_delete_using ON maevsi.upload; -DROP POLICY upload_select_using ON maevsi.upload; -DROP POLICY upload_update_using ON maevsi.upload; +DROP POLICY upload_delete_using ON vibetype.upload; +DROP POLICY upload_select_using ON vibetype.upload; +DROP POLICY upload_update_using ON vibetype.upload; COMMIT; diff --git a/src/revert/test_location.sql b/src/revert/test_location.sql index 5711c463..f1a4de6a 100644 --- a/src/revert/test_location.sql +++ b/src/revert/test_location.sql @@ -1,12 +1,12 @@ BEGIN; -DROP FUNCTION maevsi_test.account_filter_radius_event(UUID, DOUBLE PRECISION); -DROP FUNCTION maevsi_test.event_filter_radius_account(UUID, DOUBLE PRECISION); +DROP FUNCTION vibetype_test.account_filter_radius_event(UUID, DOUBLE PRECISION); +DROP FUNCTION vibetype_test.event_filter_radius_account(UUID, DOUBLE PRECISION); -DROP FUNCTION maevsi_test.account_location_update(UUID, DOUBLE PRECISION, DOUBLE PRECISION); -DROP FUNCTION maevsi_test.event_location_update(UUID, DOUBLE PRECISION, DOUBLE PRECISION); +DROP FUNCTION vibetype_test.account_location_update(UUID, DOUBLE PRECISION, DOUBLE PRECISION); +DROP FUNCTION vibetype_test.event_location_update(UUID, DOUBLE PRECISION, DOUBLE PRECISION); -DROP FUNCTION maevsi_test.account_location_coordinates(UUID); -DROP FUNCTION maevsi_test.event_location_coordinates(UUID); +DROP FUNCTION vibetype_test.account_location_coordinates(UUID); +DROP FUNCTION vibetype_test.event_location_coordinates(UUID); COMMIT; diff --git a/src/revert/type_event_unlock_response.sql b/src/revert/type_event_unlock_response.sql index 603be2d2..5255830b 100644 --- a/src/revert/type_event_unlock_response.sql +++ b/src/revert/type_event_unlock_response.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TYPE maevsi.event_unlock_response; +DROP TYPE vibetype.event_unlock_response; COMMIT; diff --git a/src/revert/type_jwt.sql b/src/revert/type_jwt.sql index 5625524d..18cd6cbd 100644 --- a/src/revert/type_jwt.sql +++ b/src/revert/type_jwt.sql @@ -1,5 +1,5 @@ BEGIN; -DROP TYPE maevsi.jwt; +DROP TYPE vibetype.jwt; COMMIT; diff --git a/src/revert/view_guest_flat.sql b/src/revert/view_guest_flat.sql index 33c0fd8a..081b7c37 100644 --- a/src/revert/view_guest_flat.sql +++ b/src/revert/view_guest_flat.sql @@ -1,5 +1,5 @@ BEGIN; -DROP VIEW maevsi.guest_flat; +DROP VIEW vibetype.guest_flat; COMMIT; diff --git a/src/verify/enum_achievement_type.sql b/src/verify/enum_achievement_type.sql index 71b77334..b4460c44 100644 --- a/src/verify/enum_achievement_type.sql +++ b/src/verify/enum_achievement_type.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_type_privilege('maevsi.achievement_type', 'USAGE')); + ASSERT (SELECT pg_catalog.has_type_privilege('vibetype.achievement_type', 'USAGE')); END $$; ROLLBACK; diff --git a/src/verify/enum_event_size.sql b/src/verify/enum_event_size.sql index e032368d..9edf34ec 100644 --- a/src/verify/enum_event_size.sql +++ b/src/verify/enum_event_size.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_type_privilege('maevsi.event_size', 'USAGE')); + ASSERT (SELECT pg_catalog.has_type_privilege('vibetype.event_size', 'USAGE')); END $$; ROLLBACK; diff --git a/src/verify/enum_event_visibility.sql b/src/verify/enum_event_visibility.sql index e7170f43..218df6dc 100644 --- a/src/verify/enum_event_visibility.sql +++ b/src/verify/enum_event_visibility.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_type_privilege('maevsi.event_visibility', 'USAGE')); + ASSERT (SELECT pg_catalog.has_type_privilege('vibetype.event_visibility', 'USAGE')); END $$; ROLLBACK; diff --git a/src/verify/enum_invitation_feedback.sql b/src/verify/enum_invitation_feedback.sql index e4547970..e3c05412 100644 --- a/src/verify/enum_invitation_feedback.sql +++ b/src/verify/enum_invitation_feedback.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_type_privilege('maevsi.invitation_feedback', 'USAGE')); + ASSERT (SELECT pg_catalog.has_type_privilege('vibetype.invitation_feedback', 'USAGE')); END $$; ROLLBACK; diff --git a/src/verify/enum_invitation_feedback_paper.sql b/src/verify/enum_invitation_feedback_paper.sql index 32ac0c4f..1ac25982 100644 --- a/src/verify/enum_invitation_feedback_paper.sql +++ b/src/verify/enum_invitation_feedback_paper.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_type_privilege('maevsi.invitation_feedback_paper', 'USAGE')); + ASSERT (SELECT pg_catalog.has_type_privilege('vibetype.invitation_feedback_paper', 'USAGE')); END $$; ROLLBACK; diff --git a/src/verify/enum_language.sql b/src/verify/enum_language.sql index 56726d96..80af712a 100644 --- a/src/verify/enum_language.sql +++ b/src/verify/enum_language.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_type_privilege('maevsi.language', 'USAGE')); + ASSERT (SELECT pg_catalog.has_type_privilege('vibetype.language', 'USAGE')); END $$; ROLLBACK; diff --git a/src/verify/enum_social_network.sql b/src/verify/enum_social_network.sql index 5c99fe24..6eb54be1 100644 --- a/src/verify/enum_social_network.sql +++ b/src/verify/enum_social_network.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_type_privilege('maevsi.social_network', 'USAGE')); + ASSERT (SELECT pg_catalog.has_type_privilege('vibetype.social_network', 'USAGE')); END $$; ROLLBACK; diff --git a/src/verify/extension_postgis.sql b/src/verify/extension_postgis.sql index 74691917..c36b0f4c 100644 --- a/src/verify/extension_postgis.sql +++ b/src/verify/extension_postgis.sql @@ -16,7 +16,7 @@ DECLARE 'st_geomfromgeojson(TEXT)', 'st_srid(GEOGRAPHY)' ]; - roles TEXT[] := ARRAY['maevsi_account', 'maevsi_anonymous']; + roles TEXT[] := ARRAY['vibetype_account', 'vibetype_anonymous']; function TEXT; role TEXT; BEGIN diff --git a/src/verify/function_account_block_ids.sql b/src/verify/function_account_block_ids.sql index eb977d5d..663d90fb 100644 --- a/src/verify/function_account_block_ids.sql +++ b/src/verify/function_account_block_ids.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi_private.account_block_ids()', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi_private.account_block_ids()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype_private.account_block_ids()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype_private.account_block_ids()', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_account_delete.sql b/src/verify/function_account_delete.sql index c279ac2d..10650e3c 100644 --- a/src/verify/function_account_delete.sql +++ b/src/verify/function_account_delete.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.account_delete(TEXT)', 'EXECUTE')); - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.account_delete(TEXT)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.account_delete(TEXT)', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.account_delete(TEXT)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_account_email_address_verification.sql b/src/verify/function_account_email_address_verification.sql index 1a728a76..0eeafe69 100644 --- a/src/verify/function_account_email_address_verification.sql +++ b/src/verify/function_account_email_address_verification.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.account_email_address_verification(UUID)', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.account_email_address_verification(UUID)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.account_email_address_verification(UUID)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.account_email_address_verification(UUID)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_account_password_change.sql b/src/verify/function_account_password_change.sql index 9f22f382..05c8e62a 100644 --- a/src/verify/function_account_password_change.sql +++ b/src/verify/function_account_password_change.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.account_password_change(TEXT, TEXT)', 'EXECUTE')); - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.account_password_change(TEXT, TEXT)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.account_password_change(TEXT, TEXT)', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.account_password_change(TEXT, TEXT)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_account_password_reset.sql b/src/verify/function_account_password_reset.sql index 7d2b239a..0c68d4d3 100644 --- a/src/verify/function_account_password_reset.sql +++ b/src/verify/function_account_password_reset.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.account_password_reset(UUID, TEXT)', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.account_password_reset(UUID, TEXT)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.account_password_reset(UUID, TEXT)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.account_password_reset(UUID, TEXT)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_account_password_reset_request.sql b/src/verify/function_account_password_reset_request.sql index 3abc805b..74dc7fc7 100644 --- a/src/verify/function_account_password_reset_request.sql +++ b/src/verify/function_account_password_reset_request.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.account_password_reset_request(TEXT, TEXT)', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.account_password_reset_request(TEXT, TEXT)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.account_password_reset_request(TEXT, TEXT)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.account_password_reset_request(TEXT, TEXT)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_account_registration.sql b/src/verify/function_account_registration.sql index e1aae5a9..557d792e 100644 --- a/src/verify/function_account_registration.sql +++ b/src/verify/function_account_registration.sql @@ -3,12 +3,12 @@ BEGIN; SAVEPOINT function_privileges_for_roles; DO $$ BEGIN - IF NOT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.account_registration(TEXT, TEXT, TEXT, TEXT)', 'EXECUTE')) THEN - RAISE EXCEPTION 'Test function_privileges_for_roles failed: maevsi_account does not have EXECUTE privilege'; + IF NOT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.account_registration(TEXT, TEXT, TEXT, TEXT)', 'EXECUTE')) THEN + RAISE EXCEPTION 'Test function_privileges_for_roles failed: vibetype_account does not have EXECUTE privilege'; END IF; - IF NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.account_registration(TEXT, TEXT, TEXT, TEXT)', 'EXECUTE')) THEN - RAISE EXCEPTION 'Test function_privileges_for_roles failed: maevsi_anonymous does not have EXECUTE privilege'; + IF NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.account_registration(TEXT, TEXT, TEXT, TEXT)', 'EXECUTE')) THEN + RAISE EXCEPTION 'Test function_privileges_for_roles failed: vibetype_anonymous does not have EXECUTE privilege'; END IF; END $$; ROLLBACK TO SAVEPOINT function_privileges_for_roles; @@ -16,14 +16,14 @@ ROLLBACK TO SAVEPOINT function_privileges_for_roles; SAVEPOINT account_registration; DO $$ BEGIN - PERFORM maevsi.account_registration('username', 'email@example.com', 'password', 'en'); + PERFORM vibetype.account_registration('username', 'email@example.com', 'password', 'en'); END $$; ROLLBACK TO SAVEPOINT account_registration; SAVEPOINT password_length; DO $$ BEGIN - PERFORM maevsi.account_registration('username', 'email@example.com', 'short', 'en'); + PERFORM vibetype.account_registration('username', 'email@example.com', 'short', 'en'); RAISE EXCEPTION 'Test failed: Password length not enforced'; EXCEPTION WHEN invalid_parameter_value THEN NULL; @@ -33,8 +33,8 @@ ROLLBACK TO SAVEPOINT password_length; SAVEPOINT username_uniqueness; DO $$ BEGIN - PERFORM maevsi.account_registration('username-duplicate', 'diff@example.com', 'password', 'en'); - PERFORM maevsi.account_registration('username-duplicate', 'erent@example.com', 'password', 'en'); + PERFORM vibetype.account_registration('username-duplicate', 'diff@example.com', 'password', 'en'); + PERFORM vibetype.account_registration('username-duplicate', 'erent@example.com', 'password', 'en'); RAISE EXCEPTION 'Test failed: Duplicate username not enforced'; EXCEPTION WHEN unique_violation THEN NULL; @@ -44,8 +44,8 @@ ROLLBACK TO SAVEPOINT username_uniqueness; SAVEPOINT email_uniqueness; DO $$ BEGIN - PERFORM maevsi.account_registration('username-diff', 'duplicate@example.com', 'password', 'en'); - PERFORM maevsi.account_registration('username-erent', 'duplicate@example.com', 'password', 'en'); + PERFORM vibetype.account_registration('username-diff', 'duplicate@example.com', 'password', 'en'); + PERFORM vibetype.account_registration('username-erent', 'duplicate@example.com', 'password', 'en'); RAISE EXCEPTION 'Test failed: Duplicate email not enforced'; EXCEPTION WHEN unique_violation THEN NULL; @@ -55,7 +55,7 @@ ROLLBACK TO SAVEPOINT email_uniqueness; SAVEPOINT username_null; DO $$ BEGIN - PERFORM maevsi.account_registration(NULL, 'email@example.com', 'password', 'en'); + PERFORM vibetype.account_registration(NULL, 'email@example.com', 'password', 'en'); RAISE EXCEPTION 'Test failed: NULL username allowed'; EXCEPTION WHEN OTHERS THEN NULL; @@ -65,7 +65,7 @@ ROLLBACK TO SAVEPOINT username_null; SAVEPOINT username_length; DO $$ BEGIN - PERFORM maevsi.account_registration('', 'email@example.com', 'password', 'en'); + PERFORM vibetype.account_registration('', 'email@example.com', 'password', 'en'); RAISE EXCEPTION 'Test failed: Empty username allowed'; EXCEPTION WHEN OTHERS THEN NULL; @@ -75,10 +75,10 @@ ROLLBACK TO SAVEPOINT username_length; SAVEPOINT notification; DO $$ BEGIN - PERFORM maevsi.account_registration('username-8b973f', 'email@example.com', 'password', 'en'); + PERFORM vibetype.account_registration('username-8b973f', 'email@example.com', 'password', 'en'); IF NOT EXISTS ( - SELECT 1 FROM maevsi.notification + SELECT 1 FROM vibetype.notification WHERE channel = 'account_registration' AND payload::jsonb -> 'account' ->> 'username' = 'username-8b973f' ) THEN diff --git a/src/verify/function_account_registration_refresh.sql b/src/verify/function_account_registration_refresh.sql index 1354ff63..66acc245 100644 --- a/src/verify/function_account_registration_refresh.sql +++ b/src/verify/function_account_registration_refresh.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.account_registration_refresh(UUID, TEXT)', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.account_registration_refresh(UUID, TEXT)', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.account_registration_refresh(UUID, TEXT)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.account_registration_refresh(UUID, TEXT)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_account_upload_quota_bytes.sql b/src/verify/function_account_upload_quota_bytes.sql index 2f93e90a..92137b36 100644 --- a/src/verify/function_account_upload_quota_bytes.sql +++ b/src/verify/function_account_upload_quota_bytes.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.account_upload_quota_bytes()', 'EXECUTE')); - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.account_upload_quota_bytes()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.account_upload_quota_bytes()', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.account_upload_quota_bytes()', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_achievement_unlock.sql b/src/verify/function_achievement_unlock.sql index 56af53cf..fb99c4c8 100644 --- a/src/verify/function_achievement_unlock.sql +++ b/src/verify/function_achievement_unlock.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.achievement_unlock(UUID, TEXT)', 'EXECUTE')); - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.achievement_unlock(UUID, TEXT)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.achievement_unlock(UUID, TEXT)', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.achievement_unlock(UUID, TEXT)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_authenticate.sql b/src/verify/function_authenticate.sql index 481a504b..acb5bb06 100644 --- a/src/verify/function_authenticate.sql +++ b/src/verify/function_authenticate.sql @@ -3,12 +3,12 @@ BEGIN; SAVEPOINT privileges; DO $$ BEGIN - IF NOT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.authenticate(TEXT, TEXT)', 'EXECUTE')) THEN - RAISE EXCEPTION 'Test privileges failed: maevsi_account does not have EXECUTE privilege'; + IF NOT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.authenticate(TEXT, TEXT)', 'EXECUTE')) THEN + RAISE EXCEPTION 'Test privileges failed: vibetype_account does not have EXECUTE privilege'; END IF; - IF NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.authenticate(TEXT, TEXT)', 'EXECUTE')) THEN - RAISE EXCEPTION 'Test privileges failed: maevsi_anonymous does not have EXECUTE privilege'; + IF NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.authenticate(TEXT, TEXT)', 'EXECUTE')) THEN + RAISE EXCEPTION 'Test privileges failed: vibetype_anonymous does not have EXECUTE privilege'; END IF; END $$; ROLLBACK TO SAVEPOINT privileges; @@ -17,14 +17,14 @@ SAVEPOINT username_success; DO $$ DECLARE _account_id UUID; - _jwt maevsi.jwt; + _jwt vibetype.jwt; BEGIN - _account_id := maevsi.account_registration('username', 'email@example.com', 'password', 'en'); - PERFORM maevsi.account_email_address_verification( - (SELECT email_address_verification FROM maevsi_private.account WHERE id = _account_id) + _account_id := vibetype.account_registration('username', 'email@example.com', 'password', 'en'); + PERFORM vibetype.account_email_address_verification( + (SELECT email_address_verification FROM vibetype_private.account WHERE id = _account_id) ); - _jwt := maevsi.authenticate('username', 'password'); + _jwt := vibetype.authenticate('username', 'password'); IF _jwt IS NULL THEN RAISE EXCEPTION 'Test failed: Authentication should have returned a JWT'; @@ -40,15 +40,15 @@ SAVEPOINT username_incorrect; DO $$ DECLARE _account_id UUID; - _jwt maevsi.jwt; + _jwt vibetype.jwt; BEGIN - _account_id := maevsi.account_registration('username', 'email@example.com', 'password', 'en'); - PERFORM maevsi.account_email_address_verification( - (SELECT email_address_verification FROM maevsi_private.account WHERE id = _account_id) + _account_id := vibetype.account_registration('username', 'email@example.com', 'password', 'en'); + PERFORM vibetype.account_email_address_verification( + (SELECT email_address_verification FROM vibetype_private.account WHERE id = _account_id) ); BEGIN - _jwt := maevsi.authenticate('username_incorrect', 'password'); + _jwt := vibetype.authenticate('username_incorrect', 'password'); EXCEPTION WHEN no_data_found THEN NULL; END; @@ -59,15 +59,15 @@ SAVEPOINT username_password_incorrect; DO $$ DECLARE _account_id UUID; - _jwt maevsi.jwt; + _jwt vibetype.jwt; BEGIN - _account_id := maevsi.account_registration('username', 'email@example.com', 'password', 'en'); - PERFORM maevsi.account_email_address_verification( - (SELECT email_address_verification FROM maevsi_private.account WHERE id = _account_id) + _account_id := vibetype.account_registration('username', 'email@example.com', 'password', 'en'); + PERFORM vibetype.account_email_address_verification( + (SELECT email_address_verification FROM vibetype_private.account WHERE id = _account_id) ); BEGIN - _jwt := maevsi.authenticate('username', 'password_incorrect'); + _jwt := vibetype.authenticate('username', 'password_incorrect'); EXCEPTION WHEN no_data_found THEN NULL; END; @@ -82,14 +82,14 @@ SAVEPOINT email_success; DO $$ DECLARE _account_id UUID; - _jwt maevsi.jwt; + _jwt vibetype.jwt; BEGIN - _account_id := maevsi.account_registration('username', 'email@example.com', 'password', 'en'); - PERFORM maevsi.account_email_address_verification( - (SELECT email_address_verification FROM maevsi_private.account WHERE id = _account_id) + _account_id := vibetype.account_registration('username', 'email@example.com', 'password', 'en'); + PERFORM vibetype.account_email_address_verification( + (SELECT email_address_verification FROM vibetype_private.account WHERE id = _account_id) ); - _jwt := maevsi.authenticate('email@example.com', 'password'); + _jwt := vibetype.authenticate('email@example.com', 'password'); IF _jwt IS NULL THEN RAISE EXCEPTION 'Test failed: Authentication should have returned a JWT'; @@ -105,15 +105,15 @@ SAVEPOINT email_incorrect; DO $$ DECLARE _account_id UUID; - _jwt maevsi.jwt; + _jwt vibetype.jwt; BEGIN - _account_id := maevsi.account_registration('username', 'email@example.com', 'password', 'en'); - PERFORM maevsi.account_email_address_verification( - (SELECT email_address_verification FROM maevsi_private.account WHERE id = _account_id) + _account_id := vibetype.account_registration('username', 'email@example.com', 'password', 'en'); + PERFORM vibetype.account_email_address_verification( + (SELECT email_address_verification FROM vibetype_private.account WHERE id = _account_id) ); BEGIN - _jwt := maevsi.authenticate('email_incorrect@example.com', 'password'); + _jwt := vibetype.authenticate('email_incorrect@example.com', 'password'); EXCEPTION WHEN no_data_found THEN NULL; END; @@ -128,15 +128,15 @@ SAVEPOINT email_password_incorrect; DO $$ DECLARE _account_id UUID; - _jwt maevsi.jwt; + _jwt vibetype.jwt; BEGIN - _account_id := maevsi.account_registration('username', 'email@example.com', 'password', 'en'); - PERFORM maevsi.account_email_address_verification( - (SELECT email_address_verification FROM maevsi_private.account WHERE id = _account_id) + _account_id := vibetype.account_registration('username', 'email@example.com', 'password', 'en'); + PERFORM vibetype.account_email_address_verification( + (SELECT email_address_verification FROM vibetype_private.account WHERE id = _account_id) ); BEGIN - _jwt := maevsi.authenticate('email@example.com', 'password_incorrect'); + _jwt := vibetype.authenticate('email@example.com', 'password_incorrect'); EXCEPTION WHEN no_data_found THEN NULL; END; diff --git a/src/verify/function_event_delete.sql b/src/verify/function_event_delete.sql index 6a3b7619..29a84142 100644 --- a/src/verify/function_event_delete.sql +++ b/src/verify/function_event_delete.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.event_delete(UUID, TEXT)', 'EXECUTE')); - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.event_delete(UUID, TEXT)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.event_delete(UUID, TEXT)', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.event_delete(UUID, TEXT)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_event_guest_count_maximum.sql b/src/verify/function_event_guest_count_maximum.sql index 3dd10d7f..f200a800 100644 --- a/src/verify/function_event_guest_count_maximum.sql +++ b/src/verify/function_event_guest_count_maximum.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.event_guest_count_maximum(UUID)', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.event_guest_count_maximum(UUID)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.event_guest_count_maximum(UUID)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.event_guest_count_maximum(UUID)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_event_is_existing.sql b/src/verify/function_event_is_existing.sql index a6610129..388088f9 100644 --- a/src/verify/function_event_is_existing.sql +++ b/src/verify/function_event_is_existing.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.event_is_existing(UUID, TEXT)', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.event_is_existing(UUID, TEXT)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.event_is_existing(UUID, TEXT)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.event_is_existing(UUID, TEXT)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_event_search.sql b/src/verify/function_event_search.sql index d5083377..a6eea9c6 100644 --- a/src/verify/function_event_search.sql +++ b/src/verify/function_event_search.sql @@ -3,12 +3,12 @@ BEGIN; SAVEPOINT privileges; DO $$ BEGIN - IF NOT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.event_search(TEXT, maevsi.language)', 'EXECUTE')) THEN - RAISE EXCEPTION 'Test privileges failed: maevsi_account does not have EXECUTE privilege'; + IF NOT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.event_search(TEXT, vibetype.language)', 'EXECUTE')) THEN + RAISE EXCEPTION 'Test privileges failed: vibetype_account does not have EXECUTE privilege'; END IF; - IF NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.event_search(TEXT, maevsi.language)', 'EXECUTE')) THEN - RAISE EXCEPTION 'Test privileges failed: maevsi_anonymous does not have EXECUTE privilege'; + IF NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.event_search(TEXT, vibetype.language)', 'EXECUTE')) THEN + RAISE EXCEPTION 'Test privileges failed: vibetype_anonymous does not have EXECUTE privilege'; END IF; END $$; ROLLBACK TO SAVEPOINT privileges; diff --git a/src/verify/function_event_unlock.sql b/src/verify/function_event_unlock.sql index 8d86751e..7520b86b 100644 --- a/src/verify/function_event_unlock.sql +++ b/src/verify/function_event_unlock.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.event_unlock(UUID)', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.event_unlock(UUID)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.event_unlock(UUID)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.event_unlock(UUID)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_events_invited.sql b/src/verify/function_events_invited.sql index 16bf3f48..bd06f53b 100644 --- a/src/verify/function_events_invited.sql +++ b/src/verify/function_events_invited.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi_private.events_invited()', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi_private.events_invited()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype_private.events_invited()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype_private.events_invited()', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_events_organized.sql b/src/verify/function_events_organized.sql index b96438e0..407ad8a2 100644 --- a/src/verify/function_events_organized.sql +++ b/src/verify/function_events_organized.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.events_organized()', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.events_organized()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.events_organized()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.events_organized()', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_guest_claim_array.sql b/src/verify/function_guest_claim_array.sql index 27aba8e4..e279adb8 100644 --- a/src/verify/function_guest_claim_array.sql +++ b/src/verify/function_guest_claim_array.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.guest_claim_array()', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.guest_claim_array()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.guest_claim_array()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.guest_claim_array()', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_guest_contact_ids.sql b/src/verify/function_guest_contact_ids.sql index ae08ebff..74558296 100644 --- a/src/verify/function_guest_contact_ids.sql +++ b/src/verify/function_guest_contact_ids.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.guest_contact_ids()', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.guest_contact_ids()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.guest_contact_ids()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.guest_contact_ids()', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_guest_count.sql b/src/verify/function_guest_count.sql index ffe3d1ec..877adb20 100644 --- a/src/verify/function_guest_count.sql +++ b/src/verify/function_guest_count.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.guest_count(UUID)', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.guest_count(UUID)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.guest_count(UUID)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.guest_count(UUID)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_invite.sql b/src/verify/function_invite.sql index 12b5c2a9..e6912b2b 100644 --- a/src/verify/function_invite.sql +++ b/src/verify/function_invite.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.invite(UUID, TEXT)', 'EXECUTE')); - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.invite(UUID, TEXT)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.invite(UUID, TEXT)', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.invite(UUID, TEXT)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_invoker_account_id.sql b/src/verify/function_invoker_account_id.sql index 022e92c5..b1aec7ce 100644 --- a/src/verify/function_invoker_account_id.sql +++ b/src/verify/function_invoker_account_id.sql @@ -2,9 +2,9 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.invoker_account_id()', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.invoker_account_id()', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_tusd', 'maevsi.invoker_account_id()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.invoker_account_id()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.invoker_account_id()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_tusd', 'vibetype.invoker_account_id()', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_jwt_refresh.sql b/src/verify/function_jwt_refresh.sql index 6b7f8861..9236836b 100644 --- a/src/verify/function_jwt_refresh.sql +++ b/src/verify/function_jwt_refresh.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.jwt_refresh(UUID)', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.jwt_refresh(UUID)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.jwt_refresh(UUID)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.jwt_refresh(UUID)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_language_iso_full_text_search.sql b/src/verify/function_language_iso_full_text_search.sql index 62ae38d1..572da747 100644 --- a/src/verify/function_language_iso_full_text_search.sql +++ b/src/verify/function_language_iso_full_text_search.sql @@ -3,12 +3,12 @@ BEGIN; SAVEPOINT privileges; DO $$ BEGIN - IF NOT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.language_iso_full_text_search(maevsi.language)', 'EXECUTE')) THEN - RAISE EXCEPTION 'Test privileges failed: maevsi_account does not have EXECUTE privilege'; + IF NOT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.language_iso_full_text_search(vibetype.language)', 'EXECUTE')) THEN + RAISE EXCEPTION 'Test privileges failed: vibetype_account does not have EXECUTE privilege'; END IF; - IF NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.language_iso_full_text_search(maevsi.language)', 'EXECUTE')) THEN - RAISE EXCEPTION 'Test privileges failed: maevsi_anonymous does not have EXECUTE privilege'; + IF NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.language_iso_full_text_search(vibetype.language)', 'EXECUTE')) THEN + RAISE EXCEPTION 'Test privileges failed: vibetype_anonymous does not have EXECUTE privilege'; END IF; END $$; ROLLBACK TO SAVEPOINT privileges; @@ -16,7 +16,7 @@ ROLLBACK TO SAVEPOINT privileges; SAVEPOINT success; DO $$ DECLARE - _language maevsi.language; + _language vibetype.language; _result regconfig; BEGIN FOREACH _language IN ARRAY @@ -28,8 +28,8 @@ BEGIN ELSE _result := 'pg_catalog.simple'; END CASE; - IF maevsi.language_iso_full_text_search(_language) != _result THEN - RAISE EXCEPTION 'Test failed for input %: Expected % but got %', _language, _result, maevsi.language_iso_full_text_search(lang_code); + IF vibetype.language_iso_full_text_search(_language) != _result THEN + RAISE EXCEPTION 'Test failed for input %: Expected % but got %', _language, _result, vibetype.language_iso_full_text_search(lang_code); END IF; END LOOP; END $$; @@ -38,7 +38,7 @@ ROLLBACK TO SAVEPOINT success; SAVEPOINT strict; DO $$ BEGIN - IF maevsi.language_iso_full_text_search(NULL::maevsi.language) IS NULL THEN + IF vibetype.language_iso_full_text_search(NULL::vibetype.language) IS NULL THEN RAISE EXCEPTION 'Test failed for NULL input. Did not expect to get NULL.'; END IF; END $$; @@ -48,7 +48,7 @@ SAVEPOINT invalid; DO $$ BEGIN BEGIN - PERFORM maevsi.language_iso_full_text_search('invalid'::maevsi.language); + PERFORM vibetype.language_iso_full_text_search('invalid'::vibetype.language); EXCEPTION WHEN OTHERS THEN RETURN; diff --git a/src/verify/function_notification_acknowledge.sql b/src/verify/function_notification_acknowledge.sql index dd365c0d..01256373 100644 --- a/src/verify/function_notification_acknowledge.sql +++ b/src/verify/function_notification_acknowledge.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.notification_acknowledge(UUID, BOOLEAN)', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.notification_acknowledge(UUID, BOOLEAN)', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.notification_acknowledge(UUID, BOOLEAN)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.notification_acknowledge(UUID, BOOLEAN)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_profile_picture_set.sql b/src/verify/function_profile_picture_set.sql index 2092532c..5ed61ccb 100644 --- a/src/verify/function_profile_picture_set.sql +++ b/src/verify/function_profile_picture_set.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.profile_picture_set(UUID)', 'EXECUTE')); - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.profile_picture_set(UUID)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.profile_picture_set(UUID)', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.profile_picture_set(UUID)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_trigger_metadata_update.sql b/src/verify/function_trigger_metadata_update.sql index 80684c35..9002330d 100644 --- a/src/verify/function_trigger_metadata_update.sql +++ b/src/verify/function_trigger_metadata_update.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.trigger_metadata_update()', 'EXECUTE')); - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.trigger_metadata_update()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.trigger_metadata_update()', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.trigger_metadata_update()', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/function_upload_create.sql b/src/verify/function_upload_create.sql index c2d531d3..b7844dbd 100644 --- a/src/verify/function_upload_create.sql +++ b/src/verify/function_upload_create.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.upload_create(BIGINT)', 'EXECUTE')); - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.upload_create(BIGINT)', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.upload_create(BIGINT)', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.upload_create(BIGINT)', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/index_account_private_location.sql b/src/verify/index_account_private_location.sql index 16c05d09..7d5a4d50 100644 --- a/src/verify/index_account_private_location.sql +++ b/src/verify/index_account_private_location.sql @@ -4,6 +4,6 @@ SELECT 1/COUNT(*) FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relname = 'idx_account_private_location' -AND n.nspname = 'maevsi_private'; +AND n.nspname = 'vibetype_private'; ROLLBACK; diff --git a/src/verify/index_event_creator_username.sql b/src/verify/index_event_creator_username.sql index 3086846d..53d266bf 100644 --- a/src/verify/index_event_creator_username.sql +++ b/src/verify/index_event_creator_username.sql @@ -4,6 +4,6 @@ SELECT 1/COUNT(*) FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relname = 'idx_event_created_by' -AND n.nspname = 'maevsi'; +AND n.nspname = 'vibetype'; ROLLBACK; diff --git a/src/verify/index_event_group_creator_username.sql b/src/verify/index_event_group_creator_username.sql index 440577c9..5aff324b 100644 --- a/src/verify/index_event_group_creator_username.sql +++ b/src/verify/index_event_group_creator_username.sql @@ -4,6 +4,6 @@ SELECT 1/COUNT(*) FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relname = 'idx_event_group_created_by' -AND n.nspname = 'maevsi'; +AND n.nspname = 'vibetype'; ROLLBACK; diff --git a/src/verify/index_event_grouping_event_group_id.sql b/src/verify/index_event_grouping_event_group_id.sql index 83673658..e95b33dc 100644 --- a/src/verify/index_event_grouping_event_group_id.sql +++ b/src/verify/index_event_grouping_event_group_id.sql @@ -4,6 +4,6 @@ SELECT 1/COUNT(*) FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relname = 'idx_event_grouping_event_group_id' -AND n.nspname = 'maevsi'; +AND n.nspname = 'vibetype'; ROLLBACK; diff --git a/src/verify/index_event_grouping_event_id.sql b/src/verify/index_event_grouping_event_id.sql index cc2fea40..054295f5 100644 --- a/src/verify/index_event_grouping_event_id.sql +++ b/src/verify/index_event_grouping_event_id.sql @@ -4,6 +4,6 @@ SELECT 1/COUNT(*) FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relname = 'idx_event_grouping_event_id' -AND n.nspname = 'maevsi'; +AND n.nspname = 'vibetype'; ROLLBACK; diff --git a/src/verify/index_event_location.sql b/src/verify/index_event_location.sql index 90251554..db99af7e 100644 --- a/src/verify/index_event_location.sql +++ b/src/verify/index_event_location.sql @@ -4,6 +4,6 @@ SELECT 1/COUNT(*) FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relname = 'idx_event_location' -AND n.nspname = 'maevsi'; +AND n.nspname = 'vibetype'; ROLLBACK; diff --git a/src/verify/index_guest_contact_id.sql b/src/verify/index_guest_contact_id.sql index 213cb945..1f8ad2a2 100644 --- a/src/verify/index_guest_contact_id.sql +++ b/src/verify/index_guest_contact_id.sql @@ -4,6 +4,6 @@ SELECT 1/COUNT(*) FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relname = 'idx_guest_contact_id' -AND n.nspname = 'maevsi'; +AND n.nspname = 'vibetype'; ROLLBACK; diff --git a/src/verify/index_guest_event_id.sql b/src/verify/index_guest_event_id.sql index ee3e5053..5f3b3755 100644 --- a/src/verify/index_guest_event_id.sql +++ b/src/verify/index_guest_event_id.sql @@ -4,6 +4,6 @@ SELECT 1/COUNT(*) FROM pg_class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.relname = 'idx_guest_event_id' -AND n.nspname = 'maevsi'; +AND n.nspname = 'vibetype'; ROLLBACK; diff --git a/src/verify/privilege_execute_revoke.sql b/src/verify/privilege_execute_revoke.sql index 6d177a04..81477194 100644 --- a/src/verify/privilege_execute_revoke.sql +++ b/src/verify/privilege_execute_revoke.sql @@ -1,5 +1,5 @@ BEGIN; --- TODO: Add verifications here (https://github.com/maevsi/sqitch/issues/22) +-- TODO: Add verifications here (https://github.com/vibetype/sqitch/issues/22) ROLLBACK; diff --git a/src/verify/role_account.sql b/src/verify/role_account.sql index ab7f3703..1186bc87 100644 --- a/src/verify/role_account.sql +++ b/src/verify/role_account.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.pg_has_role('maevsi_postgraphile', 'maevsi_account', 'USAGE')); + ASSERT (SELECT pg_catalog.pg_has_role('vibetype_postgraphile', 'vibetype_account', 'USAGE')); -- Other accounts might not exist yet for a NOT-check. END $$; diff --git a/src/verify/role_anonymous.sql b/src/verify/role_anonymous.sql index d0761647..772e3160 100644 --- a/src/verify/role_anonymous.sql +++ b/src/verify/role_anonymous.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.pg_has_role('maevsi_postgraphile', 'maevsi_anonymous', 'USAGE')); + ASSERT (SELECT pg_catalog.pg_has_role('vibetype_postgraphile', 'vibetype_anonymous', 'USAGE')); -- Other accounts might not exist yet for a NOT-check. END $$; diff --git a/src/verify/role_postgraphile.sql b/src/verify/role_postgraphile.sql index 37885e49..568da6e4 100644 --- a/src/verify/role_postgraphile.sql +++ b/src/verify/role_postgraphile.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.pg_has_role('maevsi_postgraphile', 'USAGE')); + ASSERT (SELECT pg_catalog.pg_has_role('vibetype_postgraphile', 'USAGE')); -- Other accounts might not exist yet for a NOT-check. END $$; diff --git a/src/verify/role_tusd.sql b/src/verify/role_tusd.sql index 9fbd834a..c494cd56 100644 --- a/src/verify/role_tusd.sql +++ b/src/verify/role_tusd.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.pg_has_role('maevsi_tusd', 'USAGE')); + ASSERT (SELECT pg_catalog.pg_has_role('vibetype_tusd', 'USAGE')); -- Other accounts might not exist yet for a NOT-check. END $$; diff --git a/src/verify/schema_private.sql b/src/verify/schema_private.sql index be764224..2ab15dc8 100644 --- a/src/verify/schema_private.sql +++ b/src/verify/schema_private.sql @@ -2,8 +2,8 @@ BEGIN; DO $$ BEGIN - ASSERT NOT (SELECT pg_catalog.has_schema_privilege('maevsi_account', 'maevsi_private', 'USAGE')); - ASSERT NOT (SELECT pg_catalog.has_schema_privilege('maevsi_anonymous', 'maevsi_private', 'USAGE')); + ASSERT NOT (SELECT pg_catalog.has_schema_privilege('vibetype_account', 'vibetype_private', 'USAGE')); + ASSERT NOT (SELECT pg_catalog.has_schema_privilege('vibetype_anonymous', 'vibetype_private', 'USAGE')); END $$; ROLLBACK; diff --git a/src/verify/schema_public.sql b/src/verify/schema_public.sql index e9f2ef69..4c0b7988 100644 --- a/src/verify/schema_public.sql +++ b/src/verify/schema_public.sql @@ -2,9 +2,9 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_schema_privilege('maevsi_account', 'maevsi', 'USAGE')); - ASSERT (SELECT pg_catalog.has_schema_privilege('maevsi_anonymous', 'maevsi', 'USAGE')); - ASSERT (SELECT pg_catalog.has_schema_privilege('maevsi_tusd', 'maevsi', 'USAGE')); + ASSERT (SELECT pg_catalog.has_schema_privilege('vibetype_account', 'vibetype', 'USAGE')); + ASSERT (SELECT pg_catalog.has_schema_privilege('vibetype_anonymous', 'vibetype', 'USAGE')); + ASSERT (SELECT pg_catalog.has_schema_privilege('vibetype_tusd', 'vibetype', 'USAGE')); END $$; ROLLBACK; diff --git a/src/verify/schema_test.sql b/src/verify/schema_test.sql index 9116971a..fa7554b5 100644 --- a/src/verify/schema_test.sql +++ b/src/verify/schema_test.sql @@ -2,13 +2,13 @@ BEGIN; DO $$ BEGIN - ASSERT EXISTS(SELECT * FROM pg_catalog.pg_namespace WHERE nspname = 'maevsi_test'); + ASSERT EXISTS(SELECT * FROM pg_catalog.pg_namespace WHERE nspname = 'vibetype_test'); END $$; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_schema_privilege('maevsi_account', 'maevsi_test', 'USAGE')); - ASSERT (SELECT pg_catalog.has_schema_privilege('maevsi_anonymous', 'maevsi_test', 'USAGE')); + ASSERT (SELECT pg_catalog.has_schema_privilege('vibetype_account', 'vibetype_test', 'USAGE')); + ASSERT (SELECT pg_catalog.has_schema_privilege('vibetype_anonymous', 'vibetype_test', 'USAGE')); END $$; ROLLBACK; diff --git a/src/verify/table_account_block.sql b/src/verify/table_account_block.sql index 3bba88f7..b84fd212 100644 --- a/src/verify/table_account_block.sql +++ b/src/verify/table_account_block.sql @@ -4,6 +4,6 @@ SELECT id, blocked_account_id, created_at, created_by -FROM maevsi.account_block WHERE FALSE; +FROM vibetype.account_block WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_account_block_policy.sql b/src/verify/table_account_block_policy.sql index d0f8e224..212fad54 100644 --- a/src/verify/table_account_block_policy.sql +++ b/src/verify/table_account_block_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account_block', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account_block', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account_block', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account_block', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account_block', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account_block', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account_block', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account_block', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account_block', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account_block', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account_block', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account_block', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account_block', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account_block', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account_block', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account_block', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account_block', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account_block', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account_block', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account_block', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account_block', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account_block', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account_block', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account_block', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_account_interest.sql b/src/verify/table_account_interest.sql index 12c34884..ea5fd9da 100644 --- a/src/verify/table_account_interest.sql +++ b/src/verify/table_account_interest.sql @@ -2,6 +2,6 @@ BEGIN; SELECT account_id, category -FROM maevsi.account_interest WHERE FALSE; +FROM vibetype.account_interest WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_account_interest_policy.sql b/src/verify/table_account_interest_policy.sql index 7aef5fd4..cd77f489 100644 --- a/src/verify/table_account_interest_policy.sql +++ b/src/verify/table_account_interest_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account_interest', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account_interest', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account_interest', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account_interest', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account_interest', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account_interest', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account_interest', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account_interest', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account_interest', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account_interest', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account_interest', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account_interest', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account_interest', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account_interest', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account_interest', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account_interest', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account_interest', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account_interest', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account_interest', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account_interest', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account_interest', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account_interest', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account_interest', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account_interest', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_account_preference_event_size.sql b/src/verify/table_account_preference_event_size.sql index cecec1b7..99760a15 100644 --- a/src/verify/table_account_preference_event_size.sql +++ b/src/verify/table_account_preference_event_size.sql @@ -3,6 +3,6 @@ BEGIN; SELECT account_id, event_size, created_at -FROM maevsi.account_preference_event_size WHERE FALSE; +FROM vibetype.account_preference_event_size WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_account_preference_event_size_policy.sql b/src/verify/table_account_preference_event_size_policy.sql index a4ad4882..9b59968e 100644 --- a/src/verify/table_account_preference_event_size_policy.sql +++ b/src/verify/table_account_preference_event_size_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account_preference_event_size', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account_preference_event_size', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account_preference_event_size', 'UPDATE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account_preference_event_size', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account_preference_event_size', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account_preference_event_size', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account_preference_event_size', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account_preference_event_size', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account_preference_event_size', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account_preference_event_size', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account_preference_event_size', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account_preference_event_size', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account_preference_event_size', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account_preference_event_size', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account_preference_event_size', 'UPDATE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account_preference_event_size', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account_preference_event_size', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account_preference_event_size', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account_preference_event_size', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account_preference_event_size', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account_preference_event_size', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account_preference_event_size', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account_preference_event_size', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account_preference_event_size', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_account_private.sql b/src/verify/table_account_private.sql index e3a6ddbc..3181e8af 100644 --- a/src/verify/table_account_private.sql +++ b/src/verify/table_account_private.sql @@ -12,28 +12,28 @@ SELECT id, upload_quota_bytes, created_at, last_activity -FROM maevsi_private.account WHERE FALSE; +FROM vibetype_private.account WHERE FALSE; DO $$ BEGIN - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi_private.account', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi_private.account', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi_private.account', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi_private.account', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi_private.account', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi_private.account', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi_private.account', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi_private.account', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi_private.account', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi_private.account', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi_private.account', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi_private.account', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype_private.account', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype_private.account', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype_private.account', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype_private.account', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype_private.account', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype_private.account', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype_private.account', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype_private.account', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype_private.account', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype_private.account', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype_private.account', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype_private.account', 'DELETE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi_private.account_email_address_verification_valid_until()', 'EXECUTE')); - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi_private.account_email_address_verification_valid_until()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype_private.account_email_address_verification_valid_until()', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype_private.account_email_address_verification_valid_until()', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi_private.account_password_reset_verification_valid_until()', 'EXECUTE')); - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi_private.account_password_reset_verification_valid_until()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype_private.account_password_reset_verification_valid_until()', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype_private.account_password_reset_verification_valid_until()', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/table_account_public.sql b/src/verify/table_account_public.sql index 4ea4c773..7cbe03df 100644 --- a/src/verify/table_account_public.sql +++ b/src/verify/table_account_public.sql @@ -2,22 +2,22 @@ BEGIN; SELECT id, username -FROM maevsi.account WHERE FALSE; +FROM vibetype.account WHERE FALSE; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.account', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.account', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.account', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.account', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.account', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.account', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_account_social_network.sql b/src/verify/table_account_social_network.sql index eab2abfe..1ddbf6db 100644 --- a/src/verify/table_account_social_network.sql +++ b/src/verify/table_account_social_network.sql @@ -4,6 +4,6 @@ SELECT account_id, social_network social_network_username -FROM maevsi.account_social_network WHERE FALSE; +FROM vibetype.account_social_network WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_account_social_network_policy.sql b/src/verify/table_account_social_network_policy.sql index ee3dcd90..04699f76 100644 --- a/src/verify/table_account_social_network_policy.sql +++ b/src/verify/table_account_social_network_policy.sql @@ -3,28 +3,28 @@ BEGIN; SAVEPOINT select_account; DO $$ BEGIN - SET LOCAL role TO maevsi_account; - PERFORM * FROM maevsi.account_social_network; + SET LOCAL role TO vibetype_account; + PERFORM * FROM vibetype.account_social_network; END $$; ROLLBACK TO SAVEPOINT select_account; SAVEPOINT select_anonymous; DO $$ BEGIN - SET LOCAL role TO maevsi_anonymous; - PERFORM * FROM maevsi.account_social_network; + SET LOCAL role TO vibetype_anonymous; + PERFORM * FROM vibetype.account_social_network; END $$; ROLLBACK TO SAVEPOINT select_anonymous; SAVEPOINT insert_account; DO $$ BEGIN - INSERT INTO maevsi_private.account(id, email_address, password_hash) VALUES ('00000000-0000-0000-0000-000000000000', 'email@example.com', '$2a$06$xdJFoht/HQ/4798obSknNOc6hiBe60HXriyW/Oa3Ch7Oo3F.9WGLe'); - INSERT INTO maevsi.account(id, username) VALUES ('00000000-0000-0000-0000-000000000000', 'username'); + INSERT INTO vibetype_private.account(id, email_address, password_hash) VALUES ('00000000-0000-0000-0000-000000000000', 'email@example.com', '$2a$06$xdJFoht/HQ/4798obSknNOc6hiBe60HXriyW/Oa3Ch7Oo3F.9WGLe'); + INSERT INTO vibetype.account(id, username) VALUES ('00000000-0000-0000-0000-000000000000', 'username'); - SET LOCAL role TO maevsi_account; + SET LOCAL role TO vibetype_account; SET LOCAL jwt.claims.account_id TO '00000000-0000-0000-0000-000000000000'; - INSERT INTO maevsi.account_social_network(account_id, social_network, social_network_username) + INSERT INTO vibetype.account_social_network(account_id, social_network, social_network_username) VALUES ('00000000-0000-0000-0000-000000000000', 'instagram', 'username'); END $$; ROLLBACK TO SAVEPOINT insert_account; @@ -32,11 +32,11 @@ ROLLBACK TO SAVEPOINT insert_account; SAVEPOINT insert_anonymous; DO $$ BEGIN - INSERT INTO maevsi_private.account(id, email_address, password_hash) VALUES ('00000000-0000-0000-0000-000000000000', 'email@example.com', '$2a$06$xdJFoht/HQ/4798obSknNOc6hiBe60HXriyW/Oa3Ch7Oo3F.9WGLe'); - INSERT INTO maevsi.account(id, username) VALUES ('00000000-0000-0000-0000-000000000000', 'username'); + INSERT INTO vibetype_private.account(id, email_address, password_hash) VALUES ('00000000-0000-0000-0000-000000000000', 'email@example.com', '$2a$06$xdJFoht/HQ/4798obSknNOc6hiBe60HXriyW/Oa3Ch7Oo3F.9WGLe'); + INSERT INTO vibetype.account(id, username) VALUES ('00000000-0000-0000-0000-000000000000', 'username'); - SET LOCAL role TO maevsi_anonymous; - INSERT INTO maevsi.account_social_network(account_id, social_network, social_network_username) + SET LOCAL role TO vibetype_anonymous; + INSERT INTO vibetype.account_social_network(account_id, social_network, social_network_username) VALUES ('00000000-0000-0000-0000-000000000000', 'instagram', 'username'); RAISE EXCEPTION 'Test insert_anonymous failed: Anonymous users should not be able to insert'; EXCEPTION WHEN others THEN @@ -47,24 +47,24 @@ ROLLBACK TO SAVEPOINT insert_anonymous; SAVEPOINT update_account; DO $$ BEGIN - INSERT INTO maevsi_private.account(id, email_address, password_hash) VALUES ('00000000-0000-0000-0000-000000000000', 'email@example.com', '$2a$06$xdJFoht/HQ/4798obSknNOc6hiBe60HXriyW/Oa3Ch7Oo3F.9WGLe'); - INSERT INTO maevsi.account(id, username) VALUES ('00000000-0000-0000-0000-000000000000', 'username'); - INSERT INTO maevsi.account_social_network(account_id, social_network, social_network_username) VALUES ('00000000-0000-0000-0000-000000000000', 'instagram', 'username'); + INSERT INTO vibetype_private.account(id, email_address, password_hash) VALUES ('00000000-0000-0000-0000-000000000000', 'email@example.com', '$2a$06$xdJFoht/HQ/4798obSknNOc6hiBe60HXriyW/Oa3Ch7Oo3F.9WGLe'); + INSERT INTO vibetype.account(id, username) VALUES ('00000000-0000-0000-0000-000000000000', 'username'); + INSERT INTO vibetype.account_social_network(account_id, social_network, social_network_username) VALUES ('00000000-0000-0000-0000-000000000000', 'instagram', 'username'); - SET LOCAL role TO maevsi_account; - UPDATE maevsi.account_social_network SET social_network_username = 'username-updated'; + SET LOCAL role TO vibetype_account; + UPDATE vibetype.account_social_network SET social_network_username = 'username-updated'; END $$; ROLLBACK TO SAVEPOINT update_account; SAVEPOINT update_anonymous; DO $$ BEGIN - INSERT INTO maevsi_private.account(id, email_address, password_hash) VALUES ('00000000-0000-0000-0000-000000000000', 'email@example.com', '$2a$06$xdJFoht/HQ/4798obSknNOc6hiBe60HXriyW/Oa3Ch7Oo3F.9WGLe'); - INSERT INTO maevsi.account(id, username) VALUES ('00000000-0000-0000-0000-000000000000', 'username'); - INSERT INTO maevsi.account_social_network(account_id, social_network, social_network_username) VALUES ('00000000-0000-0000-0000-000000000000', 'instagram', 'username'); + INSERT INTO vibetype_private.account(id, email_address, password_hash) VALUES ('00000000-0000-0000-0000-000000000000', 'email@example.com', '$2a$06$xdJFoht/HQ/4798obSknNOc6hiBe60HXriyW/Oa3Ch7Oo3F.9WGLe'); + INSERT INTO vibetype.account(id, username) VALUES ('00000000-0000-0000-0000-000000000000', 'username'); + INSERT INTO vibetype.account_social_network(account_id, social_network, social_network_username) VALUES ('00000000-0000-0000-0000-000000000000', 'instagram', 'username'); - SET LOCAL role TO maevsi_anonymous; - UPDATE maevsi.account_social_network SET social_network_username = 'username-updated'; + SET LOCAL role TO vibetype_anonymous; + UPDATE vibetype.account_social_network SET social_network_username = 'username-updated'; RAISE EXCEPTION 'Test update_anonymous failed: Anonymous users should not be able to update'; EXCEPTION WHEN others THEN NULL; @@ -74,24 +74,24 @@ ROLLBACK TO SAVEPOINT update_anonymous; SAVEPOINT delete_account; DO $$ BEGIN - INSERT INTO maevsi_private.account(id, email_address, password_hash) VALUES ('00000000-0000-0000-0000-000000000000', 'email@example.com', '$2a$06$xdJFoht/HQ/4798obSknNOc6hiBe60HXriyW/Oa3Ch7Oo3F.9WGLe'); - INSERT INTO maevsi.account(id, username) VALUES ('00000000-0000-0000-0000-000000000000', 'username'); - INSERT INTO maevsi.account_social_network(account_id, social_network, social_network_username) VALUES ('00000000-0000-0000-0000-000000000000', 'instagram', 'username'); + INSERT INTO vibetype_private.account(id, email_address, password_hash) VALUES ('00000000-0000-0000-0000-000000000000', 'email@example.com', '$2a$06$xdJFoht/HQ/4798obSknNOc6hiBe60HXriyW/Oa3Ch7Oo3F.9WGLe'); + INSERT INTO vibetype.account(id, username) VALUES ('00000000-0000-0000-0000-000000000000', 'username'); + INSERT INTO vibetype.account_social_network(account_id, social_network, social_network_username) VALUES ('00000000-0000-0000-0000-000000000000', 'instagram', 'username'); - SET LOCAL role TO maevsi_account; - DELETE FROM maevsi.account_social_network; + SET LOCAL role TO vibetype_account; + DELETE FROM vibetype.account_social_network; END $$; ROLLBACK TO SAVEPOINT delete_account; SAVEPOINT delete_anonymous; DO $$ BEGIN - INSERT INTO maevsi_private.account(id, email_address, password_hash) VALUES ('00000000-0000-0000-0000-000000000000', 'email@example.com', '$2a$06$xdJFoht/HQ/4798obSknNOc6hiBe60HXriyW/Oa3Ch7Oo3F.9WGLe'); - INSERT INTO maevsi.account(id, username) VALUES ('00000000-0000-0000-0000-000000000000', 'username'); - INSERT INTO maevsi.account_social_network(account_id, social_network, social_network_username) VALUES ('00000000-0000-0000-0000-000000000000', 'instagram', 'username'); + INSERT INTO vibetype_private.account(id, email_address, password_hash) VALUES ('00000000-0000-0000-0000-000000000000', 'email@example.com', '$2a$06$xdJFoht/HQ/4798obSknNOc6hiBe60HXriyW/Oa3Ch7Oo3F.9WGLe'); + INSERT INTO vibetype.account(id, username) VALUES ('00000000-0000-0000-0000-000000000000', 'username'); + INSERT INTO vibetype.account_social_network(account_id, social_network, social_network_username) VALUES ('00000000-0000-0000-0000-000000000000', 'instagram', 'username'); - SET LOCAL role TO maevsi_anonymous; - DELETE FROM maevsi.account_social_network; + SET LOCAL role TO vibetype_anonymous; + DELETE FROM vibetype.account_social_network; RAISE EXCEPTION 'Test delete_anonymous failed: Anonymous users should not be able to delete'; EXCEPTION WHEN others THEN NULL; diff --git a/src/verify/table_achievement.sql b/src/verify/table_achievement.sql index d43b5e0f..e07f5ee0 100644 --- a/src/verify/table_achievement.sql +++ b/src/verify/table_achievement.sql @@ -4,22 +4,22 @@ SELECT id, account_id, achievement, level -FROM maevsi.achievement WHERE FALSE; +FROM vibetype.achievement WHERE FALSE; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.achievement', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.achievement', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.achievement', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.achievement', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.achievement', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.achievement', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.achievement', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.achievement', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.achievement', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.achievement', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.achievement', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.achievement', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.achievement', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.achievement', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.achievement', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.achievement', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.achievement', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.achievement', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.achievement', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.achievement', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.achievement', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.achievement', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.achievement', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.achievement', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_achievement_code.sql b/src/verify/table_achievement_code.sql index 2e513b89..157c3405 100644 --- a/src/verify/table_achievement_code.sql +++ b/src/verify/table_achievement_code.sql @@ -3,22 +3,22 @@ BEGIN; SELECT id, alias, achievement -FROM maevsi_private.achievement_code WHERE FALSE; +FROM vibetype_private.achievement_code WHERE FALSE; DO $$ BEGIN - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi_private.achievement_code', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi_private.achievement_code', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi_private.achievement_code', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi_private.achievement_code', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi_private.achievement_code', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi_private.achievement_code', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi_private.achievement_code', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi_private.achievement_code', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi_private.achievement_code', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi_private.achievement_code', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi_private.achievement_code', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi_private.achievement_code', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype_private.achievement_code', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype_private.achievement_code', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype_private.achievement_code', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype_private.achievement_code', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype_private.achievement_code', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype_private.achievement_code', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype_private.achievement_code', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype_private.achievement_code', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype_private.achievement_code', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype_private.achievement_code', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype_private.achievement_code', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype_private.achievement_code', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_address.sql b/src/verify/table_address.sql index 50ddf740..e00d5ae2 100644 --- a/src/verify/table_address.sql +++ b/src/verify/table_address.sql @@ -12,6 +12,6 @@ SELECT id, created_by, updated_at, updated_by -FROM maevsi.address WHERE FALSE; +FROM vibetype.address WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_address_policy.sql b/src/verify/table_address_policy.sql index cc35076b..2cd6e286 100644 --- a/src/verify/table_address_policy.sql +++ b/src/verify/table_address_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.address', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.address', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.address', 'UPDATE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.address', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.address', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.address', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.address', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.address', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.address', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.address', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.address', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.address', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.address', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.address', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.address', 'UPDATE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.address', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.address', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.address', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.address', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.address', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.address', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.address', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.address', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.address', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_contact.sql b/src/verify/table_contact.sql index 530cc939..3630ff00 100644 --- a/src/verify/table_contact.sql +++ b/src/verify/table_contact.sql @@ -15,6 +15,6 @@ SELECT id, url, created_at, created_by -FROM maevsi.contact WHERE FALSE; +FROM vibetype.contact WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_contact_policy.sql b/src/verify/table_contact_policy.sql index 774dedca..b5024758 100644 --- a/src/verify/table_contact_policy.sql +++ b/src/verify/table_contact_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.contact', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.contact', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.contact', 'UPDATE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.contact', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.contact', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.contact', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.contact', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.contact', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.contact', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.contact', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.contact', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.contact', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.contact', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.contact', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.contact', 'UPDATE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.contact', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.contact', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.contact', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.contact', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.contact', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.contact', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.contact', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.contact', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.contact', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_event.sql b/src/verify/table_event.sql index 5ba3228f..c2a8c987 100644 --- a/src/verify/table_event.sql +++ b/src/verify/table_event.sql @@ -18,6 +18,6 @@ SELECT id, created_at, created_by, search_vector -FROM maevsi.event WHERE FALSE; +FROM vibetype.event WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_event_category.sql b/src/verify/table_event_category.sql index 8d180230..6b5a6ac7 100644 --- a/src/verify/table_event_category.sql +++ b/src/verify/table_event_category.sql @@ -1,6 +1,6 @@ BEGIN; SELECT category -FROM maevsi.event_category WHERE FALSE; +FROM vibetype.event_category WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_event_category_mapping.sql b/src/verify/table_event_category_mapping.sql index e8955543..f5be6eb8 100644 --- a/src/verify/table_event_category_mapping.sql +++ b/src/verify/table_event_category_mapping.sql @@ -2,6 +2,6 @@ BEGIN; SELECT event_id, category -FROM maevsi.event_category_mapping WHERE FALSE; +FROM vibetype.event_category_mapping WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_event_category_mapping_policy.sql b/src/verify/table_event_category_mapping_policy.sql index 297d538f..86332cce 100644 --- a/src/verify/table_event_category_mapping_policy.sql +++ b/src/verify/table_event_category_mapping_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_category_mapping', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_category_mapping', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_category_mapping', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_category_mapping', 'UPDATE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_category_mapping', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_category_mapping', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_category_mapping', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_category_mapping', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_category_mapping', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_category_mapping', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_category_mapping', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_category_mapping', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_category_mapping', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_category_mapping', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_category_mapping', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_category_mapping', 'UPDATE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_category_mapping', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_category_mapping', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_category_mapping', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_category_mapping', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_category_mapping', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_category_mapping', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_category_mapping', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_category_mapping', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_event_category_policy.sql b/src/verify/table_event_category_policy.sql index c2c8fa67..5b9abf7e 100644 --- a/src/verify/table_event_category_policy.sql +++ b/src/verify/table_event_category_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_category', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_category', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_category', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_category', 'UPDATE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_category', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_category', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_category', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_category', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_category', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_category', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_category', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_category', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_category', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_category', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_category', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_category', 'UPDATE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_category', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_category', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_category', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_category', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_category', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_category', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_category', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_category', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_event_favorite.sql b/src/verify/table_event_favorite.sql index ea8cbfab..882ffd4e 100644 --- a/src/verify/table_event_favorite.sql +++ b/src/verify/table_event_favorite.sql @@ -4,6 +4,6 @@ SELECT id, event_id, created_at, created_by -FROM maevsi.event_favorite WHERE FALSE; +FROM vibetype.event_favorite WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_event_favorite_policy.sql b/src/verify/table_event_favorite_policy.sql index 5f164c5a..c37cfb8d 100644 --- a/src/verify/table_event_favorite_policy.sql +++ b/src/verify/table_event_favorite_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_favorite', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_favorite', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_favorite', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_favorite', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_favorite', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_favorite', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_favorite', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_favorite', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_favorite', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_favorite', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_favorite', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_favorite', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_favorite', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_favorite', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_favorite', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_favorite', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_favorite', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_favorite', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_favorite', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_favorite', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_favorite', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_favorite', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_favorite', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_favorite', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_event_group.sql b/src/verify/table_event_group.sql index 1f06d0d6..46653bfc 100644 --- a/src/verify/table_event_group.sql +++ b/src/verify/table_event_group.sql @@ -7,22 +7,22 @@ SELECT id, slug, created_at, created_by -FROM maevsi.event_group WHERE FALSE; +FROM vibetype.event_group WHERE FALSE; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_group', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_group', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_group', 'UPDATE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_group', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_group', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_group', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_group', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_group', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_group', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_group', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_group', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_group', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_group', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_group', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_group', 'UPDATE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_group', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_group', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_group', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_group', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_group', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_group', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_group', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_group', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_group', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_event_grouping.sql b/src/verify/table_event_grouping.sql index ea13c2ca..79f43bfe 100644 --- a/src/verify/table_event_grouping.sql +++ b/src/verify/table_event_grouping.sql @@ -3,22 +3,22 @@ BEGIN; SELECT id, event_group_id, event_id -FROM maevsi.event_grouping WHERE FALSE; +FROM vibetype.event_grouping WHERE FALSE; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_grouping', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_grouping', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_grouping', 'UPDATE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_grouping', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_grouping', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_grouping', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_grouping', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_grouping', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_grouping', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_grouping', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_grouping', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_grouping', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_grouping', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_grouping', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_grouping', 'UPDATE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_grouping', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_grouping', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_grouping', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_grouping', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_grouping', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_grouping', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_grouping', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_grouping', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_grouping', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_event_policy.sql b/src/verify/table_event_policy.sql index 28c83f1d..0bd733b5 100644 --- a/src/verify/table_event_policy.sql +++ b/src/verify/table_event_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event', 'UPDATE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event', 'UPDATE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_event_recommendation.sql b/src/verify/table_event_recommendation.sql index 12516886..69970521 100644 --- a/src/verify/table_event_recommendation.sql +++ b/src/verify/table_event_recommendation.sql @@ -4,6 +4,6 @@ SELECT account_id, event_id, score, predicted_score -FROM maevsi.event_recommendation WHERE FALSE; +FROM vibetype.event_recommendation WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_event_recommendation_policy.sql b/src/verify/table_event_recommendation_policy.sql index 29a6ecc4..1c5da652 100644 --- a/src/verify/table_event_recommendation_policy.sql +++ b/src/verify/table_event_recommendation_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_recommendation', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_recommendation', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_recommendation', 'DELETE')); - ASSERT NOT(SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_recommendation', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_recommendation', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_recommendation', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_recommendation', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_recommendation', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_recommendation', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_recommendation', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_recommendation', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_recommendation', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_recommendation', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_recommendation', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_recommendation', 'DELETE')); + ASSERT NOT(SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_recommendation', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_recommendation', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_recommendation', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_recommendation', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_recommendation', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_recommendation', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_recommendation', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_recommendation', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_recommendation', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_event_upload.sql b/src/verify/table_event_upload.sql index 8845a723..1d098bd6 100644 --- a/src/verify/table_event_upload.sql +++ b/src/verify/table_event_upload.sql @@ -3,4 +3,4 @@ BEGIN; SELECT id, event_id, upload_id -FROM maevsi.event_upload WHERE FALSE; +FROM vibetype.event_upload WHERE FALSE; diff --git a/src/verify/table_event_upload_policy.sql b/src/verify/table_event_upload_policy.sql index 3ee96242..2649bffa 100644 --- a/src/verify/table_event_upload_policy.sql +++ b/src/verify/table_event_upload_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_upload', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_upload', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_upload', 'UPDATE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.event_upload', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_upload', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_upload', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_upload', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.event_upload', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_upload', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_upload', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_upload', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.event_upload', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_upload', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_upload', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_upload', 'UPDATE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.event_upload', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_upload', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_upload', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_upload', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.event_upload', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_upload', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_upload', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_upload', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.event_upload', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_guest.sql b/src/verify/table_guest.sql index b48b11b8..a5442d89 100644 --- a/src/verify/table_guest.sql +++ b/src/verify/table_guest.sql @@ -7,6 +7,6 @@ SELECT id, created_at, updated_at, updated_by -FROM maevsi.guest WHERE FALSE; +FROM vibetype.guest WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_guest_policy.sql b/src/verify/table_guest_policy.sql index 7b31691e..ef832614 100644 --- a/src/verify/table_guest_policy.sql +++ b/src/verify/table_guest_policy.sql @@ -2,21 +2,21 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.guest', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.guest', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.guest', 'UPDATE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.guest', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.guest', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.guest', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.guest', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.guest', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.guest', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.guest', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.guest', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.guest', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.guest', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.guest', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.guest', 'UPDATE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.guest', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.guest', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.guest', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.guest', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.guest', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.guest', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.guest', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.guest', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.guest', 'DELETE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.trigger_guest_update()', 'EXECUTE')); - ASSERT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.trigger_guest_update()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.trigger_guest_update()', 'EXECUTE')); + ASSERT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.trigger_guest_update()', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/table_invitation_policy.sql b/src/verify/table_invitation_policy.sql index 8a4dc045..ac2bc75f 100644 --- a/src/verify/table_invitation_policy.sql +++ b/src/verify/table_invitation_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.invitation', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.invitation', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.invitation', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.invitation', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.invitation', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.invitation', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.invitation', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.invitation', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.invitation', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.invitation', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.invitation', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.invitation', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.invitation', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.invitation', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.invitation', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.invitation', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.invitation', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.invitation', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.invitation', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.invitation', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.invitation', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.invitation', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.invitation', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.invitation', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_jwt.sql b/src/verify/table_jwt.sql index 9c8c8ebc..85fc42b6 100644 --- a/src/verify/table_jwt.sql +++ b/src/verify/table_jwt.sql @@ -2,22 +2,22 @@ BEGIN; SELECT id, token -FROM maevsi_private.jwt WHERE FALSE; +FROM vibetype_private.jwt WHERE FALSE; DO $$ BEGIN - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi_private.jwt', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi_private.jwt', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi_private.jwt', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi_private.jwt', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi_private.jwt', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi_private.jwt', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi_private.jwt', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi_private.jwt', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi_private.jwt', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi_private.jwt', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi_private.jwt', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi_private.jwt', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype_private.jwt', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype_private.jwt', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype_private.jwt', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype_private.jwt', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype_private.jwt', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype_private.jwt', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype_private.jwt', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype_private.jwt', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype_private.jwt', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype_private.jwt', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype_private.jwt', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype_private.jwt', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_legal_term.sql b/src/verify/table_legal_term.sql index 73be5cb7..8f2c922d 100644 --- a/src/verify/table_legal_term.sql +++ b/src/verify/table_legal_term.sql @@ -5,25 +5,25 @@ SELECT id, term, version, created_at -FROM maevsi.legal_term WHERE FALSE; +FROM vibetype.legal_term WHERE FALSE; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.legal_term', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.legal_term', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.legal_term', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.legal_term', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.legal_term', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.legal_term', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.legal_term', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.legal_term', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.legal_term', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.legal_term', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.legal_term', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.legal_term', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.legal_term', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.legal_term', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.legal_term', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.legal_term', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.legal_term', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.legal_term', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.legal_term', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.legal_term', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.legal_term', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.legal_term', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.legal_term', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.legal_term', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_account', 'maevsi.legal_term_change()', 'EXECUTE')); - ASSERT NOT (SELECT pg_catalog.has_function_privilege('maevsi_anonymous', 'maevsi.legal_term_change()', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_account', 'vibetype.legal_term_change()', 'EXECUTE')); + ASSERT NOT (SELECT pg_catalog.has_function_privilege('vibetype_anonymous', 'vibetype.legal_term_change()', 'EXECUTE')); END $$; ROLLBACK; diff --git a/src/verify/table_legal_term_acceptance.sql b/src/verify/table_legal_term_acceptance.sql index f687829f..8e8ce7d0 100644 --- a/src/verify/table_legal_term_acceptance.sql +++ b/src/verify/table_legal_term_acceptance.sql @@ -4,22 +4,22 @@ SELECT id, account_id, legal_term_id, created_at -FROM maevsi.legal_term_acceptance WHERE FALSE; +FROM vibetype.legal_term_acceptance WHERE FALSE; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.legal_term_acceptance', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.legal_term_acceptance', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.legal_term_acceptance', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.legal_term_acceptance', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.legal_term_acceptance', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.legal_term_acceptance', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.legal_term_acceptance', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.legal_term_acceptance', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.legal_term_acceptance', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.legal_term_acceptance', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.legal_term_acceptance', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.legal_term_acceptance', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.legal_term_acceptance', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.legal_term_acceptance', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.legal_term_acceptance', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.legal_term_acceptance', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.legal_term_acceptance', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.legal_term_acceptance', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.legal_term_acceptance', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.legal_term_acceptance', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.legal_term_acceptance', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.legal_term_acceptance', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.legal_term_acceptance', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.legal_term_acceptance', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_notification.sql b/src/verify/table_notification.sql index cec9d675..8123fed8 100644 --- a/src/verify/table_notification.sql +++ b/src/verify/table_notification.sql @@ -5,6 +5,6 @@ SELECT id, is_acknowledged, payload, created_at -FROM maevsi.notification WHERE FALSE; +FROM vibetype.notification WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_profile_picture.sql b/src/verify/table_profile_picture.sql index e8cba816..6fee730d 100644 --- a/src/verify/table_profile_picture.sql +++ b/src/verify/table_profile_picture.sql @@ -3,22 +3,22 @@ BEGIN; SELECT id, account_id, upload_id -FROM maevsi.profile_picture WHERE FALSE; +FROM vibetype.profile_picture WHERE FALSE; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.profile_picture', 'SELECT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.profile_picture', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.profile_picture', 'UPDATE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.profile_picture', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.profile_picture', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.profile_picture', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.profile_picture', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.profile_picture', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.profile_picture', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.profile_picture', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.profile_picture', 'UPDATE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.profile_picture', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.profile_picture', 'SELECT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.profile_picture', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.profile_picture', 'UPDATE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.profile_picture', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.profile_picture', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.profile_picture', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.profile_picture', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.profile_picture', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.profile_picture', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.profile_picture', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.profile_picture', 'UPDATE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.profile_picture', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_report.sql b/src/verify/table_report.sql index 8702e541..7275de4e 100644 --- a/src/verify/table_report.sql +++ b/src/verify/table_report.sql @@ -7,6 +7,6 @@ SELECT id, target_upload_id, created_at, created_by -FROM maevsi.report WHERE FALSE; +FROM vibetype.report WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_report_policy.sql b/src/verify/table_report_policy.sql index bc124fa9..d4564ee2 100644 --- a/src/verify/table_report_policy.sql +++ b/src/verify/table_report_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.report', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.report', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.report', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.report', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.report', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.report', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.report', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.report', 'DELETE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.report', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.report', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.report', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.report', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.report', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.report', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.report', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.report', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.report', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.report', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.report', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.report', 'DELETE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.report', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.report', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.report', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.report', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/table_upload.sql b/src/verify/table_upload.sql index b0b017cc..ac319274 100644 --- a/src/verify/table_upload.sql +++ b/src/verify/table_upload.sql @@ -7,6 +7,6 @@ SELECT id, storage_key, type, created_at -FROM maevsi.upload WHERE FALSE; +FROM vibetype.upload WHERE FALSE; ROLLBACK; diff --git a/src/verify/table_upload_policy.sql b/src/verify/table_upload_policy.sql index 6d5fa077..af2490bc 100644 --- a/src/verify/table_upload_policy.sql +++ b/src/verify/table_upload_policy.sql @@ -2,18 +2,18 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.upload', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.upload', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.upload', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_account', 'maevsi.upload', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.upload', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.upload', 'INSERT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.upload', 'UPDATE')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_anonymous', 'maevsi.upload', 'DELETE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.upload', 'SELECT')); - ASSERT NOT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.upload', 'INSERT')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.upload', 'UPDATE')); - ASSERT (SELECT pg_catalog.has_table_privilege('maevsi_tusd', 'maevsi.upload', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.upload', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.upload', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.upload', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_account', 'vibetype.upload', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.upload', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.upload', 'INSERT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.upload', 'UPDATE')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_anonymous', 'vibetype.upload', 'DELETE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.upload', 'SELECT')); + ASSERT NOT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.upload', 'INSERT')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.upload', 'UPDATE')); + ASSERT (SELECT pg_catalog.has_table_privilege('vibetype_tusd', 'vibetype.upload', 'DELETE')); END $$; ROLLBACK; diff --git a/src/verify/test_account_blocking.sql b/src/verify/test_account_blocking.sql index 31a01473..b1ff793a 100644 --- a/src/verify/test_account_blocking.sql +++ b/src/verify/test_account_blocking.sql @@ -35,101 +35,101 @@ BEGIN -- remove accounts (if exist) - PERFORM maevsi_test.account_remove('a'); - PERFORM maevsi_test.account_remove('b'); - PERFORM maevsi_test.account_remove('c'); + PERFORM vibetype_test.account_remove('a'); + PERFORM vibetype_test.account_remove('b'); + PERFORM vibetype_test.account_remove('c'); -- fill with test data - accountA := maevsi_test.account_create('a', 'a@example.com'); - accountB := maevsi_test.account_create('b', 'b@example.com'); - accountC := maevsi_test.account_create('c', 'c@example.com'); - - contactAA := maevsi_test.contact_select_by_account_id(accountA); - contactBB := maevsi_test.contact_select_by_account_id(accountB); - contactCC := maevsi_test.contact_select_by_account_id(accountC); - - contactAB := maevsi_test.contact_create(accountA, 'b@example.com'); - contactAC := maevsi_test.contact_create(accountA, 'c@example.com'); - contactBA := maevsi_test.contact_create(accountB, 'a@example.com'); - contactBC := maevsi_test.contact_create(accountB, 'c@example.com'); - contactCA := maevsi_test.contact_create(accountC, 'a@example.com'); - contactCB := maevsi_test.contact_create(accountC, 'b@example.com'); - - eventA := maevsi_test.event_create(accountA, 'Event by A', 'event-by-a', '2025-06-01 20:00', 'public'); - eventB := maevsi_test.event_create(accountB, 'Event by B', 'event-by-b', '2025-06-01 20:00', 'public'); - eventC := maevsi_test.event_create(accountC, 'Event by C', 'event-by-c', '2025-06-01 20:00', 'public'); - - PERFORM maevsi_test.event_category_create('category'); - PERFORM maevsi_test.event_category_mapping_create(accountA, eventA, 'category'); - PERFORM maevsi_test.event_category_mapping_create(accountB, eventB, 'category'); - PERFORM maevsi_test.event_category_mapping_create(accountC, eventC, 'category'); - - guestAB := maevsi_test.guest_create(accountA, eventA, contactAB); - guestAC := maevsi_test.guest_create(accountA, eventA, contactAC); - guestBA := maevsi_test.guest_create(accountB, eventB, contactBA); - guestBC := maevsi_test.guest_create(accountB, eventB, contactBC); - guestCA := maevsi_test.guest_create(accountC, eventC, contactCA); - guestCB := maevsi_test.guest_create(accountC, eventC, contactCB); + accountA := vibetype_test.account_create('a', 'a@example.com'); + accountB := vibetype_test.account_create('b', 'b@example.com'); + accountC := vibetype_test.account_create('c', 'c@example.com'); + + contactAA := vibetype_test.contact_select_by_account_id(accountA); + contactBB := vibetype_test.contact_select_by_account_id(accountB); + contactCC := vibetype_test.contact_select_by_account_id(accountC); + + contactAB := vibetype_test.contact_create(accountA, 'b@example.com'); + contactAC := vibetype_test.contact_create(accountA, 'c@example.com'); + contactBA := vibetype_test.contact_create(accountB, 'a@example.com'); + contactBC := vibetype_test.contact_create(accountB, 'c@example.com'); + contactCA := vibetype_test.contact_create(accountC, 'a@example.com'); + contactCB := vibetype_test.contact_create(accountC, 'b@example.com'); + + eventA := vibetype_test.event_create(accountA, 'Event by A', 'event-by-a', '2025-06-01 20:00', 'public'); + eventB := vibetype_test.event_create(accountB, 'Event by B', 'event-by-b', '2025-06-01 20:00', 'public'); + eventC := vibetype_test.event_create(accountC, 'Event by C', 'event-by-c', '2025-06-01 20:00', 'public'); + + PERFORM vibetype_test.event_category_create('category'); + PERFORM vibetype_test.event_category_mapping_create(accountA, eventA, 'category'); + PERFORM vibetype_test.event_category_mapping_create(accountB, eventB, 'category'); + PERFORM vibetype_test.event_category_mapping_create(accountC, eventC, 'category'); + + guestAB := vibetype_test.guest_create(accountA, eventA, contactAB); + guestAC := vibetype_test.guest_create(accountA, eventA, contactAC); + guestBA := vibetype_test.guest_create(accountB, eventB, contactBA); + guestBC := vibetype_test.guest_create(accountB, eventB, contactBC); + guestCA := vibetype_test.guest_create(accountC, eventC, contactCA); + guestCB := vibetype_test.guest_create(accountC, eventC, contactCB); -- run tests - PERFORM maevsi_test.account_block_remove(accountA, accountB); - PERFORM maevsi_test.event_test('event: no blocking, perspective A', accountA, ARRAY[eventA, eventB, eventC]::UUID[]); - PERFORM maevsi_test.event_test('event: no blocking, perspective B', accountB, ARRAY[eventA, eventB, eventC]::UUID[]); + PERFORM vibetype_test.account_block_remove(accountA, accountB); + PERFORM vibetype_test.event_test('event: no blocking, perspective A', accountA, ARRAY[eventA, eventB, eventC]::UUID[]); + PERFORM vibetype_test.event_test('event: no blocking, perspective B', accountB, ARRAY[eventA, eventB, eventC]::UUID[]); - PERFORM maevsi_test.account_block_create(accountA, accountB); - PERFORM maevsi_test.event_test('event: A blocks B, perspective A', accountA, ARRAY[eventA, eventC]::UUID[]); - PERFORM maevsi_test.event_test('event: A blocks B, perspective B', accountB, ARRAY[eventB, eventC]::UUID[]); + PERFORM vibetype_test.account_block_create(accountA, accountB); + PERFORM vibetype_test.event_test('event: A blocks B, perspective A', accountA, ARRAY[eventA, eventC]::UUID[]); + PERFORM vibetype_test.event_test('event: A blocks B, perspective B', accountB, ARRAY[eventB, eventC]::UUID[]); - PERFORM maevsi_test.account_block_remove(accountA, accountB); - PERFORM maevsi_test.event_category_mapping_test('event_category_mapping: no blocking, perspective A', accountA, ARRAY[eventA, eventB, eventC]::UUID[]); - PERFORM maevsi_test.event_category_mapping_test('event_category_mapping: no blocking, perspective B', accountB, ARRAY[eventA, eventB, eventC]::UUID[]); + PERFORM vibetype_test.account_block_remove(accountA, accountB); + PERFORM vibetype_test.event_category_mapping_test('event_category_mapping: no blocking, perspective A', accountA, ARRAY[eventA, eventB, eventC]::UUID[]); + PERFORM vibetype_test.event_category_mapping_test('event_category_mapping: no blocking, perspective B', accountB, ARRAY[eventA, eventB, eventC]::UUID[]); - PERFORM maevsi_test.account_block_create(accountA, accountB); - PERFORM maevsi_test.event_category_mapping_test('event_category_mapping: A blocks B, perspective A', accountA, ARRAY[eventA, eventC]::UUID[]); - PERFORM maevsi_test.event_category_mapping_test('event_category_mapping: A blocks B, perspective B', accountB, ARRAY[eventB, eventC]::UUID[]); + PERFORM vibetype_test.account_block_create(accountA, accountB); + PERFORM vibetype_test.event_category_mapping_test('event_category_mapping: A blocks B, perspective A', accountA, ARRAY[eventA, eventC]::UUID[]); + PERFORM vibetype_test.event_category_mapping_test('event_category_mapping: A blocks B, perspective B', accountB, ARRAY[eventB, eventC]::UUID[]); - PERFORM maevsi_test.account_block_remove(accountA, accountB); - PERFORM maevsi_test.contact_test('contact: no blocking, perspective A', accountA, ARRAY[contactAA, contactAB, contactAC, contactBA, contactCA]::UUID[]); - PERFORM maevsi_test.contact_test('contact: no blocking, perspective B', accountB, ARRAY[contactBB, contactBA, contactBC, contactAB, contactCB]::UUID[]); + PERFORM vibetype_test.account_block_remove(accountA, accountB); + PERFORM vibetype_test.contact_test('contact: no blocking, perspective A', accountA, ARRAY[contactAA, contactAB, contactAC, contactBA, contactCA]::UUID[]); + PERFORM vibetype_test.contact_test('contact: no blocking, perspective B', accountB, ARRAY[contactBB, contactBA, contactBC, contactAB, contactCB]::UUID[]); - PERFORM maevsi_test.account_block_create(accountA, accountB); - PERFORM maevsi_test.contact_test('contact: A blocks B, perspective A', accountA, ARRAY[contactAA, contactAC, contactCA]::UUID[]); - PERFORM maevsi_test.contact_test('contact: A blocks B, perspective B', accountB, ARRAY[contactBB, contactBC, contactCB]::UUID[]); + PERFORM vibetype_test.account_block_create(accountA, accountB); + PERFORM vibetype_test.contact_test('contact: A blocks B, perspective A', accountA, ARRAY[contactAA, contactAC, contactCA]::UUID[]); + PERFORM vibetype_test.contact_test('contact: A blocks B, perspective B', accountB, ARRAY[contactBB, contactBC, contactCB]::UUID[]); - PERFORM maevsi_test.account_block_remove(accountA, accountB); - PERFORM maevsi_test.guest_test('guest: no blocking, perspective A', accountA, ARRAY[guestAB, guestAC, guestBA, guestCA]::UUID[]); - PERFORM maevsi_test.guest_test('guest: no blocking, perspective B', accountB, ARRAY[guestBA, guestBC, guestAB, guestCB]::UUID[]); + PERFORM vibetype_test.account_block_remove(accountA, accountB); + PERFORM vibetype_test.guest_test('guest: no blocking, perspective A', accountA, ARRAY[guestAB, guestAC, guestBA, guestCA]::UUID[]); + PERFORM vibetype_test.guest_test('guest: no blocking, perspective B', accountB, ARRAY[guestBA, guestBC, guestAB, guestCB]::UUID[]); - PERFORM maevsi_test.account_block_create(accountA, accountB); - PERFORM maevsi_test.guest_test('guest: A blocks B, perspective A', accountA, ARRAY[guestAC, guestCA]::UUID[]); - PERFORM maevsi_test.guest_test('guest: A blocks B, perspective B', accountB, ARRAY[guestBC, guestCB]::UUID[]); + PERFORM vibetype_test.account_block_create(accountA, accountB); + PERFORM vibetype_test.guest_test('guest: A blocks B, perspective A', accountA, ARRAY[guestAC, guestCA]::UUID[]); + PERFORM vibetype_test.guest_test('guest: A blocks B, perspective B', accountB, ARRAY[guestBC, guestCB]::UUID[]); - PERFORM maevsi_test.account_block_remove(accountA, accountB); - PERFORM maevsi_test.event_test('anonymous login: no blocking, events', null, ARRAY[eventA, eventB, eventC]::UUID[]); - PERFORM maevsi_test.contact_test('anonymous login: no blocking, contacts', null, ARRAY[]::UUID[]); - PERFORM maevsi_test.guest_test('anonymous login: no blocking, guests', null, ARRAY[]::UUID[]); + PERFORM vibetype_test.account_block_remove(accountA, accountB); + PERFORM vibetype_test.event_test('anonymous login: no blocking, events', null, ARRAY[eventA, eventB, eventC]::UUID[]); + PERFORM vibetype_test.contact_test('anonymous login: no blocking, contacts', null, ARRAY[]::UUID[]); + PERFORM vibetype_test.guest_test('anonymous login: no blocking, guests', null, ARRAY[]::UUID[]); - PERFORM maevsi_test.event_test('anonymous login: A blocks B, events', null, ARRAY[eventA, eventB, eventC]::UUID[]); - PERFORM maevsi_test.contact_test('anonymous login: A blocks B, contacts', null, ARRAY[]::UUID[]); - PERFORM maevsi_test.guest_test('anonymous login: A blocks B, guests', null, ARRAY[]::UUID[]); + PERFORM vibetype_test.event_test('anonymous login: A blocks B, events', null, ARRAY[eventA, eventB, eventC]::UUID[]); + PERFORM vibetype_test.contact_test('anonymous login: A blocks B, contacts', null, ARRAY[]::UUID[]); + PERFORM vibetype_test.guest_test('anonymous login: A blocks B, guests', null, ARRAY[]::UUID[]); -- tests for function `guest_claim_array()` - PERFORM maevsi_test.account_block_remove(accountA, accountB); - guestClaimArray := maevsi.guest_claim_array(); - PERFORM maevsi_test.uuid_array_test('no blocking, guest claim is unset', guestClaimArray, ARRAY[]::UUID[]); + PERFORM vibetype_test.account_block_remove(accountA, accountB); + guestClaimArray := vibetype.guest_claim_array(); + PERFORM vibetype_test.uuid_array_test('no blocking, guest claim is unset', guestClaimArray, ARRAY[]::UUID[]); - guestClaimArray := maevsi_test.guest_claim_from_account_guest(accountA); - PERFORM maevsi_test.uuid_array_test('no blocking, guest claim was added', guestClaimArray, ARRAY[guestBA, guestCA]); + guestClaimArray := vibetype_test.guest_claim_from_account_guest(accountA); + PERFORM vibetype_test.uuid_array_test('no blocking, guest claim was added', guestClaimArray, ARRAY[guestBA, guestCA]); - guestClaimArrayNew := maevsi.guest_claim_array(); - PERFORM maevsi_test.uuid_array_test('no blocking, guest claim includes data', guestClaimArrayNew, guestClaimArray); + guestClaimArrayNew := vibetype.guest_claim_array(); + PERFORM vibetype_test.uuid_array_test('no blocking, guest claim includes data', guestClaimArrayNew, guestClaimArray); - PERFORM maevsi_test.account_block_create(accountA, accountB); - guestClaimArrayNew := maevsi.guest_claim_array(); - PERFORM maevsi_test.uuid_array_test('A blocks B, guest claim excludes blocked data', guestClaimArrayNew, ARRAY[guestCA]); + PERFORM vibetype_test.account_block_create(accountA, accountB); + guestClaimArrayNew := vibetype.guest_claim_array(); + PERFORM vibetype_test.uuid_array_test('A blocks B, guest claim excludes blocked data', guestClaimArrayNew, ARRAY[guestCA]); END $$; ROLLBACK; diff --git a/src/verify/test_invitation.sql b/src/verify/test_invitation.sql index 29c91888..179bc940 100644 --- a/src/verify/test_invitation.sql +++ b/src/verify/test_invitation.sql @@ -15,18 +15,18 @@ DECLARE BEGIN - accountA := maevsi_test.account_create('a', 'a@example.com'); - accountB := maevsi_test.account_create('b', 'b@example.com'); - contactAB := maevsi_test.contact_create(accountA, 'b@example.com'); - eventA := maevsi_test.event_create(accountA, 'Event by A', 'event-by-a', '2025-06-01 20:00', 'public'); - guestAB := maevsi_test.guest_create(accountA, eventA, contactAB); + accountA := vibetype_test.account_create('a', 'a@example.com'); + accountB := vibetype_test.account_create('b', 'b@example.com'); + contactAB := vibetype_test.contact_create(accountA, 'b@example.com'); + eventA := vibetype_test.event_create(accountA, 'Event by A', 'event-by-a', '2025-06-01 20:00', 'public'); + guestAB := vibetype_test.guest_create(accountA, eventA, contactAB); - PERFORM maevsi_test.invoker_set(accountA); + PERFORM vibetype_test.invoker_set(accountA); - invitationId := maevsi.invite(guestAB, 'de'); + invitationId := vibetype.invite(guestAB, 'de'); SELECT guest_id, created_by, channel INTO rec - FROM maevsi.invitation + FROM vibetype.invitation WHERE id = invitationId; IF rec.guest_id != guestAB or rec.created_by != accountA or rec.channel != 'event_invitation' THEN diff --git a/src/verify/test_location.sql b/src/verify/test_location.sql index 9aa1988f..6ddbd468 100644 --- a/src/verify/test_location.sql +++ b/src/verify/test_location.sql @@ -8,25 +8,25 @@ DECLARE _id UUID; BEGIN -- Register account - _account_id := maevsi_test.account_create('username', 'email@example.com'); + _account_id := vibetype_test.account_create('username', 'email@example.com'); -- Create event - _event_id := maevsi_test.event_create(_account_id, 'Event by A', 'event-by-a', '2025-06-01 20:00', 'public'); + _event_id := vibetype_test.event_create(_account_id, 'Event by A', 'event-by-a', '2025-06-01 20:00', 'public'); -- Update and validate account location - PERFORM maevsi_test.account_location_update(_account_id, 51.304, 9.476); -- Somewhere in Kassel - _coordinates := maevsi_test.account_location_coordinates(_account_id); + PERFORM vibetype_test.account_location_update(_account_id, 51.304, 9.476); -- Somewhere in Kassel + _coordinates := vibetype_test.account_location_coordinates(_account_id); IF NOT (round(_coordinates[1]::numeric, 3) = 51.304 AND round(_coordinates[2]::numeric, 3) = 9.476) THEN RAISE EXCEPTION 'Wrong account coordinates'; END IF; -- Set account-specific context - PERFORM maevsi_test.invoker_set(_account_id); + PERFORM vibetype_test.invoker_set(_account_id); -- Update and validate event location - PERFORM maevsi_test.event_location_update(_event_id, 50.113, 8.650); -- Somewhere in Frankfurt - _coordinates := maevsi_test.event_location_coordinates(_event_id); + PERFORM vibetype_test.event_location_update(_event_id, 50.113, 8.650); -- Somewhere in Frankfurt + _coordinates := vibetype_test.event_location_coordinates(_event_id); IF NOT (round(_coordinates[1]::numeric, 3) = 50.113 AND round(_coordinates[2]::numeric, 3) = 8.650) THEN RAISE EXCEPTION 'Wrong event coordinates'; @@ -34,14 +34,14 @@ BEGIN -- Test event filtering by radius from account SELECT event_id INTO _id - FROM maevsi_test.event_filter_radius_account(_account_id, 100); + FROM vibetype_test.event_filter_radius_account(_account_id, 100); IF _id IS NOT NULL THEN RAISE EXCEPTION 'Function `event_filter_radius_account` with radius 100 km should have returned an empty result'; END IF; SELECT event_id INTO _id - FROM maevsi_test.event_filter_radius_account(_account_id, 250); + FROM vibetype_test.event_filter_radius_account(_account_id, 250); IF _id != _event_id THEN RAISE EXCEPTION 'Function `event_filter_radius_account` with radius 250 km should have returned `_event_id`'; @@ -49,14 +49,14 @@ BEGIN -- Test account filtering by radius from event SELECT account_id INTO _id - FROM maevsi_test.account_filter_radius_event(_event_id, 100); + FROM vibetype_test.account_filter_radius_event(_event_id, 100); IF _id IS NOT NULL THEN RAISE EXCEPTION 'Function `account_filter_radius_event` with radius 100 km should have returned an empty result'; END IF; SELECT account_id INTO _id - FROM maevsi_test.account_filter_radius_event(_event_id, 250); + FROM vibetype_test.account_filter_radius_event(_event_id, 250); IF _id != _account_id THEN RAISE EXCEPTION 'Function `account_filter_radius_event` with radius 250 km should have returned `_account_id`'; diff --git a/src/verify/type_event_unlock_response.sql b/src/verify/type_event_unlock_response.sql index db3cb1ee..98c7b31b 100644 --- a/src/verify/type_event_unlock_response.sql +++ b/src/verify/type_event_unlock_response.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_type_privilege('maevsi.event_unlock_response', 'USAGE')); + ASSERT (SELECT pg_catalog.has_type_privilege('vibetype.event_unlock_response', 'USAGE')); END $$; ROLLBACK; diff --git a/src/verify/type_jwt.sql b/src/verify/type_jwt.sql index e5526fd6..01747f65 100644 --- a/src/verify/type_jwt.sql +++ b/src/verify/type_jwt.sql @@ -2,7 +2,7 @@ BEGIN; DO $$ BEGIN - ASSERT (SELECT pg_catalog.has_type_privilege('maevsi.jwt', 'USAGE')); + ASSERT (SELECT pg_catalog.has_type_privilege('vibetype.jwt', 'USAGE')); END $$; ROLLBACK; diff --git a/src/verify/view_guest_flat.sql b/src/verify/view_guest_flat.sql index 52802469..2a55870b 100644 --- a/src/verify/view_guest_flat.sql +++ b/src/verify/view_guest_flat.sql @@ -30,6 +30,6 @@ SELECT event_url, event_visibility, event_created_by -FROM maevsi.guest_flat WHERE FALSE; +FROM vibetype.guest_flat WHERE FALSE; ROLLBACK; diff --git a/test/schema/schema.definition.sql b/test/schema/schema.definition.sql index bedf3908..bb8407d0 100644 --- a/test/schema/schema.definition.sql +++ b/test/schema/schema.definition.sql @@ -16,67 +16,67 @@ SET client_min_messages = warning; SET row_security = off; -- --- Name: maevsi; Type: SCHEMA; Schema: -; Owner: postgres +-- Name: sqitch; Type: SCHEMA; Schema: -; Owner: postgres -- -CREATE SCHEMA maevsi; +CREATE SCHEMA sqitch; -ALTER SCHEMA maevsi OWNER TO postgres; +ALTER SCHEMA sqitch OWNER TO postgres; -- --- Name: SCHEMA maevsi; Type: COMMENT; Schema: -; Owner: postgres +-- Name: SCHEMA sqitch; Type: COMMENT; Schema: -; Owner: postgres -- -COMMENT ON SCHEMA maevsi IS 'Is used by PostGraphile.'; +COMMENT ON SCHEMA sqitch IS 'Sqitch database deployment metadata v1.1.'; -- --- Name: maevsi_private; Type: SCHEMA; Schema: -; Owner: postgres +-- Name: vibetype; Type: SCHEMA; Schema: -; Owner: postgres -- -CREATE SCHEMA maevsi_private; +CREATE SCHEMA vibetype; -ALTER SCHEMA maevsi_private OWNER TO postgres; +ALTER SCHEMA vibetype OWNER TO postgres; -- --- Name: SCHEMA maevsi_private; Type: COMMENT; Schema: -; Owner: postgres +-- Name: SCHEMA vibetype; Type: COMMENT; Schema: -; Owner: postgres -- -COMMENT ON SCHEMA maevsi_private IS 'Contains account information and is not used by PostGraphile.'; +COMMENT ON SCHEMA vibetype IS 'Is used by PostGraphile.'; -- --- Name: maevsi_test; Type: SCHEMA; Schema: -; Owner: postgres +-- Name: vibetype_private; Type: SCHEMA; Schema: -; Owner: postgres -- -CREATE SCHEMA maevsi_test; +CREATE SCHEMA vibetype_private; -ALTER SCHEMA maevsi_test OWNER TO postgres; +ALTER SCHEMA vibetype_private OWNER TO postgres; -- --- Name: SCHEMA maevsi_test; Type: COMMENT; Schema: -; Owner: postgres +-- Name: SCHEMA vibetype_private; Type: COMMENT; Schema: -; Owner: postgres -- -COMMENT ON SCHEMA maevsi_test IS 'Schema for test functions.'; +COMMENT ON SCHEMA vibetype_private IS 'Contains account information and is not used by PostGraphile.'; -- --- Name: sqitch; Type: SCHEMA; Schema: -; Owner: postgres +-- Name: vibetype_test; Type: SCHEMA; Schema: -; Owner: postgres -- -CREATE SCHEMA sqitch; +CREATE SCHEMA vibetype_test; -ALTER SCHEMA sqitch OWNER TO postgres; +ALTER SCHEMA vibetype_test OWNER TO postgres; -- --- Name: SCHEMA sqitch; Type: COMMENT; Schema: -; Owner: postgres +-- Name: SCHEMA vibetype_test; Type: COMMENT; Schema: -; Owner: postgres -- -COMMENT ON SCHEMA sqitch IS 'Sqitch database deployment metadata v1.1.'; +COMMENT ON SCHEMA vibetype_test IS 'Schema for test functions.'; -- @@ -108,29 +108,29 @@ COMMENT ON EXTENSION postgis IS 'Functions to work with geospatial data.'; -- --- Name: achievement_type; Type: TYPE; Schema: maevsi; Owner: postgres +-- Name: achievement_type; Type: TYPE; Schema: vibetype; Owner: postgres -- -CREATE TYPE maevsi.achievement_type AS ENUM ( +CREATE TYPE vibetype.achievement_type AS ENUM ( 'early_bird', 'meet_the_team' ); -ALTER TYPE maevsi.achievement_type OWNER TO postgres; +ALTER TYPE vibetype.achievement_type OWNER TO postgres; -- --- Name: TYPE achievement_type; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TYPE achievement_type; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TYPE maevsi.achievement_type IS 'Achievements that can be unlocked by users.'; +COMMENT ON TYPE vibetype.achievement_type IS 'Achievements that can be unlocked by users.'; -- --- Name: event_size; Type: TYPE; Schema: maevsi; Owner: postgres +-- Name: event_size; Type: TYPE; Schema: vibetype; Owner: postgres -- -CREATE TYPE maevsi.event_size AS ENUM ( +CREATE TYPE vibetype.event_size AS ENUM ( 'small', 'medium', 'large', @@ -138,20 +138,20 @@ CREATE TYPE maevsi.event_size AS ENUM ( ); -ALTER TYPE maevsi.event_size OWNER TO postgres; +ALTER TYPE vibetype.event_size OWNER TO postgres; -- --- Name: TYPE event_size; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TYPE event_size; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TYPE maevsi.event_size IS 'Possible event sizes: small, medium, large, huge.'; +COMMENT ON TYPE vibetype.event_size IS 'Possible event sizes: small, medium, large, huge.'; -- --- Name: jwt; Type: TYPE; Schema: maevsi; Owner: postgres +-- Name: jwt; Type: TYPE; Schema: vibetype; Owner: postgres -- -CREATE TYPE maevsi.jwt AS ( +CREATE TYPE vibetype.jwt AS ( id uuid, account_id uuid, account_username text, @@ -161,104 +161,104 @@ CREATE TYPE maevsi.jwt AS ( ); -ALTER TYPE maevsi.jwt OWNER TO postgres; +ALTER TYPE vibetype.jwt OWNER TO postgres; -- --- Name: event_unlock_response; Type: TYPE; Schema: maevsi; Owner: postgres +-- Name: event_unlock_response; Type: TYPE; Schema: vibetype; Owner: postgres -- -CREATE TYPE maevsi.event_unlock_response AS ( +CREATE TYPE vibetype.event_unlock_response AS ( creator_username text, event_slug text, - jwt maevsi.jwt + jwt vibetype.jwt ); -ALTER TYPE maevsi.event_unlock_response OWNER TO postgres; +ALTER TYPE vibetype.event_unlock_response OWNER TO postgres; -- --- Name: event_visibility; Type: TYPE; Schema: maevsi; Owner: postgres +-- Name: event_visibility; Type: TYPE; Schema: vibetype; Owner: postgres -- -CREATE TYPE maevsi.event_visibility AS ENUM ( +CREATE TYPE vibetype.event_visibility AS ENUM ( 'public', 'private', 'unlisted' ); -ALTER TYPE maevsi.event_visibility OWNER TO postgres; +ALTER TYPE vibetype.event_visibility OWNER TO postgres; -- --- Name: TYPE event_visibility; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TYPE event_visibility; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TYPE maevsi.event_visibility IS 'Possible visibilities of events and event groups: public, private and unlisted.'; +COMMENT ON TYPE vibetype.event_visibility IS 'Possible visibilities of events and event groups: public, private and unlisted.'; -- --- Name: invitation_feedback; Type: TYPE; Schema: maevsi; Owner: postgres +-- Name: invitation_feedback; Type: TYPE; Schema: vibetype; Owner: postgres -- -CREATE TYPE maevsi.invitation_feedback AS ENUM ( +CREATE TYPE vibetype.invitation_feedback AS ENUM ( 'accepted', 'canceled' ); -ALTER TYPE maevsi.invitation_feedback OWNER TO postgres; +ALTER TYPE vibetype.invitation_feedback OWNER TO postgres; -- --- Name: TYPE invitation_feedback; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TYPE invitation_feedback; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TYPE maevsi.invitation_feedback IS 'Possible answers to an invitation: accepted, canceled.'; +COMMENT ON TYPE vibetype.invitation_feedback IS 'Possible answers to an invitation: accepted, canceled.'; -- --- Name: invitation_feedback_paper; Type: TYPE; Schema: maevsi; Owner: postgres +-- Name: invitation_feedback_paper; Type: TYPE; Schema: vibetype; Owner: postgres -- -CREATE TYPE maevsi.invitation_feedback_paper AS ENUM ( +CREATE TYPE vibetype.invitation_feedback_paper AS ENUM ( 'none', 'paper', 'digital' ); -ALTER TYPE maevsi.invitation_feedback_paper OWNER TO postgres; +ALTER TYPE vibetype.invitation_feedback_paper OWNER TO postgres; -- --- Name: TYPE invitation_feedback_paper; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TYPE invitation_feedback_paper; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TYPE maevsi.invitation_feedback_paper IS 'Possible choices on how to receive a paper invitation: none, paper, digital.'; +COMMENT ON TYPE vibetype.invitation_feedback_paper IS 'Possible choices on how to receive a paper invitation: none, paper, digital.'; -- --- Name: language; Type: TYPE; Schema: maevsi; Owner: postgres +-- Name: language; Type: TYPE; Schema: vibetype; Owner: postgres -- -CREATE TYPE maevsi.language AS ENUM ( +CREATE TYPE vibetype.language AS ENUM ( 'de', 'en' ); -ALTER TYPE maevsi.language OWNER TO postgres; +ALTER TYPE vibetype.language OWNER TO postgres; -- --- Name: TYPE language; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TYPE language; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TYPE maevsi.language IS 'Supported ISO 639 language codes.'; +COMMENT ON TYPE vibetype.language IS 'Supported ISO 639 language codes.'; -- --- Name: social_network; Type: TYPE; Schema: maevsi; Owner: postgres +-- Name: social_network; Type: TYPE; Schema: vibetype; Owner: postgres -- -CREATE TYPE maevsi.social_network AS ENUM ( +CREATE TYPE vibetype.social_network AS ENUM ( 'facebook', 'instagram', 'tiktok', @@ -266,20 +266,20 @@ CREATE TYPE maevsi.social_network AS ENUM ( ); -ALTER TYPE maevsi.social_network OWNER TO postgres; +ALTER TYPE vibetype.social_network OWNER TO postgres; -- --- Name: TYPE social_network; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TYPE social_network; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TYPE maevsi.social_network IS 'Social networks.'; +COMMENT ON TYPE vibetype.social_network IS 'Social networks.'; -- --- Name: account_delete(text); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: account_delete(text); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.account_delete(password text) RETURNS void +CREATE FUNCTION vibetype.account_delete(password text) RETURNS void LANGUAGE plpgsql STRICT SECURITY DEFINER AS $_$ DECLARE @@ -287,11 +287,11 @@ DECLARE BEGIN _current_account_id := current_setting('jwt.claims.account_id')::UUID; - IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($1, account.password_hash))) THEN - IF (EXISTS (SELECT 1 FROM maevsi.event WHERE event.created_by = _current_account_id)) THEN + IF (EXISTS (SELECT 1 FROM vibetype_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($1, account.password_hash))) THEN + IF (EXISTS (SELECT 1 FROM vibetype.event WHERE event.created_by = _current_account_id)) THEN RAISE 'You still own events!' USING ERRCODE = 'foreign_key_violation'; ELSE - DELETE FROM maevsi_private.account WHERE account.id = _current_account_id; + DELETE FROM vibetype_private.account WHERE account.id = _current_account_id; END IF; ELSE RAISE 'Account with given password not found!' USING ERRCODE = 'invalid_password'; @@ -300,27 +300,27 @@ END; $_$; -ALTER FUNCTION maevsi.account_delete(password text) OWNER TO postgres; +ALTER FUNCTION vibetype.account_delete(password text) OWNER TO postgres; -- --- Name: FUNCTION account_delete(password text); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION account_delete(password text); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.account_delete(password text) IS 'Allows to delete an account.'; +COMMENT ON FUNCTION vibetype.account_delete(password text) IS 'Allows to delete an account.'; -- --- Name: account_email_address_verification(uuid); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: account_email_address_verification(uuid); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.account_email_address_verification(code uuid) RETURNS void +CREATE FUNCTION vibetype.account_email_address_verification(code uuid) RETURNS void LANGUAGE plpgsql STRICT SECURITY DEFINER AS $_$ DECLARE - _account maevsi_private.account; + _account vibetype_private.account; BEGIN SELECT * - FROM maevsi_private.account + FROM vibetype_private.account INTO _account WHERE account.email_address_verification = $1; @@ -332,27 +332,27 @@ BEGIN RAISE 'Verification code expired!' USING ERRCODE = 'object_not_in_prerequisite_state'; END IF; - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET email_address_verification = NULL WHERE email_address_verification = $1; END; $_$; -ALTER FUNCTION maevsi.account_email_address_verification(code uuid) OWNER TO postgres; +ALTER FUNCTION vibetype.account_email_address_verification(code uuid) OWNER TO postgres; -- --- Name: FUNCTION account_email_address_verification(code uuid); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION account_email_address_verification(code uuid); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.account_email_address_verification(code uuid) IS 'Sets the account''s email address verification code to `NULL` for which the email address verification code equals the one passed and is up to date.'; +COMMENT ON FUNCTION vibetype.account_email_address_verification(code uuid) IS 'Sets the account''s email address verification code to `NULL` for which the email address verification code equals the one passed and is up to date.'; -- --- Name: account_password_change(text, text); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: account_password_change(text, text); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.account_password_change(password_current text, password_new text) RETURNS void +CREATE FUNCTION vibetype.account_password_change(password_current text, password_new text) RETURNS void LANGUAGE plpgsql STRICT SECURITY DEFINER AS $_$ DECLARE @@ -364,8 +364,8 @@ BEGIN _current_account_id := current_setting('jwt.claims.account_id')::UUID; - IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($1, account.password_hash))) THEN - UPDATE maevsi_private.account SET password_hash = crypt($2, gen_salt('bf')) WHERE account.id = _current_account_id; + IF (EXISTS (SELECT 1 FROM vibetype_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($1, account.password_hash))) THEN + UPDATE vibetype_private.account SET password_hash = crypt($2, gen_salt('bf')) WHERE account.id = _current_account_id; ELSE RAISE 'Account with given password not found!' USING ERRCODE = 'invalid_password'; END IF; @@ -373,31 +373,31 @@ END; $_$; -ALTER FUNCTION maevsi.account_password_change(password_current text, password_new text) OWNER TO postgres; +ALTER FUNCTION vibetype.account_password_change(password_current text, password_new text) OWNER TO postgres; -- --- Name: FUNCTION account_password_change(password_current text, password_new text); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION account_password_change(password_current text, password_new text); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.account_password_change(password_current text, password_new text) IS 'Allows to change an account''s password.'; +COMMENT ON FUNCTION vibetype.account_password_change(password_current text, password_new text) IS 'Allows to change an account''s password.'; -- --- Name: account_password_reset(uuid, text); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: account_password_reset(uuid, text); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.account_password_reset(code uuid, password text) RETURNS void +CREATE FUNCTION vibetype.account_password_reset(code uuid, password text) RETURNS void LANGUAGE plpgsql STRICT SECURITY DEFINER AS $_$ DECLARE - _account maevsi_private.account; + _account vibetype_private.account; BEGIN IF (char_length($2) < 8) THEN RAISE 'Password too short!' USING ERRCODE = 'invalid_parameter_value'; END IF; SELECT * - FROM maevsi_private.account + FROM vibetype_private.account INTO _account WHERE account.password_reset_verification = $1; @@ -409,7 +409,7 @@ BEGIN RAISE 'Reset code expired!' USING ERRCODE = 'object_not_in_prerequisite_state'; END IF; - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET password_hash = crypt($2, gen_salt('bf')), password_reset_verification = NULL @@ -418,27 +418,27 @@ END; $_$; -ALTER FUNCTION maevsi.account_password_reset(code uuid, password text) OWNER TO postgres; +ALTER FUNCTION vibetype.account_password_reset(code uuid, password text) OWNER TO postgres; -- --- Name: FUNCTION account_password_reset(code uuid, password text); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION account_password_reset(code uuid, password text); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.account_password_reset(code uuid, password text) IS 'Sets a new password for an account if there was a request to do so before that''s still up to date.'; +COMMENT ON FUNCTION vibetype.account_password_reset(code uuid, password text) IS 'Sets a new password for an account if there was a request to do so before that''s still up to date.'; -- --- Name: account_password_reset_request(text, text); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: account_password_reset_request(text, text); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.account_password_reset_request(email_address text, language text) RETURNS void +CREATE FUNCTION vibetype.account_password_reset_request(email_address text, language text) RETURNS void LANGUAGE plpgsql STRICT SECURITY DEFINER AS $_$ DECLARE _notify_data RECORD; BEGIN WITH updated AS ( - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET password_reset_verification = gen_random_uuid() WHERE account.email_address = $1 RETURNING * @@ -447,14 +447,14 @@ BEGIN updated.email_address, updated.password_reset_verification, updated.password_reset_verification_valid_until - FROM updated, maevsi.account + FROM updated, vibetype.account WHERE updated.id = account.id INTO _notify_data; IF (_notify_data IS NULL) THEN -- noop ELSE - INSERT INTO maevsi.notification (channel, payload) VALUES ( + INSERT INTO vibetype.notification (channel, payload) VALUES ( 'account_password_reset_request', jsonb_pretty(jsonb_build_object( 'account', _notify_data, @@ -466,44 +466,44 @@ END; $_$; -ALTER FUNCTION maevsi.account_password_reset_request(email_address text, language text) OWNER TO postgres; +ALTER FUNCTION vibetype.account_password_reset_request(email_address text, language text) OWNER TO postgres; -- --- Name: FUNCTION account_password_reset_request(email_address text, language text); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION account_password_reset_request(email_address text, language text); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.account_password_reset_request(email_address text, language text) IS 'Sets a new password reset verification code for an account.'; +COMMENT ON FUNCTION vibetype.account_password_reset_request(email_address text, language text) IS 'Sets a new password reset verification code for an account.'; -- --- Name: account_registration(text, text, text, text); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: account_registration(text, text, text, text); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.account_registration(username text, email_address text, password text, language text) RETURNS uuid +CREATE FUNCTION vibetype.account_registration(username text, email_address text, password text, language text) RETURNS uuid LANGUAGE plpgsql STRICT SECURITY DEFINER AS $$ DECLARE - _new_account_private maevsi_private.account; - _new_account_public maevsi.account; + _new_account_private vibetype_private.account; + _new_account_public vibetype.account; _new_account_notify RECORD; BEGIN IF (char_length(account_registration.password) < 8) THEN RAISE 'Password too short!' USING ERRCODE = 'invalid_parameter_value'; END IF; - IF (EXISTS (SELECT 1 FROM maevsi.account WHERE account.username = account_registration.username)) THEN + IF (EXISTS (SELECT 1 FROM vibetype.account WHERE account.username = account_registration.username)) THEN RAISE 'An account with this username already exists!' USING ERRCODE = 'unique_violation'; END IF; - IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.email_address = account_registration.email_address)) THEN + IF (EXISTS (SELECT 1 FROM vibetype_private.account WHERE account.email_address = account_registration.email_address)) THEN RAISE 'An account with this email address already exists!' USING ERRCODE = 'unique_violation'; END IF; - INSERT INTO maevsi_private.account(email_address, password_hash, last_activity) VALUES + INSERT INTO vibetype_private.account(email_address, password_hash, last_activity) VALUES (account_registration.email_address, crypt(account_registration.password, gen_salt('bf')), CURRENT_TIMESTAMP) RETURNING * INTO _new_account_private; - INSERT INTO maevsi.account(id, username) VALUES + INSERT INTO vibetype.account(id, username) VALUES (_new_account_private.id, account_registration.username) RETURNING * INTO _new_account_public; @@ -514,9 +514,9 @@ BEGIN _new_account_private.email_address_verification_valid_until INTO _new_account_notify; - INSERT INTO maevsi.contact(account_id, created_by) VALUES (_new_account_private.id, _new_account_private.id); + INSERT INTO vibetype.contact(account_id, created_by) VALUES (_new_account_private.id, _new_account_private.id); - INSERT INTO maevsi.notification (channel, payload) VALUES ( + INSERT INTO vibetype.notification (channel, payload) VALUES ( 'account_registration', jsonb_pretty(jsonb_build_object( 'account', row_to_json(_new_account_notify), @@ -529,20 +529,20 @@ END; $$; -ALTER FUNCTION maevsi.account_registration(username text, email_address text, password text, language text) OWNER TO postgres; +ALTER FUNCTION vibetype.account_registration(username text, email_address text, password text, language text) OWNER TO postgres; -- --- Name: FUNCTION account_registration(username text, email_address text, password text, language text); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION account_registration(username text, email_address text, password text, language text); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.account_registration(username text, email_address text, password text, language text) IS 'Creates a contact and registers an account referencing it.'; +COMMENT ON FUNCTION vibetype.account_registration(username text, email_address text, password text, language text) IS 'Creates a contact and registers an account referencing it.'; -- --- Name: account_registration_refresh(uuid, text); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: account_registration_refresh(uuid, text); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.account_registration_refresh(account_id uuid, language text) RETURNS void +CREATE FUNCTION vibetype.account_registration_refresh(account_id uuid, language text) RETURNS void LANGUAGE plpgsql STRICT SECURITY DEFINER AS $_$ DECLARE @@ -550,12 +550,12 @@ DECLARE BEGIN RAISE 'Refreshing registrations is currently not available due to missing rate limiting!' USING ERRCODE = 'deprecated_feature'; - IF (NOT EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = $1)) THEN + IF (NOT EXISTS (SELECT 1 FROM vibetype_private.account WHERE account.id = $1)) THEN RAISE 'An account with this account id does not exist!' USING ERRCODE = 'invalid_parameter_value'; END IF; WITH updated AS ( - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET email_address_verification = DEFAULT WHERE account.id = $1 RETURNING * @@ -565,9 +565,9 @@ BEGIN updated.email_address_verification, updated.email_address_verification_valid_until INTO _new_account_notify - FROM updated JOIN maevsi.account ON updated.id = account.id; + FROM updated JOIN vibetype.account ON updated.id = account.id; - INSERT INTO maevsi_private.notification (channel, payload) VALUES ( + INSERT INTO vibetype_private.notification (channel, payload) VALUES ( 'account_registration', jsonb_pretty(jsonb_build_object( 'account', row_to_json(_new_account_notify), @@ -578,53 +578,53 @@ END; $_$; -ALTER FUNCTION maevsi.account_registration_refresh(account_id uuid, language text) OWNER TO postgres; +ALTER FUNCTION vibetype.account_registration_refresh(account_id uuid, language text) OWNER TO postgres; -- --- Name: FUNCTION account_registration_refresh(account_id uuid, language text); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION account_registration_refresh(account_id uuid, language text); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.account_registration_refresh(account_id uuid, language text) IS 'Refreshes an account''s email address verification validity period.'; +COMMENT ON FUNCTION vibetype.account_registration_refresh(account_id uuid, language text) IS 'Refreshes an account''s email address verification validity period.'; -- --- Name: account_upload_quota_bytes(); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: account_upload_quota_bytes(); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.account_upload_quota_bytes() RETURNS bigint +CREATE FUNCTION vibetype.account_upload_quota_bytes() RETURNS bigint LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $$ BEGIN - RETURN (SELECT upload_quota_bytes FROM maevsi_private.account WHERE account.id = current_setting('jwt.claims.account_id')::UUID); + RETURN (SELECT upload_quota_bytes FROM vibetype_private.account WHERE account.id = current_setting('jwt.claims.account_id')::UUID); END; $$; -ALTER FUNCTION maevsi.account_upload_quota_bytes() OWNER TO postgres; +ALTER FUNCTION vibetype.account_upload_quota_bytes() OWNER TO postgres; -- --- Name: FUNCTION account_upload_quota_bytes(); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION account_upload_quota_bytes(); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.account_upload_quota_bytes() IS 'Gets the total upload quota in bytes for the invoking account.'; +COMMENT ON FUNCTION vibetype.account_upload_quota_bytes() IS 'Gets the total upload quota in bytes for the invoking account.'; -- --- Name: achievement_unlock(uuid, text); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: achievement_unlock(uuid, text); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.achievement_unlock(code uuid, alias text) RETURNS uuid +CREATE FUNCTION vibetype.achievement_unlock(code uuid, alias text) RETURNS uuid LANGUAGE plpgsql STRICT SECURITY DEFINER AS $_$ DECLARE _account_id UUID; - _achievement maevsi.achievement_type; + _achievement vibetype.achievement_type; _achievement_id UUID; BEGIN - _account_id := maevsi.invoker_account_id(); + _account_id := vibetype.invoker_account_id(); SELECT achievement - FROM maevsi_private.achievement_code + FROM vibetype_private.achievement_code INTO _achievement WHERE achievement_code.id = $1 OR achievement_code.alias = $2; @@ -637,12 +637,12 @@ BEGIN END IF; _achievement_id := ( - SELECT id FROM maevsi.achievement + SELECT id FROM vibetype.achievement WHERE achievement.account_id = _account_id AND achievement.achievement = _achievement ); IF (_achievement_id IS NULL) THEN - INSERT INTO maevsi.achievement(account_id, achievement) + INSERT INTO vibetype.achievement(account_id, achievement) VALUES (_account_id, _achievement) RETURNING achievement.id INTO _achievement_id; END IF; @@ -652,49 +652,49 @@ END; $_$; -ALTER FUNCTION maevsi.achievement_unlock(code uuid, alias text) OWNER TO postgres; +ALTER FUNCTION vibetype.achievement_unlock(code uuid, alias text) OWNER TO postgres; -- --- Name: FUNCTION achievement_unlock(code uuid, alias text); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION achievement_unlock(code uuid, alias text); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.achievement_unlock(code uuid, alias text) IS 'Inserts an achievement unlock for the user that gave an existing achievement code.'; +COMMENT ON FUNCTION vibetype.achievement_unlock(code uuid, alias text) IS 'Inserts an achievement unlock for the user that gave an existing achievement code.'; -- --- Name: authenticate(text, text); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: authenticate(text, text); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.authenticate(username text, password text) RETURNS maevsi.jwt +CREATE FUNCTION vibetype.authenticate(username text, password text) RETURNS vibetype.jwt LANGUAGE plpgsql STRICT SECURITY DEFINER AS $$ DECLARE _account_id UUID; _jwt_id UUID := gen_random_uuid(); - _jwt_exp BIGINT := EXTRACT(EPOCH FROM ((SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP WITH TIME ZONE)) + COALESCE(current_setting('maevsi.jwt_expiry_duration', true), '1 day')::INTERVAL)); - _jwt maevsi.jwt; + _jwt_exp BIGINT := EXTRACT(EPOCH FROM ((SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP WITH TIME ZONE)) + COALESCE(current_setting('vibetype.jwt_expiry_duration', true), '1 day')::INTERVAL)); + _jwt vibetype.jwt; _username TEXT; BEGIN IF (authenticate.username = '' AND authenticate.password = '') THEN -- Authenticate as guest. - _jwt := (_jwt_id, NULL, NULL, _jwt_exp, maevsi.guest_claim_array(), 'maevsi_anonymous')::maevsi.jwt; + _jwt := (_jwt_id, NULL, NULL, _jwt_exp, vibetype.guest_claim_array(), 'vibetype_anonymous')::vibetype.jwt; ELSIF (authenticate.username IS NOT NULL AND authenticate.password IS NOT NULL) THEN -- if authenticate.username contains @ then treat it as an email adress otherwise as a user name IF (strpos(authenticate.username, '@') = 0) THEN - SELECT id FROM maevsi.account WHERE account.username = authenticate.username INTO _account_id; + SELECT id FROM vibetype.account WHERE account.username = authenticate.username INTO _account_id; ELSE - SELECT id FROM maevsi_private.account WHERE account.email_address = authenticate.username INTO _account_id; + SELECT id FROM vibetype_private.account WHERE account.email_address = authenticate.username INTO _account_id; END IF; IF (_account_id IS NULL) THEN RAISE 'Account not found!' USING ERRCODE = 'no_data_found'; END IF; - SELECT account.username INTO _username FROM maevsi.account WHERE id = _account_id; + SELECT account.username INTO _username FROM vibetype.account WHERE id = _account_id; IF (( SELECT account.email_address_verification - FROM maevsi_private.account + FROM vibetype_private.account WHERE account.id = _account_id AND account.password_hash = crypt(authenticate.password, account.password_hash) @@ -703,14 +703,14 @@ BEGIN END IF; WITH updated AS ( - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET (last_activity, password_reset_verification) = (DEFAULT, NULL) WHERE account.id = _account_id AND account.email_address_verification IS NULL -- Has been checked before, but better safe than sorry. AND account.password_hash = crypt(authenticate.password, account.password_hash) RETURNING * - ) SELECT _jwt_id, updated.id, _username, _jwt_exp, NULL, 'maevsi_account' + ) SELECT _jwt_id, updated.id, _username, _jwt_exp, NULL, 'vibetype_account' FROM updated INTO _jwt; @@ -719,19 +719,19 @@ BEGIN END IF; END IF; - INSERT INTO maevsi_private.jwt(id, token) VALUES (_jwt_id, _jwt); + INSERT INTO vibetype_private.jwt(id, token) VALUES (_jwt_id, _jwt); RETURN _jwt; END; $$; -ALTER FUNCTION maevsi.authenticate(username text, password text) OWNER TO postgres; +ALTER FUNCTION vibetype.authenticate(username text, password text) OWNER TO postgres; -- --- Name: FUNCTION authenticate(username text, password text); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION authenticate(username text, password text); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.authenticate(username text, password text) IS 'Creates a JWT token that will securely identify an account and give it certain permissions.'; +COMMENT ON FUNCTION vibetype.authenticate(username text, password text) IS 'Creates a JWT token that will securely identify an account and give it certain permissions.'; SET default_tablespace = ''; @@ -739,10 +739,10 @@ SET default_tablespace = ''; SET default_table_access_method = heap; -- --- Name: event; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: event; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.event ( +CREATE TABLE vibetype.event ( id uuid DEFAULT gen_random_uuid() NOT NULL, address_id uuid, description text, @@ -751,14 +751,14 @@ CREATE TABLE maevsi.event ( is_archived boolean DEFAULT false NOT NULL, is_in_person boolean, is_remote boolean, - language maevsi.language, + language vibetype.language, location text, location_geography public.geography(Point,4326), name text NOT NULL, slug text NOT NULL, start timestamp with time zone NOT NULL, url text, - visibility maevsi.event_visibility NOT NULL, + visibility vibetype.event_visibility NOT NULL, created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, created_by uuid NOT NULL, search_vector tsvector, @@ -771,160 +771,160 @@ CREATE TABLE maevsi.event ( ); -ALTER TABLE maevsi.event OWNER TO postgres; +ALTER TABLE vibetype.event OWNER TO postgres; -- --- Name: TABLE event; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE event; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.event IS 'An event.'; +COMMENT ON TABLE vibetype.event IS 'An event.'; -- --- Name: COLUMN event.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.id IS '@omit create,update +COMMENT ON COLUMN vibetype.event.id IS '@omit create,update The event''s internal id.'; -- --- Name: COLUMN event.address_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.address_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.address_id IS 'Optional reference to the physical address of the event.'; +COMMENT ON COLUMN vibetype.event.address_id IS 'Optional reference to the physical address of the event.'; -- --- Name: COLUMN event.description; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.description; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.description IS 'The event''s description.'; +COMMENT ON COLUMN vibetype.event.description IS 'The event''s description.'; -- --- Name: COLUMN event."end"; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event."end"; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event."end" IS 'The event''s end date and time, with timezone.'; +COMMENT ON COLUMN vibetype.event."end" IS 'The event''s end date and time, with timezone.'; -- --- Name: COLUMN event.guest_count_maximum; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.guest_count_maximum; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.guest_count_maximum IS 'The event''s maximum guest count.'; +COMMENT ON COLUMN vibetype.event.guest_count_maximum IS 'The event''s maximum guest count.'; -- --- Name: COLUMN event.is_archived; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.is_archived; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.is_archived IS 'Indicates whether the event is archived.'; +COMMENT ON COLUMN vibetype.event.is_archived IS 'Indicates whether the event is archived.'; -- --- Name: COLUMN event.is_in_person; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.is_in_person; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.is_in_person IS 'Indicates whether the event takes place in person.'; +COMMENT ON COLUMN vibetype.event.is_in_person IS 'Indicates whether the event takes place in person.'; -- --- Name: COLUMN event.is_remote; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.is_remote; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.is_remote IS 'Indicates whether the event takes place remotely.'; +COMMENT ON COLUMN vibetype.event.is_remote IS 'Indicates whether the event takes place remotely.'; -- --- Name: COLUMN event.location; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.location; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.location IS 'The event''s location as it can be shown on a map.'; +COMMENT ON COLUMN vibetype.event.location IS 'The event''s location as it can be shown on a map.'; -- --- Name: COLUMN event.location_geography; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.location_geography; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.location_geography IS 'The event''s geographic location.'; +COMMENT ON COLUMN vibetype.event.location_geography IS 'The event''s geographic location.'; -- --- Name: COLUMN event.name; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.name; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.name IS 'The event''s name.'; +COMMENT ON COLUMN vibetype.event.name IS 'The event''s name.'; -- --- Name: COLUMN event.slug; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.slug; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.slug IS 'The event''s name, slugified.'; +COMMENT ON COLUMN vibetype.event.slug IS 'The event''s name, slugified.'; -- --- Name: COLUMN event.start; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.start; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.start IS 'The event''s start date and time, with timezone.'; +COMMENT ON COLUMN vibetype.event.start IS 'The event''s start date and time, with timezone.'; -- --- Name: COLUMN event.url; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.url; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.url IS 'The event''s unified resource locator.'; +COMMENT ON COLUMN vibetype.event.url IS 'The event''s unified resource locator.'; -- --- Name: COLUMN event.visibility; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.visibility; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.visibility IS 'The event''s visibility.'; +COMMENT ON COLUMN vibetype.event.visibility IS 'The event''s visibility.'; -- --- Name: COLUMN event.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.created_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.created_at IS '@omit create,update +COMMENT ON COLUMN vibetype.event.created_at IS '@omit create,update Timestamp of when the event was created, defaults to the current timestamp.'; -- --- Name: COLUMN event.created_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.created_by; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.created_by IS 'The event creator''s id.'; +COMMENT ON COLUMN vibetype.event.created_by IS 'The event creator''s id.'; -- --- Name: COLUMN event.search_vector; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event.search_vector; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event.search_vector IS '@omit +COMMENT ON COLUMN vibetype.event.search_vector IS '@omit A vector used for full-text search on events.'; -- --- Name: event_delete(uuid, text); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: event_delete(uuid, text); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.event_delete(id uuid, password text) RETURNS maevsi.event +CREATE FUNCTION vibetype.event_delete(id uuid, password text) RETURNS vibetype.event LANGUAGE plpgsql STRICT SECURITY DEFINER AS $_$ DECLARE _current_account_id UUID; - _event_deleted maevsi.event; + _event_deleted vibetype.event; BEGIN _current_account_id := current_setting('jwt.claims.account_id')::UUID; - IF (EXISTS (SELECT 1 FROM maevsi_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($2, account.password_hash))) THEN + IF (EXISTS (SELECT 1 FROM vibetype_private.account WHERE account.id = _current_account_id AND account.password_hash = crypt($2, account.password_hash))) THEN DELETE - FROM maevsi.event + FROM vibetype.event WHERE "event".id = $1 AND "event".created_by = _current_account_id @@ -942,26 +942,26 @@ END; $_$; -ALTER FUNCTION maevsi.event_delete(id uuid, password text) OWNER TO postgres; +ALTER FUNCTION vibetype.event_delete(id uuid, password text) OWNER TO postgres; -- --- Name: FUNCTION event_delete(id uuid, password text); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION event_delete(id uuid, password text); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.event_delete(id uuid, password text) IS 'Allows to delete an event.'; +COMMENT ON FUNCTION vibetype.event_delete(id uuid, password text) IS 'Allows to delete an event.'; -- --- Name: event_guest_count_maximum(uuid); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: event_guest_count_maximum(uuid); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.event_guest_count_maximum(event_id uuid) RETURNS integer +CREATE FUNCTION vibetype.event_guest_count_maximum(event_id uuid) RETURNS integer LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $_$ BEGIN RETURN ( SELECT guest_count_maximum - FROM maevsi.event + FROM vibetype.event WHERE id = $1 AND ( -- Copied from `event_select` POLICY. @@ -971,39 +971,39 @@ BEGIN ( guest_count_maximum IS NULL OR - guest_count_maximum > (maevsi.guest_count(id)) -- Using the function here is required as there would otherwise be infinite recursion. + guest_count_maximum > (vibetype.guest_count(id)) -- Using the function here is required as there would otherwise be infinite recursion. ) ) OR ( - maevsi.invoker_account_id() IS NOT NULL + vibetype.invoker_account_id() IS NOT NULL AND - created_by = maevsi.invoker_account_id() + created_by = vibetype.invoker_account_id() ) - OR id IN (SELECT maevsi_private.events_invited()) + OR id IN (SELECT vibetype_private.events_invited()) ) ); END $_$; -ALTER FUNCTION maevsi.event_guest_count_maximum(event_id uuid) OWNER TO postgres; +ALTER FUNCTION vibetype.event_guest_count_maximum(event_id uuid) OWNER TO postgres; -- --- Name: FUNCTION event_guest_count_maximum(event_id uuid); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION event_guest_count_maximum(event_id uuid); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.event_guest_count_maximum(event_id uuid) IS 'Add a function that returns the maximum guest count of an accessible event.'; +COMMENT ON FUNCTION vibetype.event_guest_count_maximum(event_id uuid) IS 'Add a function that returns the maximum guest count of an accessible event.'; -- --- Name: event_is_existing(uuid, text); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: event_is_existing(uuid, text); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.event_is_existing(created_by uuid, slug text) RETURNS boolean +CREATE FUNCTION vibetype.event_is_existing(created_by uuid, slug text) RETURNS boolean LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $_$ BEGIN - IF (EXISTS (SELECT 1 FROM maevsi.event WHERE "event".created_by = $1 AND "event".slug = $2)) THEN + IF (EXISTS (SELECT 1 FROM vibetype.event WHERE "event".created_by = $1 AND "event".slug = $2)) THEN RETURN TRUE; ELSE RETURN FALSE; @@ -1012,32 +1012,32 @@ END; $_$; -ALTER FUNCTION maevsi.event_is_existing(created_by uuid, slug text) OWNER TO postgres; +ALTER FUNCTION vibetype.event_is_existing(created_by uuid, slug text) OWNER TO postgres; -- --- Name: FUNCTION event_is_existing(created_by uuid, slug text); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION event_is_existing(created_by uuid, slug text); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.event_is_existing(created_by uuid, slug text) IS 'Shows if an event exists.'; +COMMENT ON FUNCTION vibetype.event_is_existing(created_by uuid, slug text) IS 'Shows if an event exists.'; -- --- Name: event_search(text, maevsi.language); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: event_search(text, vibetype.language); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.event_search(query text, language maevsi.language) RETURNS SETOF maevsi.event +CREATE FUNCTION vibetype.event_search(query text, language vibetype.language) RETURNS SETOF vibetype.event LANGUAGE plpgsql STABLE AS $$ DECLARE ts_config regconfig; BEGIN - ts_config := maevsi.language_iso_full_text_search(event_search.language); + ts_config := vibetype.language_iso_full_text_search(event_search.language); RETURN QUERY SELECT * FROM - maevsi.event + vibetype.event WHERE search_vector @@ websearch_to_tsquery(ts_config, event_search.query) ORDER BY @@ -1046,45 +1046,45 @@ END; $$; -ALTER FUNCTION maevsi.event_search(query text, language maevsi.language) OWNER TO postgres; +ALTER FUNCTION vibetype.event_search(query text, language vibetype.language) OWNER TO postgres; -- --- Name: FUNCTION event_search(query text, language maevsi.language); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION event_search(query text, language vibetype.language); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.event_search(query text, language maevsi.language) IS 'Performs a full-text search on the event table based on the provided query and language, returning event IDs ordered by relevance.'; +COMMENT ON FUNCTION vibetype.event_search(query text, language vibetype.language) IS 'Performs a full-text search on the event table based on the provided query and language, returning event IDs ordered by relevance.'; -- --- Name: event_unlock(uuid); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: event_unlock(uuid); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.event_unlock(guest_id uuid) RETURNS maevsi.event_unlock_response +CREATE FUNCTION vibetype.event_unlock(guest_id uuid) RETURNS vibetype.event_unlock_response LANGUAGE plpgsql STRICT SECURITY DEFINER AS $_$ DECLARE _jwt_id UUID; - _jwt maevsi.jwt; - _event maevsi.event; + _jwt vibetype.jwt; + _event vibetype.event; _event_creator_account_username TEXT; _event_id UUID; BEGIN _jwt_id := current_setting('jwt.claims.id', true)::UUID; _jwt := ( _jwt_id, - maevsi.invoker_account_id(), -- prevent empty string cast to UUID + vibetype.invoker_account_id(), -- prevent empty string cast to UUID current_setting('jwt.claims.account_username', true)::TEXT, current_setting('jwt.claims.exp', true)::BIGINT, - (SELECT ARRAY(SELECT DISTINCT UNNEST(maevsi.guest_claim_array() || $1) ORDER BY 1)), + (SELECT ARRAY(SELECT DISTINCT UNNEST(vibetype.guest_claim_array() || $1) ORDER BY 1)), current_setting('jwt.claims.role', true)::TEXT - )::maevsi.jwt; + )::vibetype.jwt; - UPDATE maevsi_private.jwt + UPDATE vibetype_private.jwt SET token = _jwt WHERE id = _jwt_id; _event_id := ( - SELECT event_id FROM maevsi.guest + SELECT event_id FROM vibetype.guest WHERE guest.id = $1 ); @@ -1093,7 +1093,7 @@ BEGIN END IF; SELECT * - FROM maevsi.event + FROM vibetype.event WHERE id = _event_id INTO _event; @@ -1103,7 +1103,7 @@ BEGIN _event_creator_account_username := ( SELECT username - FROM maevsi.account + FROM vibetype.account WHERE id = _event.created_by ); @@ -1111,50 +1111,50 @@ BEGIN RAISE 'No event creator username for this guest id found!' USING ERRCODE = 'no_data_found'; END IF; - RETURN (_event_creator_account_username, _event.slug, _jwt)::maevsi.event_unlock_response; + RETURN (_event_creator_account_username, _event.slug, _jwt)::vibetype.event_unlock_response; END $_$; -ALTER FUNCTION maevsi.event_unlock(guest_id uuid) OWNER TO postgres; +ALTER FUNCTION vibetype.event_unlock(guest_id uuid) OWNER TO postgres; -- --- Name: FUNCTION event_unlock(guest_id uuid); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION event_unlock(guest_id uuid); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.event_unlock(guest_id uuid) IS 'Adds a guest claim to the current session.'; +COMMENT ON FUNCTION vibetype.event_unlock(guest_id uuid) IS 'Adds a guest claim to the current session.'; -- --- Name: events_organized(); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: events_organized(); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.events_organized() RETURNS TABLE(event_id uuid) +CREATE FUNCTION vibetype.events_organized() RETURNS TABLE(event_id uuid) LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $$ BEGIN RETURN QUERY - SELECT id FROM maevsi.event + SELECT id FROM vibetype.event WHERE - created_by = maevsi.invoker_account_id(); + created_by = vibetype.invoker_account_id(); END $$; -ALTER FUNCTION maevsi.events_organized() OWNER TO postgres; +ALTER FUNCTION vibetype.events_organized() OWNER TO postgres; -- --- Name: FUNCTION events_organized(); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION events_organized(); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.events_organized() IS 'Add a function that returns all event ids for which the invoker is the creator.'; +COMMENT ON FUNCTION vibetype.events_organized() IS 'Add a function that returns all event ids for which the invoker is the creator.'; -- --- Name: guest_claim_array(); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: guest_claim_array(); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.guest_claim_array() RETURNS uuid[] +CREATE FUNCTION vibetype.guest_claim_array() RETURNS uuid[] LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $$ DECLARE @@ -1166,22 +1166,22 @@ BEGIN IF _guest_ids IS NOT NULL THEN _guest_ids_unblocked := ARRAY ( SELECT g.id - FROM maevsi.guest g - JOIN maevsi.event e ON g.event_id = e.id - JOIN maevsi.contact c ON g.contact_id = c.id + FROM vibetype.guest g + JOIN vibetype.event e ON g.event_id = e.id + JOIN vibetype.contact c ON g.contact_id = c.id WHERE g.id = ANY(_guest_ids) AND e.created_by NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) AND ( c.created_by NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) AND ( c.account_id IS NULL OR c.account_id NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) ) ) @@ -1194,91 +1194,91 @@ END $$; -ALTER FUNCTION maevsi.guest_claim_array() OWNER TO postgres; +ALTER FUNCTION vibetype.guest_claim_array() OWNER TO postgres; -- --- Name: FUNCTION guest_claim_array(); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION guest_claim_array(); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.guest_claim_array() IS 'Returns the current guest claims as UUID array.'; +COMMENT ON FUNCTION vibetype.guest_claim_array() IS 'Returns the current guest claims as UUID array.'; -- --- Name: guest_contact_ids(); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: guest_contact_ids(); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.guest_contact_ids() RETURNS TABLE(contact_id uuid) +CREATE FUNCTION vibetype.guest_contact_ids() RETURNS TABLE(contact_id uuid) LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $$ BEGIN RETURN QUERY -- get all contacts for guests SELECT guest.contact_id - FROM maevsi.guest + FROM vibetype.guest WHERE ( -- that are known to the invoker - guest.id = ANY (maevsi.guest_claim_array()) + guest.id = ANY (vibetype.guest_claim_array()) OR -- or for events organized by the invoker - guest.event_id IN (SELECT maevsi.events_organized()) + guest.event_id IN (SELECT vibetype.events_organized()) ) AND -- except contacts created by a blocked account or referring to a blocked account guest.contact_id NOT IN ( SELECT contact.id - FROM maevsi.contact + FROM vibetype.contact WHERE contact.account_id IS NULL -- TODO: evaluate if this null check is necessary OR contact.account_id IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) OR contact.created_by IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) ); END; $$; -ALTER FUNCTION maevsi.guest_contact_ids() OWNER TO postgres; +ALTER FUNCTION vibetype.guest_contact_ids() OWNER TO postgres; -- --- Name: FUNCTION guest_contact_ids(); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION guest_contact_ids(); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.guest_contact_ids() IS 'Returns contact ids that are accessible through guests.'; +COMMENT ON FUNCTION vibetype.guest_contact_ids() IS 'Returns contact ids that are accessible through guests.'; -- --- Name: guest_count(uuid); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: guest_count(uuid); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.guest_count(event_id uuid) RETURNS integer +CREATE FUNCTION vibetype.guest_count(event_id uuid) RETURNS integer LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $_$ BEGIN - RETURN (SELECT COUNT(1) FROM maevsi.guest WHERE guest.event_id = $1); + RETURN (SELECT COUNT(1) FROM vibetype.guest WHERE guest.event_id = $1); END; $_$; -ALTER FUNCTION maevsi.guest_count(event_id uuid) OWNER TO postgres; +ALTER FUNCTION vibetype.guest_count(event_id uuid) OWNER TO postgres; -- --- Name: FUNCTION guest_count(event_id uuid); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION guest_count(event_id uuid); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.guest_count(event_id uuid) IS 'Returns the guest count for an event.'; +COMMENT ON FUNCTION vibetype.guest_count(event_id uuid) IS 'Returns the guest count for an event.'; -- --- Name: invite(uuid, text); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: invite(uuid, text); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.invite(guest_id uuid, language text) RETURNS uuid +CREATE FUNCTION vibetype.invite(guest_id uuid, language text) RETURNS uuid LANGUAGE plpgsql STRICT SECURITY DEFINER AS $$ DECLARE @@ -1292,19 +1292,19 @@ DECLARE BEGIN -- Guest UUID SELECT * INTO _guest - FROM maevsi.guest + FROM vibetype.guest WHERE guest.id = invite.guest_id; IF ( _guest IS NULL OR - _guest.event_id NOT IN (SELECT maevsi.events_organized()) -- Initial validation, every query below is expected to be secure. + _guest.event_id NOT IN (SELECT vibetype.events_organized()) -- Initial validation, every query below is expected to be secure. ) THEN RAISE 'Guest not accessible!' USING ERRCODE = 'no_data_found'; END IF; -- Event - SELECT * INTO _event FROM maevsi.event WHERE id = _guest.event_id; + SELECT * INTO _event FROM vibetype.event WHERE id = _guest.event_id; IF (_event IS NULL) THEN RAISE 'Event not accessible!' USING ERRCODE = 'no_data_found'; @@ -1312,7 +1312,7 @@ BEGIN -- Contact SELECT account_id, email_address INTO _contact - FROM maevsi.contact + FROM vibetype.contact WHERE id = _guest.contact_id; IF (_contact IS NULL) THEN @@ -1328,7 +1328,7 @@ BEGIN ELSE -- Account SELECT email_address INTO _email_address - FROM maevsi_private.account + FROM vibetype_private.account WHERE id = _contact.account_id; IF (_email_address IS NULL) THEN @@ -1338,16 +1338,16 @@ BEGIN -- Event creator username SELECT username INTO _event_creator_username - FROM maevsi.account + FROM vibetype.account WHERE id = _event.created_by; -- Event creator profile picture storage key SELECT u.storage_key INTO _event_creator_profile_picture_upload_storage_key - FROM maevsi.profile_picture p - JOIN maevsi.upload u ON p.upload_id = u.id + FROM vibetype.profile_picture p + JOIN vibetype.upload u ON p.upload_id = u.id WHERE p.account_id = _event.created_by; - INSERT INTO maevsi.invitation (guest_id, channel, payload, created_by) + INSERT INTO vibetype.invitation (guest_id, channel, payload, created_by) VALUES ( invite.guest_id, 'event_invitation', @@ -1361,7 +1361,7 @@ BEGIN ), 'template', jsonb_build_object('language', invite.language) )), - maevsi.invoker_account_id() + vibetype.invoker_account_id() ) RETURNING id INTO _id; @@ -1370,20 +1370,20 @@ END; $$; -ALTER FUNCTION maevsi.invite(guest_id uuid, language text) OWNER TO postgres; +ALTER FUNCTION vibetype.invite(guest_id uuid, language text) OWNER TO postgres; -- --- Name: FUNCTION invite(guest_id uuid, language text); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION invite(guest_id uuid, language text); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.invite(guest_id uuid, language text) IS 'Adds an invitation and a notification.'; +COMMENT ON FUNCTION vibetype.invite(guest_id uuid, language text) IS 'Adds an invitation and a notification.'; -- --- Name: invoker_account_id(); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: invoker_account_id(); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.invoker_account_id() RETURNS uuid +CREATE FUNCTION vibetype.invoker_account_id() RETURNS uuid LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $$ BEGIN @@ -1392,45 +1392,45 @@ END; $$; -ALTER FUNCTION maevsi.invoker_account_id() OWNER TO postgres; +ALTER FUNCTION vibetype.invoker_account_id() OWNER TO postgres; -- --- Name: FUNCTION invoker_account_id(); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION invoker_account_id(); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.invoker_account_id() IS 'Returns the session''s account id.'; +COMMENT ON FUNCTION vibetype.invoker_account_id() IS 'Returns the session''s account id.'; -- --- Name: jwt_refresh(uuid); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: jwt_refresh(uuid); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.jwt_refresh(jwt_id uuid) RETURNS maevsi.jwt +CREATE FUNCTION vibetype.jwt_refresh(jwt_id uuid) RETURNS vibetype.jwt LANGUAGE plpgsql STRICT SECURITY DEFINER AS $_$ DECLARE _epoch_now BIGINT := EXTRACT(EPOCH FROM (SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP WITH TIME ZONE))); - _jwt maevsi.jwt; + _jwt vibetype.jwt; BEGIN SELECT (token).id, (token).account_id, (token).account_username, (token)."exp", (token).guests, (token).role INTO _jwt - FROM maevsi_private.jwt + FROM vibetype_private.jwt WHERE id = $1 AND (token)."exp" >= _epoch_now; IF (_jwt IS NULL) THEN RETURN NULL; ELSE - UPDATE maevsi_private.jwt - SET token.exp = EXTRACT(EPOCH FROM ((SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP WITH TIME ZONE)) + COALESCE(current_setting('maevsi.jwt_expiry_duration', true), '1 day')::INTERVAL)) + UPDATE vibetype_private.jwt + SET token.exp = EXTRACT(EPOCH FROM ((SELECT date_trunc('second', CURRENT_TIMESTAMP::TIMESTAMP WITH TIME ZONE)) + COALESCE(current_setting('vibetype.jwt_expiry_duration', true), '1 day')::INTERVAL)) WHERE id = $1; - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET last_activity = DEFAULT WHERE account.id = _jwt.account_id; RETURN ( SELECT token - FROM maevsi_private.jwt + FROM vibetype_private.jwt WHERE id = $1 AND (token)."exp" >= _epoch_now ); @@ -1439,20 +1439,20 @@ END; $_$; -ALTER FUNCTION maevsi.jwt_refresh(jwt_id uuid) OWNER TO postgres; +ALTER FUNCTION vibetype.jwt_refresh(jwt_id uuid) OWNER TO postgres; -- --- Name: FUNCTION jwt_refresh(jwt_id uuid); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION jwt_refresh(jwt_id uuid); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.jwt_refresh(jwt_id uuid) IS 'Refreshes a JWT.'; +COMMENT ON FUNCTION vibetype.jwt_refresh(jwt_id uuid) IS 'Refreshes a JWT.'; -- --- Name: language_iso_full_text_search(maevsi.language); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: language_iso_full_text_search(vibetype.language); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.language_iso_full_text_search(language maevsi.language) RETURNS regconfig +CREATE FUNCTION vibetype.language_iso_full_text_search(language vibetype.language) RETURNS regconfig LANGUAGE plpgsql STABLE SECURITY DEFINER AS $$ BEGIN @@ -1491,20 +1491,20 @@ END; $$; -ALTER FUNCTION maevsi.language_iso_full_text_search(language maevsi.language) OWNER TO postgres; +ALTER FUNCTION vibetype.language_iso_full_text_search(language vibetype.language) OWNER TO postgres; -- --- Name: FUNCTION language_iso_full_text_search(language maevsi.language); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION language_iso_full_text_search(language vibetype.language); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.language_iso_full_text_search(language maevsi.language) IS 'Maps an ISO language code to the corresponding PostgreSQL text search configuration. This function returns the appropriate text search configuration for supported languages, such as "german" for "de" and "english" for "en". If the language code is not explicitly handled, the function defaults to the "simple" configuration, which is a basic tokenizer that does not perform stemming or handle stop words. This ensures that full-text search can work with a wide range of languages even if specific optimizations are not available for some.'; +COMMENT ON FUNCTION vibetype.language_iso_full_text_search(language vibetype.language) IS 'Maps an ISO language code to the corresponding PostgreSQL text search configuration. This function returns the appropriate text search configuration for supported languages, such as "german" for "de" and "english" for "en". If the language code is not explicitly handled, the function defaults to the "simple" configuration, which is a basic tokenizer that does not perform stemming or handle stop words. This ensures that full-text search can work with a wide range of languages even if specific optimizations are not available for some.'; -- --- Name: legal_term_change(); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: legal_term_change(); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.legal_term_change() RETURNS trigger +CREATE FUNCTION vibetype.legal_term_change() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN @@ -1514,20 +1514,20 @@ END; $$; -ALTER FUNCTION maevsi.legal_term_change() OWNER TO postgres; +ALTER FUNCTION vibetype.legal_term_change() OWNER TO postgres; -- --- Name: notification_acknowledge(uuid, boolean); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: notification_acknowledge(uuid, boolean); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.notification_acknowledge(id uuid, is_acknowledged boolean) RETURNS void +CREATE FUNCTION vibetype.notification_acknowledge(id uuid, is_acknowledged boolean) RETURNS void LANGUAGE plpgsql STRICT SECURITY DEFINER AS $$ DECLARE update_count INTEGER; BEGIN - UPDATE maevsi_private.notification SET + UPDATE vibetype_private.notification SET is_acknowledged = notification_acknowledge.is_acknowledged WHERE id = notification_acknowledge.id; @@ -1540,24 +1540,24 @@ END; $$; -ALTER FUNCTION maevsi.notification_acknowledge(id uuid, is_acknowledged boolean) OWNER TO postgres; +ALTER FUNCTION vibetype.notification_acknowledge(id uuid, is_acknowledged boolean) OWNER TO postgres; -- --- Name: FUNCTION notification_acknowledge(id uuid, is_acknowledged boolean); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION notification_acknowledge(id uuid, is_acknowledged boolean); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.notification_acknowledge(id uuid, is_acknowledged boolean) IS 'Allows to set the acknowledgement state of a notification.'; +COMMENT ON FUNCTION vibetype.notification_acknowledge(id uuid, is_acknowledged boolean) IS 'Allows to set the acknowledgement state of a notification.'; -- --- Name: profile_picture_set(uuid); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: profile_picture_set(uuid); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.profile_picture_set(upload_id uuid) RETURNS void +CREATE FUNCTION vibetype.profile_picture_set(upload_id uuid) RETURNS void LANGUAGE plpgsql STRICT AS $_$ BEGIN - INSERT INTO maevsi.profile_picture(account_id, upload_id) + INSERT INTO vibetype.profile_picture(account_id, upload_id) VALUES ( current_setting('jwt.claims.account_id')::UUID, $1 @@ -1569,34 +1569,34 @@ END; $_$; -ALTER FUNCTION maevsi.profile_picture_set(upload_id uuid) OWNER TO postgres; +ALTER FUNCTION vibetype.profile_picture_set(upload_id uuid) OWNER TO postgres; -- --- Name: FUNCTION profile_picture_set(upload_id uuid); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION profile_picture_set(upload_id uuid); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.profile_picture_set(upload_id uuid) IS 'Sets the picture with the given upload id as the invoker''s profile picture.'; +COMMENT ON FUNCTION vibetype.profile_picture_set(upload_id uuid) IS 'Sets the picture with the given upload id as the invoker''s profile picture.'; -- --- Name: trigger_contact_update_account_id(); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: trigger_contact_update_account_id(); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.trigger_contact_update_account_id() RETURNS trigger +CREATE FUNCTION vibetype.trigger_contact_update_account_id() RETURNS trigger LANGUAGE plpgsql STRICT SECURITY DEFINER AS $$ BEGIN IF ( -- invoked without account it - maevsi.invoker_account_id() IS NULL + vibetype.invoker_account_id() IS NULL OR -- invoked with account it -- and ( -- updating own account's contact - OLD.account_id = maevsi.invoker_account_id() + OLD.account_id = vibetype.invoker_account_id() AND - OLD.created_by = maevsi.invoker_account_id() + OLD.created_by = vibetype.invoker_account_id() AND ( -- trying to detach from account @@ -1614,26 +1614,26 @@ CREATE FUNCTION maevsi.trigger_contact_update_account_id() RETURNS trigger $$; -ALTER FUNCTION maevsi.trigger_contact_update_account_id() OWNER TO postgres; +ALTER FUNCTION vibetype.trigger_contact_update_account_id() OWNER TO postgres; -- --- Name: FUNCTION trigger_contact_update_account_id(); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION trigger_contact_update_account_id(); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.trigger_contact_update_account_id() IS 'Prevents invalid updates to contacts.'; +COMMENT ON FUNCTION vibetype.trigger_contact_update_account_id() IS 'Prevents invalid updates to contacts.'; -- --- Name: trigger_event_search_vector(); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: trigger_event_search_vector(); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.trigger_event_search_vector() RETURNS trigger +CREATE FUNCTION vibetype.trigger_event_search_vector() RETURNS trigger LANGUAGE plpgsql STRICT SECURITY DEFINER AS $$ DECLARE ts_config regconfig; BEGIN - ts_config := maevsi.language_iso_full_text_search(NEW.language); + ts_config := vibetype.language_iso_full_text_search(NEW.language); NEW.search_vector := setweight(to_tsvector(ts_config, NEW.name), 'A') || @@ -1644,20 +1644,20 @@ END; $$; -ALTER FUNCTION maevsi.trigger_event_search_vector() OWNER TO postgres; +ALTER FUNCTION vibetype.trigger_event_search_vector() OWNER TO postgres; -- --- Name: FUNCTION trigger_event_search_vector(); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION trigger_event_search_vector(); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.trigger_event_search_vector() IS 'Generates a search vector for the event based on the name and description columns, weighted by their relevance and language configuration.'; +COMMENT ON FUNCTION vibetype.trigger_event_search_vector() IS 'Generates a search vector for the event based on the name and description columns, weighted by their relevance and language configuration.'; -- --- Name: trigger_guest_update(); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: trigger_guest_update(); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.trigger_guest_update() RETURNS trigger +CREATE FUNCTION vibetype.trigger_guest_update() RETURNS trigger LANGUAGE plpgsql STRICT AS $$ DECLARE @@ -1666,15 +1666,15 @@ BEGIN IF TG_OP = 'UPDATE' AND ( -- Invited. - OLD.id = ANY (maevsi.guest_claim_array()) + OLD.id = ANY (vibetype.guest_claim_array()) OR ( - maevsi.invoker_account_id() IS NOT NULL + vibetype.invoker_account_id() IS NOT NULL AND OLD.contact_id IN ( SELECT id - FROM maevsi.contact - WHERE contact.account_id = maevsi.invoker_account_id() + FROM vibetype.contact + WHERE contact.account_id = vibetype.invoker_account_id() ) ) ) @@ -1689,51 +1689,51 @@ BEGIN RAISE 'You''re only allowed to alter these rows: %!', whitelisted_cols USING ERRCODE = 'insufficient_privilege'; ELSE NEW.updated_at = CURRENT_TIMESTAMP; - NEW.updated_by = maevsi.invoker_account_id(); + NEW.updated_by = vibetype.invoker_account_id(); RETURN NEW; END IF; END $$; -ALTER FUNCTION maevsi.trigger_guest_update() OWNER TO postgres; +ALTER FUNCTION vibetype.trigger_guest_update() OWNER TO postgres; -- --- Name: FUNCTION trigger_guest_update(); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION trigger_guest_update(); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.trigger_guest_update() IS 'Checks if the caller has permissions to alter the desired columns.'; +COMMENT ON FUNCTION vibetype.trigger_guest_update() IS 'Checks if the caller has permissions to alter the desired columns.'; -- --- Name: trigger_metadata_update(); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: trigger_metadata_update(); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.trigger_metadata_update() RETURNS trigger +CREATE FUNCTION vibetype.trigger_metadata_update() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN NEW.updated_at = CURRENT_TIMESTAMP; - NEW.updated_by = maevsi.invoker_account_id(); + NEW.updated_by = vibetype.invoker_account_id(); RETURN NEW; END; $$; -ALTER FUNCTION maevsi.trigger_metadata_update() OWNER TO postgres; +ALTER FUNCTION vibetype.trigger_metadata_update() OWNER TO postgres; -- --- Name: FUNCTION trigger_metadata_update(); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION trigger_metadata_update(); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.trigger_metadata_update() IS 'Trigger function to automatically update metadata fields `updated_at` and `updated_by` when a row is modified. Sets `updated_at` to the current timestamp and `updated_by` to the account ID of the invoker.'; +COMMENT ON FUNCTION vibetype.trigger_metadata_update() IS 'Trigger function to automatically update metadata fields `updated_at` and `updated_by` when a row is modified. Sets `updated_at` to the current timestamp and `updated_by` to the account ID of the invoker.'; -- --- Name: upload; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: upload; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.upload ( +CREATE TABLE vibetype.upload ( id uuid DEFAULT gen_random_uuid() NOT NULL, account_id uuid NOT NULL, name text, @@ -1746,86 +1746,86 @@ CREATE TABLE maevsi.upload ( ); -ALTER TABLE maevsi.upload OWNER TO postgres; +ALTER TABLE vibetype.upload OWNER TO postgres; -- --- Name: TABLE upload; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE upload; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.upload IS 'An upload.'; +COMMENT ON TABLE vibetype.upload IS 'An upload.'; -- --- Name: COLUMN upload.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN upload.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.upload.id IS '@omit create,update +COMMENT ON COLUMN vibetype.upload.id IS '@omit create,update The upload''s internal id.'; -- --- Name: COLUMN upload.account_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN upload.account_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.upload.account_id IS 'The uploader''s account id.'; +COMMENT ON COLUMN vibetype.upload.account_id IS 'The uploader''s account id.'; -- --- Name: COLUMN upload.name; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN upload.name; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.upload.name IS 'The name of the uploaded file.'; +COMMENT ON COLUMN vibetype.upload.name IS 'The name of the uploaded file.'; -- --- Name: COLUMN upload.size_byte; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN upload.size_byte; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.upload.size_byte IS 'The upload''s size in bytes.'; +COMMENT ON COLUMN vibetype.upload.size_byte IS 'The upload''s size in bytes.'; -- --- Name: COLUMN upload.storage_key; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN upload.storage_key; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.upload.storage_key IS 'The upload''s storage key.'; +COMMENT ON COLUMN vibetype.upload.storage_key IS 'The upload''s storage key.'; -- --- Name: COLUMN upload.type; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN upload.type; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.upload.type IS 'The type of the uploaded file, default is ''image''.'; +COMMENT ON COLUMN vibetype.upload.type IS 'The type of the uploaded file, default is ''image''.'; -- --- Name: COLUMN upload.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN upload.created_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.upload.created_at IS '@omit create,update +COMMENT ON COLUMN vibetype.upload.created_at IS '@omit create,update Timestamp of when the upload was created, defaults to the current timestamp.'; -- --- Name: upload_create(bigint); Type: FUNCTION; Schema: maevsi; Owner: postgres +-- Name: upload_create(bigint); Type: FUNCTION; Schema: vibetype; Owner: postgres -- -CREATE FUNCTION maevsi.upload_create(size_byte bigint) RETURNS maevsi.upload +CREATE FUNCTION vibetype.upload_create(size_byte bigint) RETURNS vibetype.upload LANGUAGE plpgsql STRICT SECURITY DEFINER AS $_$ DECLARE - _upload maevsi.upload; + _upload vibetype.upload; BEGIN IF (COALESCE(( SELECT SUM(upload.size_byte) - FROM maevsi.upload + FROM vibetype.upload WHERE upload.account_id = current_setting('jwt.claims.account_id')::UUID ), 0) + $1 <= ( SELECT upload_quota_bytes - FROM maevsi_private.account + FROM vibetype_private.account WHERE account.id = current_setting('jwt.claims.account_id')::UUID )) THEN - INSERT INTO maevsi.upload(account_id, size_byte) + INSERT INTO vibetype.upload(account_id, size_byte) VALUES (current_setting('jwt.claims.account_id')::UUID, $1) RETURNING upload.id INTO _upload; @@ -1837,51 +1837,51 @@ END; $_$; -ALTER FUNCTION maevsi.upload_create(size_byte bigint) OWNER TO postgres; +ALTER FUNCTION vibetype.upload_create(size_byte bigint) OWNER TO postgres; -- --- Name: FUNCTION upload_create(size_byte bigint); Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: FUNCTION upload_create(size_byte bigint); Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON FUNCTION maevsi.upload_create(size_byte bigint) IS 'Creates an upload with the given size if quota is available.'; +COMMENT ON FUNCTION vibetype.upload_create(size_byte bigint) IS 'Creates an upload with the given size if quota is available.'; -- --- Name: account_block_ids(); Type: FUNCTION; Schema: maevsi_private; Owner: postgres +-- Name: account_block_ids(); Type: FUNCTION; Schema: vibetype_private; Owner: postgres -- -CREATE FUNCTION maevsi_private.account_block_ids() RETURNS TABLE(id uuid) +CREATE FUNCTION vibetype_private.account_block_ids() RETURNS TABLE(id uuid) LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $$ BEGIN RETURN QUERY -- users blocked by the current user SELECT blocked_account_id - FROM maevsi.account_block - WHERE created_by = maevsi.invoker_account_id() + FROM vibetype.account_block + WHERE created_by = vibetype.invoker_account_id() UNION ALL -- users who blocked the current user SELECT created_by - FROM maevsi.account_block - WHERE blocked_account_id = maevsi.invoker_account_id(); + FROM vibetype.account_block + WHERE blocked_account_id = vibetype.invoker_account_id(); END $$; -ALTER FUNCTION maevsi_private.account_block_ids() OWNER TO postgres; +ALTER FUNCTION vibetype_private.account_block_ids() OWNER TO postgres; -- --- Name: FUNCTION account_block_ids(); Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: FUNCTION account_block_ids(); Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON FUNCTION maevsi_private.account_block_ids() IS 'Returns all account ids being blocked by the invoker and all accounts that blocked the invoker.'; +COMMENT ON FUNCTION vibetype_private.account_block_ids() IS 'Returns all account ids being blocked by the invoker and all accounts that blocked the invoker.'; -- --- Name: account_email_address_verification_valid_until(); Type: FUNCTION; Schema: maevsi_private; Owner: postgres +-- Name: account_email_address_verification_valid_until(); Type: FUNCTION; Schema: vibetype_private; Owner: postgres -- -CREATE FUNCTION maevsi_private.account_email_address_verification_valid_until() RETURNS trigger +CREATE FUNCTION vibetype_private.account_email_address_verification_valid_until() RETURNS trigger LANGUAGE plpgsql STRICT SECURITY DEFINER AS $$ BEGIN @@ -1898,20 +1898,20 @@ CREATE FUNCTION maevsi_private.account_email_address_verification_valid_until() $$; -ALTER FUNCTION maevsi_private.account_email_address_verification_valid_until() OWNER TO postgres; +ALTER FUNCTION vibetype_private.account_email_address_verification_valid_until() OWNER TO postgres; -- --- Name: FUNCTION account_email_address_verification_valid_until(); Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: FUNCTION account_email_address_verification_valid_until(); Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON FUNCTION maevsi_private.account_email_address_verification_valid_until() IS 'Sets the valid until column of the email address verification to it''s default value.'; +COMMENT ON FUNCTION vibetype_private.account_email_address_verification_valid_until() IS 'Sets the valid until column of the email address verification to it''s default value.'; -- --- Name: account_password_reset_verification_valid_until(); Type: FUNCTION; Schema: maevsi_private; Owner: postgres +-- Name: account_password_reset_verification_valid_until(); Type: FUNCTION; Schema: vibetype_private; Owner: postgres -- -CREATE FUNCTION maevsi_private.account_password_reset_verification_valid_until() RETURNS trigger +CREATE FUNCTION vibetype_private.account_password_reset_verification_valid_until() RETURNS trigger LANGUAGE plpgsql STRICT SECURITY DEFINER AS $$ BEGIN @@ -1928,73 +1928,73 @@ CREATE FUNCTION maevsi_private.account_password_reset_verification_valid_until() $$; -ALTER FUNCTION maevsi_private.account_password_reset_verification_valid_until() OWNER TO postgres; +ALTER FUNCTION vibetype_private.account_password_reset_verification_valid_until() OWNER TO postgres; -- --- Name: FUNCTION account_password_reset_verification_valid_until(); Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: FUNCTION account_password_reset_verification_valid_until(); Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON FUNCTION maevsi_private.account_password_reset_verification_valid_until() IS 'Sets the valid until column of the email address verification to it''s default value.'; +COMMENT ON FUNCTION vibetype_private.account_password_reset_verification_valid_until() IS 'Sets the valid until column of the email address verification to it''s default value.'; -- --- Name: events_invited(); Type: FUNCTION; Schema: maevsi_private; Owner: postgres +-- Name: events_invited(); Type: FUNCTION; Schema: vibetype_private; Owner: postgres -- -CREATE FUNCTION maevsi_private.events_invited() RETURNS TABLE(event_id uuid) +CREATE FUNCTION vibetype_private.events_invited() RETURNS TABLE(event_id uuid) LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $$ BEGIN RETURN QUERY -- get all events for guests - SELECT guest.event_id FROM maevsi.guest + SELECT guest.event_id FROM vibetype.guest WHERE ( -- whose guest guest.contact_id IN ( SELECT id - FROM maevsi.contact + FROM vibetype.contact WHERE -- is the requesting user - account_id = maevsi.invoker_account_id() -- if the invoker account id is `NULL` this does *not* return contacts for which `account_id` is NULL (an `IS` instead of `=` comparison would) + account_id = vibetype.invoker_account_id() -- if the invoker account id is `NULL` this does *not* return contacts for which `account_id` is NULL (an `IS` instead of `=` comparison would) AND -- who is not invited by created_by NOT IN ( - SELECT id FROM maevsi_private.account_block_ids() + SELECT id FROM vibetype_private.account_block_ids() ) ) -- TODO: it appears blocking should be accounted for after all other criteria using the event author instead ) OR -- for which the requesting user knows the id - guest.id = ANY (maevsi.guest_claim_array()); + guest.id = ANY (vibetype.guest_claim_array()); END $$; -ALTER FUNCTION maevsi_private.events_invited() OWNER TO postgres; +ALTER FUNCTION vibetype_private.events_invited() OWNER TO postgres; -- --- Name: FUNCTION events_invited(); Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: FUNCTION events_invited(); Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON FUNCTION maevsi_private.events_invited() IS 'Add a function that returns all event ids for which the invoker is invited.'; +COMMENT ON FUNCTION vibetype_private.events_invited() IS 'Add a function that returns all event ids for which the invoker is invited.'; -- --- Name: account_block_create(uuid, uuid); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: account_block_create(uuid, uuid); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.account_block_create(_created_by uuid, _blocked_account_id uuid) RETURNS uuid +CREATE FUNCTION vibetype_test.account_block_create(_created_by uuid, _blocked_account_id uuid) RETURNS uuid LANGUAGE plpgsql AS $$ DECLARE _id UUID; BEGIN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - INSERT INTO maevsi.account_block(created_by, blocked_account_id) + INSERT INTO vibetype.account_block(created_by, blocked_account_id) VALUES (_created_by, _blocked_Account_id) RETURNING id INTO _id; @@ -2004,62 +2004,62 @@ BEGIN END $$; -ALTER FUNCTION maevsi_test.account_block_create(_created_by uuid, _blocked_account_id uuid) OWNER TO postgres; +ALTER FUNCTION vibetype_test.account_block_create(_created_by uuid, _blocked_account_id uuid) OWNER TO postgres; -- --- Name: account_block_remove(uuid, uuid); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: account_block_remove(uuid, uuid); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.account_block_remove(_created_by uuid, _blocked_account_id uuid) RETURNS void +CREATE FUNCTION vibetype_test.account_block_remove(_created_by uuid, _blocked_account_id uuid) RETURNS void LANGUAGE plpgsql AS $$ DECLARE _id UUID; BEGIN - DELETE FROM maevsi.account_block + DELETE FROM vibetype.account_block WHERE created_by = _created_by and blocked_account_id = _blocked_account_id; END $$; -ALTER FUNCTION maevsi_test.account_block_remove(_created_by uuid, _blocked_account_id uuid) OWNER TO postgres; +ALTER FUNCTION vibetype_test.account_block_remove(_created_by uuid, _blocked_account_id uuid) OWNER TO postgres; -- --- Name: account_create(text, text); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: account_create(text, text); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.account_create(_username text, _email text) RETURNS uuid +CREATE FUNCTION vibetype_test.account_create(_username text, _email text) RETURNS uuid LANGUAGE plpgsql AS $$ DECLARE _id UUID; _verification UUID; BEGIN - _id := maevsi.account_registration(_username, _email, 'password', 'en'); + _id := vibetype.account_registration(_username, _email, 'password', 'en'); SELECT email_address_verification INTO _verification - FROM maevsi_private.account + FROM vibetype_private.account WHERE id = _id; - PERFORM maevsi.account_email_address_verification(_verification); + PERFORM vibetype.account_email_address_verification(_verification); RETURN _id; END $$; -ALTER FUNCTION maevsi_test.account_create(_username text, _email text) OWNER TO postgres; +ALTER FUNCTION vibetype_test.account_create(_username text, _email text) OWNER TO postgres; -- --- Name: account_filter_radius_event(uuid, double precision); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: account_filter_radius_event(uuid, double precision); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.account_filter_radius_event(_event_id uuid, _distance_max double precision) RETURNS TABLE(account_id uuid, distance double precision) +CREATE FUNCTION vibetype_test.account_filter_radius_event(_event_id uuid, _distance_max double precision) RETURNS TABLE(account_id uuid, distance double precision) LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $$ BEGIN RETURN QUERY WITH event AS ( SELECT location_geography - FROM maevsi.event + FROM vibetype.event WHERE id = _event_id ) SELECT @@ -2067,27 +2067,27 @@ BEGIN ST_Distance(e.location_geography, a.location) AS distance FROM event e, - maevsi_private.account a + vibetype_private.account a WHERE ST_DWithin(e.location_geography, a.location, _distance_max * 1000); END; $$; -ALTER FUNCTION maevsi_test.account_filter_radius_event(_event_id uuid, _distance_max double precision) OWNER TO postgres; +ALTER FUNCTION vibetype_test.account_filter_radius_event(_event_id uuid, _distance_max double precision) OWNER TO postgres; -- --- Name: FUNCTION account_filter_radius_event(_event_id uuid, _distance_max double precision); Type: COMMENT; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION account_filter_radius_event(_event_id uuid, _distance_max double precision); Type: COMMENT; Schema: vibetype_test; Owner: postgres -- -COMMENT ON FUNCTION maevsi_test.account_filter_radius_event(_event_id uuid, _distance_max double precision) IS 'Returns account locations within a given radius around the location of an event.'; +COMMENT ON FUNCTION vibetype_test.account_filter_radius_event(_event_id uuid, _distance_max double precision) IS 'Returns account locations within a given radius around the location of an event.'; -- --- Name: account_location_coordinates(uuid); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: account_location_coordinates(uuid); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.account_location_coordinates(_account_id uuid) RETURNS double precision[] +CREATE FUNCTION vibetype_test.account_location_coordinates(_account_id uuid) RETURNS double precision[] LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $$ DECLARE @@ -2101,7 +2101,7 @@ BEGIN _latitude, _longitude FROM - maevsi_private.account + vibetype_private.account WHERE id = _account_id; @@ -2110,24 +2110,24 @@ END; $$; -ALTER FUNCTION maevsi_test.account_location_coordinates(_account_id uuid) OWNER TO postgres; +ALTER FUNCTION vibetype_test.account_location_coordinates(_account_id uuid) OWNER TO postgres; -- --- Name: FUNCTION account_location_coordinates(_account_id uuid); Type: COMMENT; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION account_location_coordinates(_account_id uuid); Type: COMMENT; Schema: vibetype_test; Owner: postgres -- -COMMENT ON FUNCTION maevsi_test.account_location_coordinates(_account_id uuid) IS 'Returns an array with latitude and longitude of the account''s current location data'; +COMMENT ON FUNCTION vibetype_test.account_location_coordinates(_account_id uuid) IS 'Returns an array with latitude and longitude of the account''s current location data'; -- --- Name: account_location_update(uuid, double precision, double precision); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: account_location_update(uuid, double precision, double precision); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.account_location_update(_account_id uuid, _latitude double precision, _longitude double precision) RETURNS void +CREATE FUNCTION vibetype_test.account_location_update(_account_id uuid, _latitude double precision, _longitude double precision) RETURNS void LANGUAGE plpgsql STRICT SECURITY DEFINER AS $$ BEGIN - UPDATE maevsi_private.account + UPDATE vibetype_private.account SET location = ST_Point(_longitude, _latitude, 4326) WHERE @@ -2136,65 +2136,65 @@ END; $$; -ALTER FUNCTION maevsi_test.account_location_update(_account_id uuid, _latitude double precision, _longitude double precision) OWNER TO postgres; +ALTER FUNCTION vibetype_test.account_location_update(_account_id uuid, _latitude double precision, _longitude double precision) OWNER TO postgres; -- --- Name: FUNCTION account_location_update(_account_id uuid, _latitude double precision, _longitude double precision); Type: COMMENT; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION account_location_update(_account_id uuid, _latitude double precision, _longitude double precision); Type: COMMENT; Schema: vibetype_test; Owner: postgres -- -COMMENT ON FUNCTION maevsi_test.account_location_update(_account_id uuid, _latitude double precision, _longitude double precision) IS 'Updates an account''s location based on latitude and longitude (GPS coordinates).'; +COMMENT ON FUNCTION vibetype_test.account_location_update(_account_id uuid, _latitude double precision, _longitude double precision) IS 'Updates an account''s location based on latitude and longitude (GPS coordinates).'; -- --- Name: account_remove(text); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: account_remove(text); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.account_remove(_username text) RETURNS void +CREATE FUNCTION vibetype_test.account_remove(_username text) RETURNS void LANGUAGE plpgsql AS $$ DECLARE _id UUID; BEGIN - SELECT id INTO _id FROM maevsi.account WHERE username = _username; + SELECT id INTO _id FROM vibetype.account WHERE username = _username; IF _id IS NOT NULL THEN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _id || ''''; - DELETE FROM maevsi.event WHERE created_by = _id; + DELETE FROM vibetype.event WHERE created_by = _id; - PERFORM maevsi.account_delete('password'); + PERFORM vibetype.account_delete('password'); SET LOCAL role = 'postgres'; END IF; END $$; -ALTER FUNCTION maevsi_test.account_remove(_username text) OWNER TO postgres; +ALTER FUNCTION vibetype_test.account_remove(_username text) OWNER TO postgres; -- --- Name: contact_create(uuid, text); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: contact_create(uuid, text); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.contact_create(_created_by uuid, _email_address text) RETURNS uuid +CREATE FUNCTION vibetype_test.contact_create(_created_by uuid, _email_address text) RETURNS uuid LANGUAGE plpgsql AS $$ DECLARE _id UUID; _account_id UUID; BEGIN - SELECT id FROM maevsi_private.account WHERE email_address = _email_address INTO _account_id; + SELECT id FROM vibetype_private.account WHERE email_address = _email_address INTO _account_id; - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - INSERT INTO maevsi.contact(created_by, email_address) + INSERT INTO vibetype.contact(created_by, email_address) VALUES (_created_by, _email_address) RETURNING id INTO _id; IF (_account_id IS NOT NULL) THEN - UPDATE maevsi.contact SET account_id = _account_id WHERE id = _id; + UPDATE vibetype.contact SET account_id = _account_id WHERE id = _id; END IF; SET LOCAL role = 'postgres'; @@ -2203,51 +2203,51 @@ BEGIN END $$; -ALTER FUNCTION maevsi_test.contact_create(_created_by uuid, _email_address text) OWNER TO postgres; +ALTER FUNCTION vibetype_test.contact_create(_created_by uuid, _email_address text) OWNER TO postgres; -- --- Name: contact_select_by_account_id(uuid); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: contact_select_by_account_id(uuid); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.contact_select_by_account_id(_account_id uuid) RETURNS uuid +CREATE FUNCTION vibetype_test.contact_select_by_account_id(_account_id uuid) RETURNS uuid LANGUAGE plpgsql AS $$ DECLARE _id UUID; BEGIN SELECT id INTO _id - FROM maevsi.contact + FROM vibetype.contact WHERE created_by = _account_id AND account_id = _account_id; RETURN _id; END $$; -ALTER FUNCTION maevsi_test.contact_select_by_account_id(_account_id uuid) OWNER TO postgres; +ALTER FUNCTION vibetype_test.contact_select_by_account_id(_account_id uuid) OWNER TO postgres; -- --- Name: contact_test(text, uuid, uuid[]); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: contact_test(text, uuid, uuid[]); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.contact_test(_test_case text, _account_id uuid, _expected_result uuid[]) RETURNS void +CREATE FUNCTION vibetype_test.contact_test(_test_case text, _account_id uuid, _expected_result uuid[]) RETURNS void LANGUAGE plpgsql AS $$ DECLARE rec RECORD; BEGIN IF _account_id IS NULL THEN - SET LOCAL role = 'maevsi_anonymous'; + SET LOCAL role = 'vibetype_anonymous'; SET LOCAL jwt.claims.account_id = ''; ELSE - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; END IF; - IF EXISTS (SELECT id FROM maevsi.contact EXCEPT SELECT * FROM unnest(_expected_result)) THEN + IF EXISTS (SELECT id FROM vibetype.contact EXCEPT SELECT * FROM unnest(_expected_result)) THEN RAISE EXCEPTION 'some contact should not appear in the query result'; END IF; - IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM maevsi.contact) THEN + IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM vibetype.contact) THEN RAISE EXCEPTION 'some contact is missing in the query result'; END IF; @@ -2255,63 +2255,63 @@ BEGIN END $$; -ALTER FUNCTION maevsi_test.contact_test(_test_case text, _account_id uuid, _expected_result uuid[]) OWNER TO postgres; +ALTER FUNCTION vibetype_test.contact_test(_test_case text, _account_id uuid, _expected_result uuid[]) OWNER TO postgres; -- --- Name: event_category_create(text); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: event_category_create(text); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.event_category_create(_category text) RETURNS void +CREATE FUNCTION vibetype_test.event_category_create(_category text) RETURNS void LANGUAGE plpgsql AS $$ BEGIN - INSERT INTO maevsi.event_category(category) VALUES (_category); + INSERT INTO vibetype.event_category(category) VALUES (_category); END $$; -ALTER FUNCTION maevsi_test.event_category_create(_category text) OWNER TO postgres; +ALTER FUNCTION vibetype_test.event_category_create(_category text) OWNER TO postgres; -- --- Name: event_category_mapping_create(uuid, uuid, text); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: event_category_mapping_create(uuid, uuid, text); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.event_category_mapping_create(_created_by uuid, _event_id uuid, _category text) RETURNS void +CREATE FUNCTION vibetype_test.event_category_mapping_create(_created_by uuid, _event_id uuid, _category text) RETURNS void LANGUAGE plpgsql AS $$ BEGIN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - INSERT INTO maevsi.event_category_mapping(event_id, category) + INSERT INTO vibetype.event_category_mapping(event_id, category) VALUES (_event_id, _category); SET LOCAL role = 'postgres'; END $$; -ALTER FUNCTION maevsi_test.event_category_mapping_create(_created_by uuid, _event_id uuid, _category text) OWNER TO postgres; +ALTER FUNCTION vibetype_test.event_category_mapping_create(_created_by uuid, _event_id uuid, _category text) OWNER TO postgres; -- --- Name: event_category_mapping_test(text, uuid, uuid[]); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: event_category_mapping_test(text, uuid, uuid[]); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.event_category_mapping_test(_test_case text, _account_id uuid, _expected_result uuid[]) RETURNS void +CREATE FUNCTION vibetype_test.event_category_mapping_test(_test_case text, _account_id uuid, _expected_result uuid[]) RETURNS void LANGUAGE plpgsql AS $$ BEGIN IF _account_id IS NULL THEN - SET LOCAL role = 'maevsi_anonymous'; + SET LOCAL role = 'vibetype_anonymous'; SET LOCAL jwt.claims.account_id = ''; ELSE - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; END IF; - IF EXISTS (SELECT event_id FROM maevsi.event_category_mapping EXCEPT SELECT * FROM unnest(_expected_result)) THEN + IF EXISTS (SELECT event_id FROM vibetype.event_category_mapping EXCEPT SELECT * FROM unnest(_expected_result)) THEN RAISE EXCEPTION 'some event_category_mappings should not appear in the query result'; END IF; - IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT event_id FROM maevsi.event_category_mapping) THEN + IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT event_id FROM vibetype.event_category_mapping) THEN RAISE EXCEPTION 'some event_category_mappings is missing in the query result'; END IF; @@ -2319,23 +2319,23 @@ BEGIN END $$; -ALTER FUNCTION maevsi_test.event_category_mapping_test(_test_case text, _account_id uuid, _expected_result uuid[]) OWNER TO postgres; +ALTER FUNCTION vibetype_test.event_category_mapping_test(_test_case text, _account_id uuid, _expected_result uuid[]) OWNER TO postgres; -- --- Name: event_create(uuid, text, text, text, text); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: event_create(uuid, text, text, text, text); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.event_create(_created_by uuid, _name text, _slug text, _start text, _visibility text) RETURNS uuid +CREATE FUNCTION vibetype_test.event_create(_created_by uuid, _name text, _slug text, _start text, _visibility text) RETURNS uuid LANGUAGE plpgsql AS $$ DECLARE _id UUID; BEGIN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - INSERT INTO maevsi.event(created_by, name, slug, start, visibility) - VALUES (_created_by, _name, _slug, _start::TIMESTAMP WITH TIME ZONE, _visibility::maevsi.event_visibility) + INSERT INTO vibetype.event(created_by, name, slug, start, visibility) + VALUES (_created_by, _name, _slug, _start::TIMESTAMP WITH TIME ZONE, _visibility::vibetype.event_visibility) RETURNING id INTO _id; SET LOCAL role = 'postgres'; @@ -2344,20 +2344,20 @@ BEGIN END $$; -ALTER FUNCTION maevsi_test.event_create(_created_by uuid, _name text, _slug text, _start text, _visibility text) OWNER TO postgres; +ALTER FUNCTION vibetype_test.event_create(_created_by uuid, _name text, _slug text, _start text, _visibility text) OWNER TO postgres; -- --- Name: event_filter_radius_account(uuid, double precision); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: event_filter_radius_account(uuid, double precision); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.event_filter_radius_account(_account_id uuid, _distance_max double precision) RETURNS TABLE(event_id uuid, distance double precision) +CREATE FUNCTION vibetype_test.event_filter_radius_account(_account_id uuid, _distance_max double precision) RETURNS TABLE(event_id uuid, distance double precision) LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $$ BEGIN RETURN QUERY WITH account AS ( SELECT location - FROM maevsi_private.account + FROM vibetype_private.account WHERE id = _account_id ) SELECT @@ -2365,27 +2365,27 @@ BEGIN ST_Distance(a.location, e.location_geography) AS distance FROM account a, - maevsi.event e + vibetype.event e WHERE ST_DWithin(a.location, e.location_geography, _distance_max * 1000); END; $$; -ALTER FUNCTION maevsi_test.event_filter_radius_account(_account_id uuid, _distance_max double precision) OWNER TO postgres; +ALTER FUNCTION vibetype_test.event_filter_radius_account(_account_id uuid, _distance_max double precision) OWNER TO postgres; -- --- Name: FUNCTION event_filter_radius_account(_account_id uuid, _distance_max double precision); Type: COMMENT; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION event_filter_radius_account(_account_id uuid, _distance_max double precision); Type: COMMENT; Schema: vibetype_test; Owner: postgres -- -COMMENT ON FUNCTION maevsi_test.event_filter_radius_account(_account_id uuid, _distance_max double precision) IS 'Returns event locations within a given radius around the location of an account.'; +COMMENT ON FUNCTION vibetype_test.event_filter_radius_account(_account_id uuid, _distance_max double precision) IS 'Returns event locations within a given radius around the location of an account.'; -- --- Name: event_location_coordinates(uuid); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: event_location_coordinates(uuid); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.event_location_coordinates(_event_id uuid) RETURNS double precision[] +CREATE FUNCTION vibetype_test.event_location_coordinates(_event_id uuid) RETURNS double precision[] LANGUAGE plpgsql STABLE STRICT SECURITY DEFINER AS $$ DECLARE @@ -2399,7 +2399,7 @@ BEGIN _latitude, _longitude FROM - maevsi.event + vibetype.event WHERE id = _event_id; @@ -2408,24 +2408,24 @@ END; $$; -ALTER FUNCTION maevsi_test.event_location_coordinates(_event_id uuid) OWNER TO postgres; +ALTER FUNCTION vibetype_test.event_location_coordinates(_event_id uuid) OWNER TO postgres; -- --- Name: FUNCTION event_location_coordinates(_event_id uuid); Type: COMMENT; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION event_location_coordinates(_event_id uuid); Type: COMMENT; Schema: vibetype_test; Owner: postgres -- -COMMENT ON FUNCTION maevsi_test.event_location_coordinates(_event_id uuid) IS 'Returns an array with latitude and longitude of the event''s current location data.'; +COMMENT ON FUNCTION vibetype_test.event_location_coordinates(_event_id uuid) IS 'Returns an array with latitude and longitude of the event''s current location data.'; -- --- Name: event_location_update(uuid, double precision, double precision); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: event_location_update(uuid, double precision, double precision); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.event_location_update(_event_id uuid, _latitude double precision, _longitude double precision) RETURNS void +CREATE FUNCTION vibetype_test.event_location_update(_event_id uuid, _latitude double precision, _longitude double precision) RETURNS void LANGUAGE plpgsql STRICT SECURITY DEFINER AS $$ BEGIN - UPDATE maevsi.event + UPDATE vibetype.event SET location_geography = ST_Point(_longitude, _latitude, 4326) WHERE @@ -2434,36 +2434,36 @@ END; $$; -ALTER FUNCTION maevsi_test.event_location_update(_event_id uuid, _latitude double precision, _longitude double precision) OWNER TO postgres; +ALTER FUNCTION vibetype_test.event_location_update(_event_id uuid, _latitude double precision, _longitude double precision) OWNER TO postgres; -- --- Name: FUNCTION event_location_update(_event_id uuid, _latitude double precision, _longitude double precision); Type: COMMENT; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION event_location_update(_event_id uuid, _latitude double precision, _longitude double precision); Type: COMMENT; Schema: vibetype_test; Owner: postgres -- -COMMENT ON FUNCTION maevsi_test.event_location_update(_event_id uuid, _latitude double precision, _longitude double precision) IS 'Updates an event''s location based on latitude and longitude (GPS coordinates).'; +COMMENT ON FUNCTION vibetype_test.event_location_update(_event_id uuid, _latitude double precision, _longitude double precision) IS 'Updates an event''s location based on latitude and longitude (GPS coordinates).'; -- --- Name: event_test(text, uuid, uuid[]); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: event_test(text, uuid, uuid[]); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.event_test(_test_case text, _account_id uuid, _expected_result uuid[]) RETURNS void +CREATE FUNCTION vibetype_test.event_test(_test_case text, _account_id uuid, _expected_result uuid[]) RETURNS void LANGUAGE plpgsql AS $$ BEGIN IF _account_id IS NULL THEN - SET LOCAL role = 'maevsi_anonymous'; + SET LOCAL role = 'vibetype_anonymous'; SET LOCAL jwt.claims.account_id = ''; ELSE - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; END IF; - IF EXISTS (SELECT id FROM maevsi.event EXCEPT SELECT * FROM unnest(_expected_result)) THEN + IF EXISTS (SELECT id FROM vibetype.event EXCEPT SELECT * FROM unnest(_expected_result)) THEN RAISE EXCEPTION 'some event should not appear in the query result'; END IF; - IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM maevsi.event) THEN + IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM vibetype.event) THEN RAISE EXCEPTION 'some event is missing in the query result'; END IF; @@ -2471,21 +2471,21 @@ BEGIN END $$; -ALTER FUNCTION maevsi_test.event_test(_test_case text, _account_id uuid, _expected_result uuid[]) OWNER TO postgres; +ALTER FUNCTION vibetype_test.event_test(_test_case text, _account_id uuid, _expected_result uuid[]) OWNER TO postgres; -- --- Name: guest_claim_from_account_guest(uuid); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: guest_claim_from_account_guest(uuid); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.guest_claim_from_account_guest(_account_id uuid) RETURNS uuid[] +CREATE FUNCTION vibetype_test.guest_claim_from_account_guest(_account_id uuid) RETURNS uuid[] LANGUAGE plpgsql AS $$ DECLARE - _guest maevsi.guest; + _guest vibetype.guest; _result UUID[] := ARRAY[]::UUID[]; _text TEXT := ''; BEGIN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; -- reads all guests where _account_id is invited, @@ -2494,7 +2494,7 @@ BEGIN FOR _guest IN SELECT g.id - FROM maevsi.guest g JOIN maevsi.contact c + FROM vibetype.guest g JOIN vibetype.contact c ON g.contact_id = c.id WHERE c.account_id = _account_id LOOP @@ -2514,22 +2514,22 @@ BEGIN END $$; -ALTER FUNCTION maevsi_test.guest_claim_from_account_guest(_account_id uuid) OWNER TO postgres; +ALTER FUNCTION vibetype_test.guest_claim_from_account_guest(_account_id uuid) OWNER TO postgres; -- --- Name: guest_create(uuid, uuid, uuid); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: guest_create(uuid, uuid, uuid); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.guest_create(_created_by uuid, _event_id uuid, _contact_id uuid) RETURNS uuid +CREATE FUNCTION vibetype_test.guest_create(_created_by uuid, _event_id uuid, _contact_id uuid) RETURNS uuid LANGUAGE plpgsql AS $$ DECLARE _id UUID; BEGIN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _created_by || ''''; - INSERT INTO maevsi.guest(contact_id, event_id) + INSERT INTO vibetype.guest(contact_id, event_id) VALUES (_contact_id, _event_id) RETURNING id INTO _id; @@ -2539,29 +2539,29 @@ BEGIN END $$; -ALTER FUNCTION maevsi_test.guest_create(_created_by uuid, _event_id uuid, _contact_id uuid) OWNER TO postgres; +ALTER FUNCTION vibetype_test.guest_create(_created_by uuid, _event_id uuid, _contact_id uuid) OWNER TO postgres; -- --- Name: guest_test(text, uuid, uuid[]); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: guest_test(text, uuid, uuid[]); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.guest_test(_test_case text, _account_id uuid, _expected_result uuid[]) RETURNS void +CREATE FUNCTION vibetype_test.guest_test(_test_case text, _account_id uuid, _expected_result uuid[]) RETURNS void LANGUAGE plpgsql AS $$ BEGIN IF _account_id IS NULL THEN - SET LOCAL role = 'maevsi_anonymous'; + SET LOCAL role = 'vibetype_anonymous'; SET LOCAL jwt.claims.account_id = ''; ELSE - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _account_id || ''''; END IF; - IF EXISTS (SELECT id FROM maevsi.guest EXCEPT SELECT * FROM unnest(_expected_result)) THEN + IF EXISTS (SELECT id FROM vibetype.guest EXCEPT SELECT * FROM unnest(_expected_result)) THEN RAISE EXCEPTION 'some guest should not appear in the query result'; END IF; - IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM maevsi.guest) THEN + IF EXISTS (SELECT * FROM unnest(_expected_result) EXCEPT SELECT id FROM vibetype.guest) THEN RAISE EXCEPTION 'some guest is missing in the query result'; END IF; @@ -2569,43 +2569,43 @@ BEGIN END $$; -ALTER FUNCTION maevsi_test.guest_test(_test_case text, _account_id uuid, _expected_result uuid[]) OWNER TO postgres; +ALTER FUNCTION vibetype_test.guest_test(_test_case text, _account_id uuid, _expected_result uuid[]) OWNER TO postgres; -- --- Name: invoker_set(uuid); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: invoker_set(uuid); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.invoker_set(_invoker_id uuid) RETURNS void +CREATE FUNCTION vibetype_test.invoker_set(_invoker_id uuid) RETURNS void LANGUAGE plpgsql AS $$ BEGIN - SET LOCAL role = 'maevsi_account'; + SET LOCAL role = 'vibetype_account'; EXECUTE 'SET LOCAL jwt.claims.account_id = ''' || _invoker_id || ''''; END $$; -ALTER FUNCTION maevsi_test.invoker_set(_invoker_id uuid) OWNER TO postgres; +ALTER FUNCTION vibetype_test.invoker_set(_invoker_id uuid) OWNER TO postgres; -- --- Name: invoker_unset(); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: invoker_unset(); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.invoker_unset() RETURNS void +CREATE FUNCTION vibetype_test.invoker_unset() RETURNS void LANGUAGE plpgsql AS $$ BEGIN - CALL maevsi_test.set_local_superuser(); + CALL vibetype_test.set_local_superuser(); EXECUTE 'SET LOCAL jwt.claims.account_id = '''''; END $$; -ALTER FUNCTION maevsi_test.invoker_unset() OWNER TO postgres; +ALTER FUNCTION vibetype_test.invoker_unset() OWNER TO postgres; -- --- Name: uuid_array_test(text, uuid[], uuid[]); Type: FUNCTION; Schema: maevsi_test; Owner: postgres +-- Name: uuid_array_test(text, uuid[], uuid[]); Type: FUNCTION; Schema: vibetype_test; Owner: postgres -- -CREATE FUNCTION maevsi_test.uuid_array_test(_test_case text, _array uuid[], _expected_array uuid[]) RETURNS void +CREATE FUNCTION vibetype_test.uuid_array_test(_test_case text, _array uuid[], _expected_array uuid[]) RETURNS void LANGUAGE plpgsql AS $$ BEGIN @@ -2619,3603 +2619,3603 @@ BEGIN END $$; -ALTER FUNCTION maevsi_test.uuid_array_test(_test_case text, _array uuid[], _expected_array uuid[]) OWNER TO postgres; +ALTER FUNCTION vibetype_test.uuid_array_test(_test_case text, _array uuid[], _expected_array uuid[]) OWNER TO postgres; -- --- Name: account; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: changes; Type: TABLE; Schema: sqitch; Owner: postgres -- -CREATE TABLE maevsi.account ( - id uuid NOT NULL, - username text NOT NULL, - CONSTRAINT account_username_check CHECK (((char_length(username) < 100) AND (username ~ '^[-A-Za-z0-9]+$'::text))) +CREATE TABLE sqitch.changes ( + change_id text NOT NULL, + script_hash text, + change text NOT NULL, + project text NOT NULL, + note text DEFAULT ''::text NOT NULL, + committed_at timestamp with time zone DEFAULT clock_timestamp() NOT NULL, + committer_name text NOT NULL, + committer_email text NOT NULL, + planned_at timestamp with time zone NOT NULL, + planner_name text NOT NULL, + planner_email text NOT NULL ); -ALTER TABLE maevsi.account OWNER TO postgres; +ALTER TABLE sqitch.changes OWNER TO postgres; -- --- Name: TABLE account; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE changes; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON TABLE maevsi.account IS 'Public account data.'; +COMMENT ON TABLE sqitch.changes IS 'Tracks the changes currently deployed to the database.'; -- --- Name: COLUMN account.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN changes.change_id; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account.id IS 'The account''s internal id.'; +COMMENT ON COLUMN sqitch.changes.change_id IS 'Change primary key.'; -- --- Name: COLUMN account.username; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN changes.script_hash; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account.username IS 'The account''s username.'; +COMMENT ON COLUMN sqitch.changes.script_hash IS 'Deploy script SHA-1 hash.'; -- --- Name: account_block; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: COLUMN changes.change; Type: COMMENT; Schema: sqitch; Owner: postgres -- -CREATE TABLE maevsi.account_block ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - blocked_account_id uuid NOT NULL, - created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, - created_by uuid NOT NULL, - CONSTRAINT account_block_check CHECK ((created_by <> blocked_account_id)) -); - +COMMENT ON COLUMN sqitch.changes.change IS 'Name of a deployed change.'; -ALTER TABLE maevsi.account_block OWNER TO postgres; -- --- Name: TABLE account_block; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN changes.project; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON TABLE maevsi.account_block IS '@omit update,delete -Blocking of one account by another.'; +COMMENT ON COLUMN sqitch.changes.project IS 'Name of the Sqitch project to which the change belongs.'; -- --- Name: COLUMN account_block.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN changes.note; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account_block.id IS '@omit create\nThe account blocking''s internal id.'; +COMMENT ON COLUMN sqitch.changes.note IS 'Description of the change.'; -- --- Name: COLUMN account_block.blocked_account_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN changes.committed_at; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account_block.blocked_account_id IS 'The account id of the user who is blocked.'; +COMMENT ON COLUMN sqitch.changes.committed_at IS 'Date the change was deployed.'; -- --- Name: COLUMN account_block.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN changes.committer_name; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account_block.created_at IS '@omit create,update,delete -Timestamp of when the blocking was created.'; +COMMENT ON COLUMN sqitch.changes.committer_name IS 'Name of the user who deployed the change.'; -- --- Name: COLUMN account_block.created_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN changes.committer_email; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account_block.created_by IS 'The account id of the user who created the blocking.'; +COMMENT ON COLUMN sqitch.changes.committer_email IS 'Email address of the user who deployed the change.'; -- --- Name: account_interest; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: COLUMN changes.planned_at; Type: COMMENT; Schema: sqitch; Owner: postgres -- -CREATE TABLE maevsi.account_interest ( - account_id uuid NOT NULL, - category text NOT NULL -); - +COMMENT ON COLUMN sqitch.changes.planned_at IS 'Date the change was added to the plan.'; -ALTER TABLE maevsi.account_interest OWNER TO postgres; -- --- Name: TABLE account_interest; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN changes.planner_name; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON TABLE maevsi.account_interest IS 'Event categories a user account is interested in (M:N relationship).'; +COMMENT ON COLUMN sqitch.changes.planner_name IS 'Name of the user who planed the change.'; -- --- Name: COLUMN account_interest.account_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN changes.planner_email; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account_interest.account_id IS 'A user account id.'; +COMMENT ON COLUMN sqitch.changes.planner_email IS 'Email address of the user who planned the change.'; -- --- Name: COLUMN account_interest.category; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: dependencies; Type: TABLE; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account_interest.category IS 'An event category.'; +CREATE TABLE sqitch.dependencies ( + change_id text NOT NULL, + type text NOT NULL, + dependency text NOT NULL, + dependency_id text, + CONSTRAINT dependencies_check CHECK ((((type = 'require'::text) AND (dependency_id IS NOT NULL)) OR ((type = 'conflict'::text) AND (dependency_id IS NULL)))) +); + +ALTER TABLE sqitch.dependencies OWNER TO postgres; -- --- Name: account_preference_event_size; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: TABLE dependencies; Type: COMMENT; Schema: sqitch; Owner: postgres -- -CREATE TABLE maevsi.account_preference_event_size ( - account_id uuid NOT NULL, - event_size maevsi.event_size NOT NULL, - created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL -); - +COMMENT ON TABLE sqitch.dependencies IS 'Tracks the currently satisfied dependencies.'; -ALTER TABLE maevsi.account_preference_event_size OWNER TO postgres; -- --- Name: TABLE account_preference_event_size; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN dependencies.change_id; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON TABLE maevsi.account_preference_event_size IS 'Table for the user accounts'' preferred event sizes (M:N relationship).'; +COMMENT ON COLUMN sqitch.dependencies.change_id IS 'ID of the depending change.'; -- --- Name: COLUMN account_preference_event_size.account_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN dependencies.type; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account_preference_event_size.account_id IS 'The account''s internal id.'; +COMMENT ON COLUMN sqitch.dependencies.type IS 'Type of dependency.'; -- --- Name: COLUMN account_preference_event_size.event_size; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN dependencies.dependency; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account_preference_event_size.event_size IS 'A preferred event sized'; +COMMENT ON COLUMN sqitch.dependencies.dependency IS 'Dependency name.'; -- --- Name: COLUMN account_preference_event_size.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN dependencies.dependency_id; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account_preference_event_size.created_at IS '@omit create,update -Timestamp of when the event size preference was created, defaults to the current timestamp.'; +COMMENT ON COLUMN sqitch.dependencies.dependency_id IS 'Change ID the dependency resolves to.'; -- --- Name: account_social_network; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: events; Type: TABLE; Schema: sqitch; Owner: postgres -- -CREATE TABLE maevsi.account_social_network ( - account_id uuid NOT NULL, - social_network maevsi.social_network NOT NULL, - social_network_username text NOT NULL +CREATE TABLE sqitch.events ( + event text NOT NULL, + change_id text NOT NULL, + change text NOT NULL, + project text NOT NULL, + note text DEFAULT ''::text NOT NULL, + requires text[] DEFAULT '{}'::text[] NOT NULL, + conflicts text[] DEFAULT '{}'::text[] NOT NULL, + tags text[] DEFAULT '{}'::text[] NOT NULL, + committed_at timestamp with time zone DEFAULT clock_timestamp() NOT NULL, + committer_name text NOT NULL, + committer_email text NOT NULL, + planned_at timestamp with time zone NOT NULL, + planner_name text NOT NULL, + planner_email text NOT NULL, + CONSTRAINT events_event_check CHECK ((event = ANY (ARRAY['deploy'::text, 'revert'::text, 'fail'::text, 'merge'::text]))) ); -ALTER TABLE maevsi.account_social_network OWNER TO postgres; +ALTER TABLE sqitch.events OWNER TO postgres; -- --- Name: TABLE account_social_network; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE events; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON TABLE maevsi.account_social_network IS 'Links accounts to their social media profiles. Each entry represents a specific social network and associated username for an account.'; +COMMENT ON TABLE sqitch.events IS 'Contains full history of all deployment events.'; -- --- Name: COLUMN account_social_network.account_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.event; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account_social_network.account_id IS 'The unique identifier of the account.'; +COMMENT ON COLUMN sqitch.events.event IS 'Type of event.'; -- --- Name: COLUMN account_social_network.social_network; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.change_id; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account_social_network.social_network IS 'The social network to which the account is linked.'; +COMMENT ON COLUMN sqitch.events.change_id IS 'Change ID.'; -- --- Name: COLUMN account_social_network.social_network_username; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.change; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.account_social_network.social_network_username IS 'The username of the account on the specified social network.'; +COMMENT ON COLUMN sqitch.events.change IS 'Change name.'; -- --- Name: achievement; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.project; Type: COMMENT; Schema: sqitch; Owner: postgres -- -CREATE TABLE maevsi.achievement ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - account_id uuid NOT NULL, - achievement maevsi.achievement_type NOT NULL, - level integer DEFAULT 1 NOT NULL, - CONSTRAINT achievement_level_check CHECK ((level > 0)) -); - +COMMENT ON COLUMN sqitch.events.project IS 'Name of the Sqitch project to which the change belongs.'; -ALTER TABLE maevsi.achievement OWNER TO postgres; -- --- Name: TABLE achievement; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.note; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON TABLE maevsi.achievement IS 'Achievements unlocked by users.'; +COMMENT ON COLUMN sqitch.events.note IS 'Description of the change.'; -- --- Name: COLUMN achievement.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.requires; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.achievement.id IS 'The achievement unlock''s internal id.'; +COMMENT ON COLUMN sqitch.events.requires IS 'Array of the names of required changes.'; -- --- Name: COLUMN achievement.account_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.conflicts; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.achievement.account_id IS 'The account which unlocked the achievement.'; +COMMENT ON COLUMN sqitch.events.conflicts IS 'Array of the names of conflicting changes.'; -- --- Name: COLUMN achievement.achievement; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.tags; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.achievement.achievement IS 'The unlock''s achievement.'; +COMMENT ON COLUMN sqitch.events.tags IS 'Tags associated with the change.'; -- --- Name: COLUMN achievement.level; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.committed_at; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.achievement.level IS 'The achievement unlock''s level.'; +COMMENT ON COLUMN sqitch.events.committed_at IS 'Date the event was committed.'; -- --- Name: address; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.committer_name; Type: COMMENT; Schema: sqitch; Owner: postgres -- -CREATE TABLE maevsi.address ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - name text NOT NULL, - line_1 text NOT NULL, - line_2 text, - postal_code text NOT NULL, - city text NOT NULL, - region text NOT NULL, - country text NOT NULL, - created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, - created_by uuid NOT NULL, - updated_at timestamp with time zone, - updated_by uuid NOT NULL, - CONSTRAINT address_city_check CHECK (((char_length(city) > 0) AND (char_length(city) <= 300))), - CONSTRAINT address_country_check CHECK (((char_length(country) > 0) AND (char_length(country) <= 300))), - CONSTRAINT address_line_1_check CHECK (((char_length(line_1) > 0) AND (char_length(line_1) <= 300))), - CONSTRAINT address_line_2_check CHECK (((char_length(line_2) > 0) AND (char_length(line_2) <= 300))), - CONSTRAINT address_name_check CHECK (((char_length(name) > 0) AND (char_length(name) <= 300))), - CONSTRAINT address_postal_code_check CHECK (((char_length(postal_code) > 0) AND (char_length(postal_code) <= 20))), - CONSTRAINT address_region_check CHECK (((char_length(region) > 0) AND (char_length(region) <= 300))) -); - +COMMENT ON COLUMN sqitch.events.committer_name IS 'Name of the user who committed the event.'; -ALTER TABLE maevsi.address OWNER TO postgres; -- --- Name: TABLE address; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.committer_email; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON TABLE maevsi.address IS 'Stores detailed address information, including lines, city, state, country, and metadata.'; +COMMENT ON COLUMN sqitch.events.committer_email IS 'Email address of the user who committed the event.'; -- --- Name: COLUMN address.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.planned_at; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.address.id IS '@omit create,update -Primary key, uniquely identifies each address.'; +COMMENT ON COLUMN sqitch.events.planned_at IS 'Date the event was added to the plan.'; -- --- Name: COLUMN address.name; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.planner_name; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.address.name IS 'Person or company name. Must be between 1 and 300 characters.'; +COMMENT ON COLUMN sqitch.events.planner_name IS 'Name of the user who planed the change.'; -- --- Name: COLUMN address.line_1; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN events.planner_email; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.address.line_1 IS 'First line of the address (e.g., street address). Must be between 1 and 300 characters.'; +COMMENT ON COLUMN sqitch.events.planner_email IS 'Email address of the user who plan planned the change.'; -- --- Name: COLUMN address.line_2; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: projects; Type: TABLE; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.address.line_2 IS 'Second line of the address, if needed. Must be between 1 and 300 characters.'; +CREATE TABLE sqitch.projects ( + project text NOT NULL, + uri text, + created_at timestamp with time zone DEFAULT clock_timestamp() NOT NULL, + creator_name text NOT NULL, + creator_email text NOT NULL +); + +ALTER TABLE sqitch.projects OWNER TO postgres; -- --- Name: COLUMN address.postal_code; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE projects; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.address.postal_code IS 'Postal or ZIP code for the address. Must be between 1 and 20 characters.'; +COMMENT ON TABLE sqitch.projects IS 'Sqitch projects deployed to this database.'; -- --- Name: COLUMN address.city; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN projects.project; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.address.city IS 'City of the address. Must be between 1 and 300 characters.'; +COMMENT ON COLUMN sqitch.projects.project IS 'Unique Name of a project.'; -- --- Name: COLUMN address.region; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN projects.uri; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.address.region IS 'Region of the address (e.g., state, province, county, department or territory). Must be between 1 and 300 characters.'; +COMMENT ON COLUMN sqitch.projects.uri IS 'Optional project URI'; -- --- Name: COLUMN address.country; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN projects.created_at; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.address.country IS 'Country of the address. Must be between 1 and 300 characters.'; +COMMENT ON COLUMN sqitch.projects.created_at IS 'Date the project was added to the database.'; -- --- Name: COLUMN address.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN projects.creator_name; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.address.created_at IS '@omit create,update -Timestamp when the address was created. Defaults to the current timestamp.'; +COMMENT ON COLUMN sqitch.projects.creator_name IS 'Name of the user who added the project.'; -- --- Name: COLUMN address.created_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN projects.creator_email; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.address.created_by IS '@omit create,update -Reference to the account that created the address.'; +COMMENT ON COLUMN sqitch.projects.creator_email IS 'Email address of the user who added the project.'; -- --- Name: COLUMN address.updated_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: releases; Type: TABLE; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.address.updated_at IS '@omit create,update -Timestamp when the address was last updated.'; +CREATE TABLE sqitch.releases ( + version real NOT NULL, + installed_at timestamp with time zone DEFAULT clock_timestamp() NOT NULL, + installer_name text NOT NULL, + installer_email text NOT NULL +); + +ALTER TABLE sqitch.releases OWNER TO postgres; -- --- Name: COLUMN address.updated_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE releases; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.address.updated_by IS '@omit create,update -Reference to the account that last updated the address.'; +COMMENT ON TABLE sqitch.releases IS 'Sqitch registry releases.'; -- --- Name: contact; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: COLUMN releases.version; Type: COMMENT; Schema: sqitch; Owner: postgres -- -CREATE TABLE maevsi.contact ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - account_id uuid, - address_id uuid, - email_address text, - email_address_hash text GENERATED ALWAYS AS (md5(lower("substring"(email_address, '\S(?:.*\S)*'::text)))) STORED, - first_name text, - language maevsi.language, - last_name text, - nickname text, - note text, - phone_number text, - timezone text, - url text, - created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, - created_by uuid NOT NULL, - CONSTRAINT contact_email_address_check CHECK ((char_length(email_address) < 255)), - CONSTRAINT contact_first_name_check CHECK (((char_length(first_name) > 0) AND (char_length(first_name) <= 100))), - CONSTRAINT contact_last_name_check CHECK (((char_length(last_name) > 0) AND (char_length(last_name) <= 100))), - CONSTRAINT contact_nickname_check CHECK (((char_length(nickname) > 0) AND (char_length(nickname) <= 100))), - CONSTRAINT contact_note_check CHECK (((char_length(note) > 0) AND (char_length(note) <= 1000))), - CONSTRAINT contact_phone_number_check CHECK ((phone_number ~ '^\+(?:[0-9] ?){6,14}[0-9]$'::text)), - CONSTRAINT contact_timezone_check CHECK ((timezone ~ '^([+-](0[0-9]|1[0-4]):[0-5][0-9]|Z)$'::text)), - CONSTRAINT contact_url_check CHECK (((char_length(url) <= 300) AND (url ~ '^https:\/\/'::text))) -); - +COMMENT ON COLUMN sqitch.releases.version IS 'Version of the Sqitch registry.'; -ALTER TABLE maevsi.contact OWNER TO postgres; -- --- Name: TABLE contact; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN releases.installed_at; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON TABLE maevsi.contact IS 'Stores contact information related to accounts, including personal details, communication preferences, and metadata.'; +COMMENT ON COLUMN sqitch.releases.installed_at IS 'Date the registry release was installed.'; -- --- Name: COLUMN contact.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN releases.installer_name; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.contact.id IS '@omit create,update -Primary key, uniquely identifies each contact.'; +COMMENT ON COLUMN sqitch.releases.installer_name IS 'Name of the user who installed the registry release.'; -- --- Name: COLUMN contact.account_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN releases.installer_email; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.contact.account_id IS 'Optional reference to an associated account.'; +COMMENT ON COLUMN sqitch.releases.installer_email IS 'Email address of the user who installed the registry release.'; -- --- Name: COLUMN contact.address_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: tags; Type: TABLE; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.contact.address_id IS 'Optional reference to the physical address of the contact.'; +CREATE TABLE sqitch.tags ( + tag_id text NOT NULL, + tag text NOT NULL, + project text NOT NULL, + change_id text NOT NULL, + note text DEFAULT ''::text NOT NULL, + committed_at timestamp with time zone DEFAULT clock_timestamp() NOT NULL, + committer_name text NOT NULL, + committer_email text NOT NULL, + planned_at timestamp with time zone NOT NULL, + planner_name text NOT NULL, + planner_email text NOT NULL +); + +ALTER TABLE sqitch.tags OWNER TO postgres; -- --- Name: COLUMN contact.email_address; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE tags; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.contact.email_address IS 'Email address of the contact. Must be shorter than 256 characters.'; +COMMENT ON TABLE sqitch.tags IS 'Tracks the tags currently applied to the database.'; -- --- Name: COLUMN contact.email_address_hash; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN tags.tag_id; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.contact.email_address_hash IS '@omit create,update -Hash of the email address, generated using md5 on the lowercased trimmed version of the email. Useful to display a profile picture from Gravatar.'; - - --- --- Name: COLUMN contact.first_name; Type: COMMENT; Schema: maevsi; Owner: postgres --- - -COMMENT ON COLUMN maevsi.contact.first_name IS 'First name of the contact. Must be between 1 and 100 characters.'; - - --- --- Name: COLUMN contact.language; Type: COMMENT; Schema: maevsi; Owner: postgres --- - -COMMENT ON COLUMN maevsi.contact.language IS 'Reference to the preferred language of the contact.'; - - --- --- Name: COLUMN contact.last_name; Type: COMMENT; Schema: maevsi; Owner: postgres --- - -COMMENT ON COLUMN maevsi.contact.last_name IS 'Last name of the contact. Must be between 1 and 100 characters.'; +COMMENT ON COLUMN sqitch.tags.tag_id IS 'Tag primary key.'; -- --- Name: COLUMN contact.nickname; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN tags.tag; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.contact.nickname IS 'Nickname of the contact. Must be between 1 and 100 characters. Useful when the contact is not commonly referred to by their legal name.'; +COMMENT ON COLUMN sqitch.tags.tag IS 'Project-unique tag name.'; -- --- Name: COLUMN contact.note; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN tags.project; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.contact.note IS 'Additional notes about the contact. Must be between 1 and 1.000 characters. Useful for providing context or distinguishing details if the name alone is insufficient.'; +COMMENT ON COLUMN sqitch.tags.project IS 'Name of the Sqitch project to which the tag belongs.'; -- --- Name: COLUMN contact.phone_number; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN tags.change_id; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.contact.phone_number IS 'The international phone number of the contact, formatted according to E.164 (https://wikipedia.org/wiki/E.164).'; +COMMENT ON COLUMN sqitch.tags.change_id IS 'ID of last change deployed before the tag was applied.'; -- --- Name: COLUMN contact.timezone; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN tags.note; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.contact.timezone IS 'Timezone of the contact in ISO 8601 format, e.g., `+02:00`, `-05:30`, or `Z`.'; +COMMENT ON COLUMN sqitch.tags.note IS 'Description of the tag.'; -- --- Name: COLUMN contact.url; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN tags.committed_at; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.contact.url IS 'URL associated with the contact, must start with "https://" and be up to 300 characters.'; +COMMENT ON COLUMN sqitch.tags.committed_at IS 'Date the tag was applied to the database.'; -- --- Name: COLUMN contact.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN tags.committer_name; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.contact.created_at IS '@omit create,update -Timestamp when the contact was created. Defaults to the current timestamp.'; +COMMENT ON COLUMN sqitch.tags.committer_name IS 'Name of the user who applied the tag.'; -- --- Name: COLUMN contact.created_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN tags.committer_email; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.contact.created_by IS 'Reference to the account that created this contact. Enforces cascading deletion.'; +COMMENT ON COLUMN sqitch.tags.committer_email IS 'Email address of the user who applied the tag.'; -- --- Name: event_category; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: COLUMN tags.planned_at; Type: COMMENT; Schema: sqitch; Owner: postgres -- -CREATE TABLE maevsi.event_category ( - category text NOT NULL -); - +COMMENT ON COLUMN sqitch.tags.planned_at IS 'Date the tag was added to the plan.'; -ALTER TABLE maevsi.event_category OWNER TO postgres; -- --- Name: TABLE event_category; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN tags.planner_name; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON TABLE maevsi.event_category IS 'Event categories.'; +COMMENT ON COLUMN sqitch.tags.planner_name IS 'Name of the user who planed the tag.'; -- --- Name: COLUMN event_category.category; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN tags.planner_email; Type: COMMENT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_category.category IS 'A category name.'; +COMMENT ON COLUMN sqitch.tags.planner_email IS 'Email address of the user who planned the tag.'; -- --- Name: event_category_mapping; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: account; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.event_category_mapping ( - event_id uuid NOT NULL, - category text NOT NULL +CREATE TABLE vibetype.account ( + id uuid NOT NULL, + username text NOT NULL, + CONSTRAINT account_username_check CHECK (((char_length(username) < 100) AND (username ~ '^[-A-Za-z0-9]+$'::text))) ); -ALTER TABLE maevsi.event_category_mapping OWNER TO postgres; +ALTER TABLE vibetype.account OWNER TO postgres; -- --- Name: TABLE event_category_mapping; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE account; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.event_category_mapping IS 'Mapping events to categories (M:N relationship).'; +COMMENT ON TABLE vibetype.account IS 'Public account data.'; -- --- Name: COLUMN event_category_mapping.event_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_category_mapping.event_id IS 'An event id.'; +COMMENT ON COLUMN vibetype.account.id IS 'The account''s internal id.'; -- --- Name: COLUMN event_category_mapping.category; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account.username; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_category_mapping.category IS 'A category name.'; +COMMENT ON COLUMN vibetype.account.username IS 'The account''s username.'; -- --- Name: event_favorite; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: account_block; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.event_favorite ( +CREATE TABLE vibetype.account_block ( id uuid DEFAULT gen_random_uuid() NOT NULL, - event_id uuid, + blocked_account_id uuid NOT NULL, created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, - created_by uuid NOT NULL + created_by uuid NOT NULL, + CONSTRAINT account_block_check CHECK ((created_by <> blocked_account_id)) ); -ALTER TABLE maevsi.event_favorite OWNER TO postgres; +ALTER TABLE vibetype.account_block OWNER TO postgres; -- --- Name: TABLE event_favorite; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE account_block; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.event_favorite IS 'Stores user-specific event favorites, linking an event to the account that marked it as a favorite.'; +COMMENT ON TABLE vibetype.account_block IS '@omit update,delete +Blocking of one account by another.'; -- --- Name: COLUMN event_favorite.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account_block.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_favorite.id IS '@omit create,update -Primary key, uniquely identifies each favorite entry.'; +COMMENT ON COLUMN vibetype.account_block.id IS '@omit create\nThe account blocking''s internal id.'; -- --- Name: COLUMN event_favorite.event_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account_block.blocked_account_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_favorite.event_id IS 'Reference to the event that is marked as a favorite.'; +COMMENT ON COLUMN vibetype.account_block.blocked_account_id IS 'The account id of the user who is blocked.'; -- --- Name: COLUMN event_favorite.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account_block.created_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_favorite.created_at IS '@omit create,update -Timestamp when the favorite was created. Defaults to the current timestamp.'; +COMMENT ON COLUMN vibetype.account_block.created_at IS '@omit create,update,delete +Timestamp of when the blocking was created.'; -- --- Name: COLUMN event_favorite.created_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account_block.created_by; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_favorite.created_by IS '@omit create,update -Reference to the account that created the event favorite.'; +COMMENT ON COLUMN vibetype.account_block.created_by IS 'The account id of the user who created the blocking.'; -- --- Name: event_group; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: account_interest; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.event_group ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - description text, - is_archived boolean DEFAULT false NOT NULL, - name text NOT NULL, - slug text NOT NULL, - created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, - created_by uuid NOT NULL, - CONSTRAINT event_group_description_check CHECK ((char_length(description) < 1000000)), - CONSTRAINT event_group_name_check CHECK (((char_length(name) > 0) AND (char_length(name) < 100))), - CONSTRAINT event_group_slug_check CHECK (((char_length(slug) < 100) AND (slug ~ '^[-A-Za-z0-9]+$'::text))) +CREATE TABLE vibetype.account_interest ( + account_id uuid NOT NULL, + category text NOT NULL ); -ALTER TABLE maevsi.event_group OWNER TO postgres; +ALTER TABLE vibetype.account_interest OWNER TO postgres; -- --- Name: TABLE event_group; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE account_interest; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.event_group IS 'A group of events.'; +COMMENT ON TABLE vibetype.account_interest IS 'Event categories a user account is interested in (M:N relationship).'; -- --- Name: COLUMN event_group.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account_interest.account_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_group.id IS '@omit create,update -The event group''s internal id.'; +COMMENT ON COLUMN vibetype.account_interest.account_id IS 'A user account id.'; -- --- Name: COLUMN event_group.description; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account_interest.category; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_group.description IS 'The event group''s description.'; +COMMENT ON COLUMN vibetype.account_interest.category IS 'An event category.'; -- --- Name: COLUMN event_group.is_archived; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: account_preference_event_size; Type: TABLE; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_group.is_archived IS 'Indicates whether the event group is archived.'; +CREATE TABLE vibetype.account_preference_event_size ( + account_id uuid NOT NULL, + event_size vibetype.event_size NOT NULL, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL +); + +ALTER TABLE vibetype.account_preference_event_size OWNER TO postgres; -- --- Name: COLUMN event_group.name; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE account_preference_event_size; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_group.name IS 'The event group''s name.'; +COMMENT ON TABLE vibetype.account_preference_event_size IS 'Table for the user accounts'' preferred event sizes (M:N relationship).'; -- --- Name: COLUMN event_group.slug; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account_preference_event_size.account_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_group.slug IS '@omit create,update -The event group''s name, slugified.'; +COMMENT ON COLUMN vibetype.account_preference_event_size.account_id IS 'The account''s internal id.'; -- --- Name: COLUMN event_group.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account_preference_event_size.event_size; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_group.created_at IS '@omit create,update -Timestamp of when the event group was created, defaults to the current timestamp.'; +COMMENT ON COLUMN vibetype.account_preference_event_size.event_size IS 'A preferred event sized'; -- --- Name: COLUMN event_group.created_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account_preference_event_size.created_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_group.created_by IS 'The event group creator''s id.'; +COMMENT ON COLUMN vibetype.account_preference_event_size.created_at IS '@omit create,update +Timestamp of when the event size preference was created, defaults to the current timestamp.'; -- --- Name: event_grouping; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: account_social_network; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.event_grouping ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - event_group_id uuid NOT NULL, - event_id uuid NOT NULL +CREATE TABLE vibetype.account_social_network ( + account_id uuid NOT NULL, + social_network vibetype.social_network NOT NULL, + social_network_username text NOT NULL ); -ALTER TABLE maevsi.event_grouping OWNER TO postgres; +ALTER TABLE vibetype.account_social_network OWNER TO postgres; -- --- Name: TABLE event_grouping; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE account_social_network; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.event_grouping IS 'A bidirectional mapping between an event and an event group.'; +COMMENT ON TABLE vibetype.account_social_network IS 'Links accounts to their social media profiles. Each entry represents a specific social network and associated username for an account.'; -- --- Name: COLUMN event_grouping.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account_social_network.account_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_grouping.id IS '@omit create,update -The event grouping''s internal id.'; +COMMENT ON COLUMN vibetype.account_social_network.account_id IS 'The unique identifier of the account.'; -- --- Name: COLUMN event_grouping.event_group_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account_social_network.social_network; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_grouping.event_group_id IS 'The event grouping''s internal event group id.'; +COMMENT ON COLUMN vibetype.account_social_network.social_network IS 'The social network to which the account is linked.'; -- --- Name: COLUMN event_grouping.event_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN account_social_network.social_network_username; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_grouping.event_id IS 'The event grouping''s internal event id.'; +COMMENT ON COLUMN vibetype.account_social_network.social_network_username IS 'The username of the account on the specified social network.'; -- --- Name: event_recommendation; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: achievement; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.event_recommendation ( +CREATE TABLE vibetype.achievement ( + id uuid DEFAULT gen_random_uuid() NOT NULL, account_id uuid NOT NULL, - event_id uuid NOT NULL, - score real, - predicted_score real + achievement vibetype.achievement_type NOT NULL, + level integer DEFAULT 1 NOT NULL, + CONSTRAINT achievement_level_check CHECK ((level > 0)) ); -ALTER TABLE maevsi.event_recommendation OWNER TO postgres; +ALTER TABLE vibetype.achievement OWNER TO postgres; -- --- Name: TABLE event_recommendation; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE achievement; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.event_recommendation IS 'Events recommended to a user account (M:N relationship).'; +COMMENT ON TABLE vibetype.achievement IS 'Achievements unlocked by users.'; -- --- Name: COLUMN event_recommendation.account_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN achievement.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_recommendation.account_id IS 'A user account id.'; +COMMENT ON COLUMN vibetype.achievement.id IS 'The achievement unlock''s internal id.'; -- --- Name: COLUMN event_recommendation.event_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN achievement.account_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_recommendation.event_id IS 'The predicted score of the recommendation.'; +COMMENT ON COLUMN vibetype.achievement.account_id IS 'The account which unlocked the achievement.'; -- --- Name: COLUMN event_recommendation.score; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN achievement.achievement; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_recommendation.score IS 'An event id.'; +COMMENT ON COLUMN vibetype.achievement.achievement IS 'The unlock''s achievement.'; -- --- Name: COLUMN event_recommendation.predicted_score; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN achievement.level; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_recommendation.predicted_score IS 'The score of the recommendation.'; +COMMENT ON COLUMN vibetype.achievement.level IS 'The achievement unlock''s level.'; -- --- Name: event_upload; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: address; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.event_upload ( +CREATE TABLE vibetype.address ( id uuid DEFAULT gen_random_uuid() NOT NULL, - event_id uuid NOT NULL, - upload_id uuid NOT NULL + name text NOT NULL, + line_1 text NOT NULL, + line_2 text, + postal_code text NOT NULL, + city text NOT NULL, + region text NOT NULL, + country text NOT NULL, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, + created_by uuid NOT NULL, + updated_at timestamp with time zone, + updated_by uuid NOT NULL, + CONSTRAINT address_city_check CHECK (((char_length(city) > 0) AND (char_length(city) <= 300))), + CONSTRAINT address_country_check CHECK (((char_length(country) > 0) AND (char_length(country) <= 300))), + CONSTRAINT address_line_1_check CHECK (((char_length(line_1) > 0) AND (char_length(line_1) <= 300))), + CONSTRAINT address_line_2_check CHECK (((char_length(line_2) > 0) AND (char_length(line_2) <= 300))), + CONSTRAINT address_name_check CHECK (((char_length(name) > 0) AND (char_length(name) <= 300))), + CONSTRAINT address_postal_code_check CHECK (((char_length(postal_code) > 0) AND (char_length(postal_code) <= 20))), + CONSTRAINT address_region_check CHECK (((char_length(region) > 0) AND (char_length(region) <= 300))) ); -ALTER TABLE maevsi.event_upload OWNER TO postgres; +ALTER TABLE vibetype.address OWNER TO postgres; -- --- Name: TABLE event_upload; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE address; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.event_upload IS 'An assignment of an uploaded content (e.g. an image) to an event.'; +COMMENT ON TABLE vibetype.address IS 'Stores detailed address information, including lines, city, state, country, and metadata.'; -- --- Name: COLUMN event_upload.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN address.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_upload.id IS '@omit create,update -The event uploads''s internal id.'; +COMMENT ON COLUMN vibetype.address.id IS '@omit create,update +Primary key, uniquely identifies each address.'; -- --- Name: COLUMN event_upload.event_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN address.name; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_upload.event_id IS '@omit update -The event uploads''s internal event id.'; +COMMENT ON COLUMN vibetype.address.name IS 'Person or company name. Must be between 1 and 300 characters.'; -- --- Name: COLUMN event_upload.upload_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN address.line_1; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.event_upload.upload_id IS '@omit update -The event upload''s internal upload id.'; +COMMENT ON COLUMN vibetype.address.line_1 IS 'First line of the address (e.g., street address). Must be between 1 and 300 characters.'; -- --- Name: guest; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: COLUMN address.line_2; Type: COMMENT; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.guest ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - contact_id uuid NOT NULL, - event_id uuid NOT NULL, - feedback maevsi.invitation_feedback, - feedback_paper maevsi.invitation_feedback_paper, - created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, - updated_at timestamp with time zone, - updated_by uuid -); - +COMMENT ON COLUMN vibetype.address.line_2 IS 'Second line of the address, if needed. Must be between 1 and 300 characters.'; -ALTER TABLE maevsi.guest OWNER TO postgres; -- --- Name: TABLE guest; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN address.postal_code; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.guest IS 'A guest for a contact. A bidirectional mapping between an event and a contact.'; +COMMENT ON COLUMN vibetype.address.postal_code IS 'Postal or ZIP code for the address. Must be between 1 and 20 characters.'; -- --- Name: COLUMN guest.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN address.city; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.guest.id IS '@omit create,update -The guests''s internal id.'; +COMMENT ON COLUMN vibetype.address.city IS 'City of the address. Must be between 1 and 300 characters.'; -- --- Name: COLUMN guest.contact_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN address.region; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.guest.contact_id IS 'The internal id of the guest''s contact.'; +COMMENT ON COLUMN vibetype.address.region IS 'Region of the address (e.g., state, province, county, department or territory). Must be between 1 and 300 characters.'; -- --- Name: COLUMN guest.event_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN address.country; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.guest.event_id IS 'The internal id of the guest''s event.'; +COMMENT ON COLUMN vibetype.address.country IS 'Country of the address. Must be between 1 and 300 characters.'; -- --- Name: COLUMN guest.feedback; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN address.created_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.guest.feedback IS 'The guest''s general feedback status.'; +COMMENT ON COLUMN vibetype.address.created_at IS '@omit create,update +Timestamp when the address was created. Defaults to the current timestamp.'; -- --- Name: COLUMN guest.feedback_paper; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN address.created_by; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.guest.feedback_paper IS 'The guest''s paper feedback status.'; +COMMENT ON COLUMN vibetype.address.created_by IS '@omit create,update +Reference to the account that created the address.'; -- --- Name: COLUMN guest.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN address.updated_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.guest.created_at IS '@omit create,update -Timestamp of when the guest was created, defaults to the current timestamp.'; +COMMENT ON COLUMN vibetype.address.updated_at IS '@omit create,update +Timestamp when the address was last updated.'; -- --- Name: COLUMN guest.updated_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN address.updated_by; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.guest.updated_at IS '@omit create,update -Timestamp of when the guest was last updated.'; +COMMENT ON COLUMN vibetype.address.updated_by IS '@omit create,update +Reference to the account that last updated the address.'; -- --- Name: COLUMN guest.updated_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: contact; Type: TABLE; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.guest.updated_by IS '@omit create,update -The id of the account which last updated the guest. `NULL` if the guest was updated by an anonymous user.'; +CREATE TABLE vibetype.contact ( + id uuid DEFAULT gen_random_uuid() NOT NULL, + account_id uuid, + address_id uuid, + email_address text, + email_address_hash text GENERATED ALWAYS AS (md5(lower("substring"(email_address, '\S(?:.*\S)*'::text)))) STORED, + first_name text, + language vibetype.language, + last_name text, + nickname text, + note text, + phone_number text, + timezone text, + url text, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, + created_by uuid NOT NULL, + CONSTRAINT contact_email_address_check CHECK ((char_length(email_address) < 255)), + CONSTRAINT contact_first_name_check CHECK (((char_length(first_name) > 0) AND (char_length(first_name) <= 100))), + CONSTRAINT contact_last_name_check CHECK (((char_length(last_name) > 0) AND (char_length(last_name) <= 100))), + CONSTRAINT contact_nickname_check CHECK (((char_length(nickname) > 0) AND (char_length(nickname) <= 100))), + CONSTRAINT contact_note_check CHECK (((char_length(note) > 0) AND (char_length(note) <= 1000))), + CONSTRAINT contact_phone_number_check CHECK ((phone_number ~ '^\+(?:[0-9] ?){6,14}[0-9]$'::text)), + CONSTRAINT contact_timezone_check CHECK ((timezone ~ '^([+-](0[0-9]|1[0-4]):[0-5][0-9]|Z)$'::text)), + CONSTRAINT contact_url_check CHECK (((char_length(url) <= 300) AND (url ~ '^https:\/\/'::text))) +); + +ALTER TABLE vibetype.contact OWNER TO postgres; -- --- Name: guest_flat; Type: VIEW; Schema: maevsi; Owner: postgres +-- Name: TABLE contact; Type: COMMENT; Schema: vibetype; Owner: postgres -- -CREATE VIEW maevsi.guest_flat WITH (security_invoker='true') AS - SELECT guest.id AS guest_id, - guest.contact_id AS guest_contact_id, - guest.event_id AS guest_event_id, - guest.feedback AS guest_feedback, - guest.feedback_paper AS guest_feedback_paper, - contact.id AS contact_id, - contact.account_id AS contact_account_id, - contact.address_id AS contact_address_id, - contact.email_address AS contact_email_address, - contact.email_address_hash AS contact_email_address_hash, - contact.first_name AS contact_first_name, - contact.last_name AS contact_last_name, - contact.phone_number AS contact_phone_number, - contact.url AS contact_url, - contact.created_by AS contact_created_by, - event.id AS event_id, - event.description AS event_description, - event.start AS event_start, - event."end" AS event_end, - event.guest_count_maximum AS event_guest_count_maximum, - event.is_archived AS event_is_archived, - event.is_in_person AS event_is_in_person, - event.is_remote AS event_is_remote, - event.location AS event_location, - event.name AS event_name, - event.slug AS event_slug, - event.url AS event_url, - event.visibility AS event_visibility, - event.created_by AS event_created_by - FROM ((maevsi.guest - JOIN maevsi.contact ON ((guest.contact_id = contact.id))) - JOIN maevsi.event ON ((guest.event_id = event.id))); +COMMENT ON TABLE vibetype.contact IS 'Stores contact information related to accounts, including personal details, communication preferences, and metadata.'; + + +-- +-- Name: COLUMN contact.id; Type: COMMENT; Schema: vibetype; Owner: postgres +-- +COMMENT ON COLUMN vibetype.contact.id IS '@omit create,update +Primary key, uniquely identifies each contact.'; -ALTER VIEW maevsi.guest_flat OWNER TO postgres; -- --- Name: VIEW guest_flat; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN contact.account_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON VIEW maevsi.guest_flat IS 'View returning flattened guests.'; +COMMENT ON COLUMN vibetype.contact.account_id IS 'Optional reference to an associated account.'; -- --- Name: notification; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: COLUMN contact.address_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.notification ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - channel text NOT NULL, - is_acknowledged boolean, - payload text NOT NULL, - created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, - CONSTRAINT notification_payload_check CHECK ((octet_length(payload) <= 8000)) -); +COMMENT ON COLUMN vibetype.contact.address_id IS 'Optional reference to the physical address of the contact.'; + + +-- +-- Name: COLUMN contact.email_address; Type: COMMENT; Schema: vibetype; Owner: postgres +-- +COMMENT ON COLUMN vibetype.contact.email_address IS 'Email address of the contact. Must be shorter than 256 characters.'; -ALTER TABLE maevsi.notification OWNER TO postgres; -- --- Name: TABLE notification; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN contact.email_address_hash; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.notification IS 'A notification.'; +COMMENT ON COLUMN vibetype.contact.email_address_hash IS '@omit create,update +Hash of the email address, generated using md5 on the lowercased trimmed version of the email. Useful to display a profile picture from Gravatar.'; -- --- Name: COLUMN notification.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN contact.first_name; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.notification.id IS 'The notification''s internal id.'; +COMMENT ON COLUMN vibetype.contact.first_name IS 'First name of the contact. Must be between 1 and 100 characters.'; -- --- Name: COLUMN notification.channel; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN contact.language; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.notification.channel IS 'The notification''s channel.'; +COMMENT ON COLUMN vibetype.contact.language IS 'Reference to the preferred language of the contact.'; -- --- Name: COLUMN notification.is_acknowledged; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN contact.last_name; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.notification.is_acknowledged IS 'Whether the notification was acknowledged.'; +COMMENT ON COLUMN vibetype.contact.last_name IS 'Last name of the contact. Must be between 1 and 100 characters.'; -- --- Name: COLUMN notification.payload; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN contact.nickname; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.notification.payload IS 'The notification''s payload.'; +COMMENT ON COLUMN vibetype.contact.nickname IS 'Nickname of the contact. Must be between 1 and 100 characters. Useful when the contact is not commonly referred to by their legal name.'; -- --- Name: COLUMN notification.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN contact.note; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.notification.created_at IS 'The timestamp of the notification''s creation.'; +COMMENT ON COLUMN vibetype.contact.note IS 'Additional notes about the contact. Must be between 1 and 1.000 characters. Useful for providing context or distinguishing details if the name alone is insufficient.'; -- --- Name: invitation; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: COLUMN contact.phone_number; Type: COMMENT; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.invitation ( - guest_id uuid NOT NULL, - created_by uuid NOT NULL -) -INHERITS (maevsi.notification); +COMMENT ON COLUMN vibetype.contact.phone_number IS 'The international phone number of the contact, formatted according to E.164 (https://wikipedia.org/wiki/E.164).'; + + +-- +-- Name: COLUMN contact.timezone; Type: COMMENT; Schema: vibetype; Owner: postgres +-- +COMMENT ON COLUMN vibetype.contact.timezone IS 'Timezone of the contact in ISO 8601 format, e.g., `+02:00`, `-05:30`, or `Z`.'; -ALTER TABLE maevsi.invitation OWNER TO postgres; -- --- Name: TABLE invitation; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN contact.url; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.invitation IS '@omit update,delete\nStores invitations and their statuses.'; +COMMENT ON COLUMN vibetype.contact.url IS 'URL associated with the contact, must start with "https://" and be up to 300 characters.'; -- --- Name: COLUMN invitation.guest_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN contact.created_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.invitation.guest_id IS 'The ID of the guest associated with this invitation.'; +COMMENT ON COLUMN vibetype.contact.created_at IS '@omit create,update +Timestamp when the contact was created. Defaults to the current timestamp.'; -- --- Name: COLUMN invitation.created_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN contact.created_by; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.invitation.created_by IS '@omit create -Reference to the account that created the invitation.'; +COMMENT ON COLUMN vibetype.contact.created_by IS 'Reference to the account that created this contact. Enforces cascading deletion.'; -- --- Name: legal_term; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: event_category; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.legal_term ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - language character varying(5) DEFAULT 'en'::character varying NOT NULL, - term text NOT NULL, - version character varying(20) NOT NULL, - created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, - CONSTRAINT legal_term_language_check CHECK (((language)::text ~ '^[a-z]{2}(_[A-Z]{2})?$'::text)), - CONSTRAINT legal_term_term_check CHECK (((char_length(term) > 0) AND (char_length(term) <= 500000))), - CONSTRAINT legal_term_version_check CHECK (((version)::text ~ '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$'::text)) +CREATE TABLE vibetype.event_category ( + category text NOT NULL ); -ALTER TABLE maevsi.legal_term OWNER TO postgres; +ALTER TABLE vibetype.event_category OWNER TO postgres; -- --- Name: TABLE legal_term; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE event_category; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.legal_term IS '@omit create,update,delete -Legal terms like privacy policies or terms of service.'; +COMMENT ON TABLE vibetype.event_category IS 'Event categories.'; -- --- Name: COLUMN legal_term.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_category.category; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.legal_term.id IS 'Unique identifier for each legal term.'; +COMMENT ON COLUMN vibetype.event_category.category IS 'A category name.'; -- --- Name: COLUMN legal_term.language; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: event_category_mapping; Type: TABLE; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.legal_term.language IS 'Language code in ISO 639-1 format with optional region (e.g., `en` for English, `en_GB` for British English)'; +CREATE TABLE vibetype.event_category_mapping ( + event_id uuid NOT NULL, + category text NOT NULL +); + +ALTER TABLE vibetype.event_category_mapping OWNER TO postgres; -- --- Name: COLUMN legal_term.term; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE event_category_mapping; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.legal_term.term IS 'Text of the legal term. Markdown is expected to be used. It must be non-empty and cannot exceed 500,000 characters.'; +COMMENT ON TABLE vibetype.event_category_mapping IS 'Mapping events to categories (M:N relationship).'; -- --- Name: COLUMN legal_term.version; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_category_mapping.event_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.legal_term.version IS 'Semantic versioning string to track changes to the legal terms (format: `X.Y.Z`).'; +COMMENT ON COLUMN vibetype.event_category_mapping.event_id IS 'An event id.'; -- --- Name: COLUMN legal_term.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_category_mapping.category; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.legal_term.created_at IS 'Timestamp when the term was created. Set to the current time by default.'; +COMMENT ON COLUMN vibetype.event_category_mapping.category IS 'A category name.'; -- --- Name: legal_term_acceptance; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: event_favorite; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.legal_term_acceptance ( +CREATE TABLE vibetype.event_favorite ( id uuid DEFAULT gen_random_uuid() NOT NULL, - account_id uuid NOT NULL, - legal_term_id uuid NOT NULL, - created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL + event_id uuid, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, + created_by uuid NOT NULL ); -ALTER TABLE maevsi.legal_term_acceptance OWNER TO postgres; +ALTER TABLE vibetype.event_favorite OWNER TO postgres; -- --- Name: TABLE legal_term_acceptance; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE event_favorite; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.legal_term_acceptance IS '@omit update,delete\nTracks each user account''s acceptance of legal terms and conditions.'; +COMMENT ON TABLE vibetype.event_favorite IS 'Stores user-specific event favorites, linking an event to the account that marked it as a favorite.'; -- --- Name: COLUMN legal_term_acceptance.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_favorite.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.legal_term_acceptance.id IS '@omit create -Unique identifier for this legal term acceptance record. Automatically generated for each new acceptance.'; +COMMENT ON COLUMN vibetype.event_favorite.id IS '@omit create,update +Primary key, uniquely identifies each favorite entry.'; -- --- Name: COLUMN legal_term_acceptance.account_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_favorite.event_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.legal_term_acceptance.account_id IS 'The user account ID that accepted the legal terms. If the account is deleted, this acceptance record will also be deleted.'; +COMMENT ON COLUMN vibetype.event_favorite.event_id IS 'Reference to the event that is marked as a favorite.'; -- --- Name: COLUMN legal_term_acceptance.legal_term_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_favorite.created_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.legal_term_acceptance.legal_term_id IS 'The ID of the legal terms that were accepted. Deletion of these legal terms is restricted while they are still referenced in this table.'; +COMMENT ON COLUMN vibetype.event_favorite.created_at IS '@omit create,update +Timestamp when the favorite was created. Defaults to the current timestamp.'; -- --- Name: COLUMN legal_term_acceptance.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_favorite.created_by; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.legal_term_acceptance.created_at IS '@omit create -Timestamp showing when the legal terms were accepted, set automatically at the time of acceptance.'; +COMMENT ON COLUMN vibetype.event_favorite.created_by IS '@omit create,update +Reference to the account that created the event favorite.'; -- --- Name: profile_picture; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: event_group; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.profile_picture ( +CREATE TABLE vibetype.event_group ( id uuid DEFAULT gen_random_uuid() NOT NULL, - account_id uuid NOT NULL, - upload_id uuid NOT NULL + description text, + is_archived boolean DEFAULT false NOT NULL, + name text NOT NULL, + slug text NOT NULL, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, + created_by uuid NOT NULL, + CONSTRAINT event_group_description_check CHECK ((char_length(description) < 1000000)), + CONSTRAINT event_group_name_check CHECK (((char_length(name) > 0) AND (char_length(name) < 100))), + CONSTRAINT event_group_slug_check CHECK (((char_length(slug) < 100) AND (slug ~ '^[-A-Za-z0-9]+$'::text))) ); -ALTER TABLE maevsi.profile_picture OWNER TO postgres; +ALTER TABLE vibetype.event_group OWNER TO postgres; -- --- Name: TABLE profile_picture; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE event_group; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.profile_picture IS 'Mapping of account ids to upload ids.'; +COMMENT ON TABLE vibetype.event_group IS 'A group of events.'; -- --- Name: COLUMN profile_picture.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_group.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.profile_picture.id IS '@omit create,update -The profile picture''s internal id.'; +COMMENT ON COLUMN vibetype.event_group.id IS '@omit create,update +The event group''s internal id.'; -- --- Name: COLUMN profile_picture.account_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_group.description; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.profile_picture.account_id IS 'The account''s id.'; +COMMENT ON COLUMN vibetype.event_group.description IS 'The event group''s description.'; -- --- Name: COLUMN profile_picture.upload_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_group.is_archived; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.profile_picture.upload_id IS 'The upload''s id.'; +COMMENT ON COLUMN vibetype.event_group.is_archived IS 'Indicates whether the event group is archived.'; -- --- Name: report; Type: TABLE; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_group.name; Type: COMMENT; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi.report ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - reason text NOT NULL, - target_account_id uuid, - target_event_id uuid, - target_upload_id uuid, - created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, - created_by uuid NOT NULL, - CONSTRAINT report_check CHECK ((num_nonnulls(target_account_id, target_event_id, target_upload_id) = 1)), - CONSTRAINT report_reason_check CHECK (((char_length(reason) > 0) AND (char_length(reason) < 2000))) -); - +COMMENT ON COLUMN vibetype.event_group.name IS 'The event group''s name.'; -ALTER TABLE maevsi.report OWNER TO postgres; -- --- Name: TABLE report; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_group.slug; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi.report IS '@omit update,delete -Stores reports made by users on other users, events, or uploads for moderation purposes.'; +COMMENT ON COLUMN vibetype.event_group.slug IS '@omit create,update +The event group''s name, slugified.'; -- --- Name: COLUMN report.id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_group.created_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.report.id IS '@omit create -Unique identifier for the report, generated randomly using UUIDs.'; +COMMENT ON COLUMN vibetype.event_group.created_at IS '@omit create,update +Timestamp of when the event group was created, defaults to the current timestamp.'; -- --- Name: COLUMN report.reason; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_group.created_by; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.report.reason IS 'The reason for the report, provided by the reporting user. Must be non-empty and less than 2000 characters.'; +COMMENT ON COLUMN vibetype.event_group.created_by IS 'The event group creator''s id.'; -- --- Name: COLUMN report.target_account_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: event_grouping; Type: TABLE; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.report.target_account_id IS 'The ID of the account being reported, if applicable.'; +CREATE TABLE vibetype.event_grouping ( + id uuid DEFAULT gen_random_uuid() NOT NULL, + event_group_id uuid NOT NULL, + event_id uuid NOT NULL +); + +ALTER TABLE vibetype.event_grouping OWNER TO postgres; -- --- Name: COLUMN report.target_event_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE event_grouping; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.report.target_event_id IS 'The ID of the event being reported, if applicable.'; +COMMENT ON TABLE vibetype.event_grouping IS 'A bidirectional mapping between an event and an event group.'; -- --- Name: COLUMN report.target_upload_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_grouping.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.report.target_upload_id IS 'The ID of the upload being reported, if applicable.'; +COMMENT ON COLUMN vibetype.event_grouping.id IS '@omit create,update +The event grouping''s internal id.'; -- --- Name: COLUMN report.created_at; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_grouping.event_group_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.report.created_at IS '@omit create -Timestamp of when the report was created, defaults to the current timestamp.'; +COMMENT ON COLUMN vibetype.event_grouping.event_group_id IS 'The event grouping''s internal event group id.'; -- --- Name: COLUMN report.created_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: COLUMN event_grouping.event_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi.report.created_by IS 'The ID of the user who created the report.'; +COMMENT ON COLUMN vibetype.event_grouping.event_id IS 'The event grouping''s internal event id.'; -- --- Name: CONSTRAINT report_check ON report; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: event_recommendation; Type: TABLE; Schema: vibetype; Owner: postgres -- -COMMENT ON CONSTRAINT report_check ON maevsi.report IS 'Ensures that the report targets exactly one element (account, event, or upload).'; +CREATE TABLE vibetype.event_recommendation ( + account_id uuid NOT NULL, + event_id uuid NOT NULL, + score real, + predicted_score real +); + +ALTER TABLE vibetype.event_recommendation OWNER TO postgres; -- --- Name: CONSTRAINT report_reason_check ON report; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: TABLE event_recommendation; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON CONSTRAINT report_reason_check ON maevsi.report IS 'Ensures the reason field contains between 1 and 2000 characters.'; +COMMENT ON TABLE vibetype.event_recommendation IS 'Events recommended to a user account (M:N relationship).'; -- --- Name: account; Type: TABLE; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN event_recommendation.account_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi_private.account ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - birth_date date, - email_address text NOT NULL, - email_address_verification uuid DEFAULT gen_random_uuid(), - email_address_verification_valid_until timestamp with time zone, - location public.geography(Point,4326), - password_hash text NOT NULL, - password_reset_verification uuid, - password_reset_verification_valid_until timestamp with time zone, - upload_quota_bytes bigint DEFAULT 10485760 NOT NULL, - created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, - last_activity timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, - CONSTRAINT account_email_address_check CHECK ((char_length(email_address) < 255)) -); +COMMENT ON COLUMN vibetype.event_recommendation.account_id IS 'A user account id.'; + +-- +-- Name: COLUMN event_recommendation.event_id; Type: COMMENT; Schema: vibetype; Owner: postgres +-- + +COMMENT ON COLUMN vibetype.event_recommendation.event_id IS 'The predicted score of the recommendation.'; -ALTER TABLE maevsi_private.account OWNER TO postgres; -- --- Name: TABLE account; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN event_recommendation.score; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi_private.account IS 'Private account data.'; +COMMENT ON COLUMN vibetype.event_recommendation.score IS 'An event id.'; -- --- Name: COLUMN account.id; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN event_recommendation.predicted_score; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.account.id IS 'The account''s internal id.'; +COMMENT ON COLUMN vibetype.event_recommendation.predicted_score IS 'The score of the recommendation.'; -- --- Name: COLUMN account.birth_date; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: event_upload; Type: TABLE; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.account.birth_date IS 'The account owner''s date of birth.'; +CREATE TABLE vibetype.event_upload ( + id uuid DEFAULT gen_random_uuid() NOT NULL, + event_id uuid NOT NULL, + upload_id uuid NOT NULL +); + +ALTER TABLE vibetype.event_upload OWNER TO postgres; -- --- Name: COLUMN account.email_address; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: TABLE event_upload; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.account.email_address IS 'The account''s email address for account related information.'; +COMMENT ON TABLE vibetype.event_upload IS 'An assignment of an uploaded content (e.g. an image) to an event.'; -- --- Name: COLUMN account.email_address_verification; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN event_upload.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.account.email_address_verification IS 'The UUID used to verify an email address, or null if already verified.'; +COMMENT ON COLUMN vibetype.event_upload.id IS '@omit create,update +The event uploads''s internal id.'; -- --- Name: COLUMN account.email_address_verification_valid_until; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN event_upload.event_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.account.email_address_verification_valid_until IS 'The timestamp until which an email address verification is valid.'; +COMMENT ON COLUMN vibetype.event_upload.event_id IS '@omit update +The event uploads''s internal event id.'; -- --- Name: COLUMN account.location; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN event_upload.upload_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.account.location IS 'The account''s geometric location.'; +COMMENT ON COLUMN vibetype.event_upload.upload_id IS '@omit update +The event upload''s internal upload id.'; -- --- Name: COLUMN account.password_hash; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: guest; Type: TABLE; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.account.password_hash IS 'The account''s password, hashed and salted.'; +CREATE TABLE vibetype.guest ( + id uuid DEFAULT gen_random_uuid() NOT NULL, + contact_id uuid NOT NULL, + event_id uuid NOT NULL, + feedback vibetype.invitation_feedback, + feedback_paper vibetype.invitation_feedback_paper, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, + updated_at timestamp with time zone, + updated_by uuid +); + +ALTER TABLE vibetype.guest OWNER TO postgres; -- --- Name: COLUMN account.password_reset_verification; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: TABLE guest; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.account.password_reset_verification IS 'The UUID used to reset a password, or null if there is no pending reset request.'; +COMMENT ON TABLE vibetype.guest IS 'A guest for a contact. A bidirectional mapping between an event and a contact.'; -- --- Name: COLUMN account.password_reset_verification_valid_until; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN guest.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.account.password_reset_verification_valid_until IS 'The timestamp until which a password reset is valid.'; +COMMENT ON COLUMN vibetype.guest.id IS '@omit create,update +The guests''s internal id.'; -- --- Name: COLUMN account.upload_quota_bytes; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN guest.contact_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.account.upload_quota_bytes IS 'The account''s upload quota in bytes.'; +COMMENT ON COLUMN vibetype.guest.contact_id IS 'The internal id of the guest''s contact.'; -- --- Name: COLUMN account.created_at; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN guest.event_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.account.created_at IS 'Timestamp at which the account was last active.'; +COMMENT ON COLUMN vibetype.guest.event_id IS 'The internal id of the guest''s event.'; -- --- Name: COLUMN account.last_activity; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN guest.feedback; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.account.last_activity IS 'Timestamp at which the account last requested an access token.'; +COMMENT ON COLUMN vibetype.guest.feedback IS 'The guest''s general feedback status.'; -- --- Name: achievement_code; Type: TABLE; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN guest.feedback_paper; Type: COMMENT; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi_private.achievement_code ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - alias text NOT NULL, - achievement maevsi.achievement_type NOT NULL, - CONSTRAINT achievement_code_alias_check CHECK ((char_length(alias) < 1000)) -); +COMMENT ON COLUMN vibetype.guest.feedback_paper IS 'The guest''s paper feedback status.'; -ALTER TABLE maevsi_private.achievement_code OWNER TO postgres; +-- +-- Name: COLUMN guest.created_at; Type: COMMENT; Schema: vibetype; Owner: postgres +-- + +COMMENT ON COLUMN vibetype.guest.created_at IS '@omit create,update +Timestamp of when the guest was created, defaults to the current timestamp.'; + -- --- Name: TABLE achievement_code; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN guest.updated_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi_private.achievement_code IS 'Codes that unlock achievements.'; +COMMENT ON COLUMN vibetype.guest.updated_at IS '@omit create,update +Timestamp of when the guest was last updated.'; -- --- Name: COLUMN achievement_code.id; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN guest.updated_by; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.achievement_code.id IS 'The code that unlocks an achievement.'; +COMMENT ON COLUMN vibetype.guest.updated_by IS '@omit create,update +The id of the account which last updated the guest. `NULL` if the guest was updated by an anonymous user.'; -- --- Name: COLUMN achievement_code.alias; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: guest_flat; Type: VIEW; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.achievement_code.alias IS 'An alternative code, e.g. human readable, that unlocks an achievement.'; +CREATE VIEW vibetype.guest_flat WITH (security_invoker='true') AS + SELECT guest.id AS guest_id, + guest.contact_id AS guest_contact_id, + guest.event_id AS guest_event_id, + guest.feedback AS guest_feedback, + guest.feedback_paper AS guest_feedback_paper, + contact.id AS contact_id, + contact.account_id AS contact_account_id, + contact.address_id AS contact_address_id, + contact.email_address AS contact_email_address, + contact.email_address_hash AS contact_email_address_hash, + contact.first_name AS contact_first_name, + contact.last_name AS contact_last_name, + contact.phone_number AS contact_phone_number, + contact.url AS contact_url, + contact.created_by AS contact_created_by, + event.id AS event_id, + event.description AS event_description, + event.start AS event_start, + event."end" AS event_end, + event.guest_count_maximum AS event_guest_count_maximum, + event.is_archived AS event_is_archived, + event.is_in_person AS event_is_in_person, + event.is_remote AS event_is_remote, + event.location AS event_location, + event.name AS event_name, + event.slug AS event_slug, + event.url AS event_url, + event.visibility AS event_visibility, + event.created_by AS event_created_by + FROM ((vibetype.guest + JOIN vibetype.contact ON ((guest.contact_id = contact.id))) + JOIN vibetype.event ON ((guest.event_id = event.id))); + +ALTER VIEW vibetype.guest_flat OWNER TO postgres; -- --- Name: COLUMN achievement_code.achievement; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: VIEW guest_flat; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.achievement_code.achievement IS 'The achievement that is unlocked by the code.'; +COMMENT ON VIEW vibetype.guest_flat IS 'View returning flattened guests.'; -- --- Name: jwt; Type: TABLE; Schema: maevsi_private; Owner: postgres +-- Name: notification; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE maevsi_private.jwt ( +CREATE TABLE vibetype.notification ( id uuid DEFAULT gen_random_uuid() NOT NULL, - token maevsi.jwt NOT NULL + channel text NOT NULL, + is_acknowledged boolean, + payload text NOT NULL, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, + CONSTRAINT notification_payload_check CHECK ((octet_length(payload) <= 8000)) ); -ALTER TABLE maevsi_private.jwt OWNER TO postgres; +ALTER TABLE vibetype.notification OWNER TO postgres; -- --- Name: TABLE jwt; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: TABLE notification; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE maevsi_private.jwt IS 'A list of tokens.'; +COMMENT ON TABLE vibetype.notification IS 'A notification.'; -- --- Name: COLUMN jwt.id; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN notification.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.jwt.id IS 'The token''s id.'; +COMMENT ON COLUMN vibetype.notification.id IS 'The notification''s internal id.'; -- --- Name: COLUMN jwt.token; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: COLUMN notification.channel; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN maevsi_private.jwt.token IS 'The token.'; +COMMENT ON COLUMN vibetype.notification.channel IS 'The notification''s channel.'; -- --- Name: changes; Type: TABLE; Schema: sqitch; Owner: postgres +-- Name: COLUMN notification.is_acknowledged; Type: COMMENT; Schema: vibetype; Owner: postgres -- -CREATE TABLE sqitch.changes ( - change_id text NOT NULL, - script_hash text, - change text NOT NULL, - project text NOT NULL, - note text DEFAULT ''::text NOT NULL, - committed_at timestamp with time zone DEFAULT clock_timestamp() NOT NULL, - committer_name text NOT NULL, - committer_email text NOT NULL, - planned_at timestamp with time zone NOT NULL, - planner_name text NOT NULL, - planner_email text NOT NULL -); +COMMENT ON COLUMN vibetype.notification.is_acknowledged IS 'Whether the notification was acknowledged.'; -ALTER TABLE sqitch.changes OWNER TO postgres; +-- +-- Name: COLUMN notification.payload; Type: COMMENT; Schema: vibetype; Owner: postgres +-- + +COMMENT ON COLUMN vibetype.notification.payload IS 'The notification''s payload.'; + -- --- Name: TABLE changes; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN notification.created_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE sqitch.changes IS 'Tracks the changes currently deployed to the database.'; +COMMENT ON COLUMN vibetype.notification.created_at IS 'The timestamp of the notification''s creation.'; -- --- Name: COLUMN changes.change_id; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: invitation; Type: TABLE; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.changes.change_id IS 'Change primary key.'; +CREATE TABLE vibetype.invitation ( + guest_id uuid NOT NULL, + created_by uuid NOT NULL +) +INHERITS (vibetype.notification); +ALTER TABLE vibetype.invitation OWNER TO postgres; + -- --- Name: COLUMN changes.script_hash; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: TABLE invitation; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.changes.script_hash IS 'Deploy script SHA-1 hash.'; +COMMENT ON TABLE vibetype.invitation IS '@omit update,delete\nStores invitations and their statuses.'; -- --- Name: COLUMN changes.change; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN invitation.guest_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.changes.change IS 'Name of a deployed change.'; +COMMENT ON COLUMN vibetype.invitation.guest_id IS 'The ID of the guest associated with this invitation.'; -- --- Name: COLUMN changes.project; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN invitation.created_by; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.changes.project IS 'Name of the Sqitch project to which the change belongs.'; +COMMENT ON COLUMN vibetype.invitation.created_by IS '@omit create +Reference to the account that created the invitation.'; -- --- Name: COLUMN changes.note; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: legal_term; Type: TABLE; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.changes.note IS 'Description of the change.'; +CREATE TABLE vibetype.legal_term ( + id uuid DEFAULT gen_random_uuid() NOT NULL, + language character varying(5) DEFAULT 'en'::character varying NOT NULL, + term text NOT NULL, + version character varying(20) NOT NULL, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, + CONSTRAINT legal_term_language_check CHECK (((language)::text ~ '^[a-z]{2}(_[A-Z]{2})?$'::text)), + CONSTRAINT legal_term_term_check CHECK (((char_length(term) > 0) AND (char_length(term) <= 500000))), + CONSTRAINT legal_term_version_check CHECK (((version)::text ~ '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$'::text)) +); + +ALTER TABLE vibetype.legal_term OWNER TO postgres; -- --- Name: COLUMN changes.committed_at; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: TABLE legal_term; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.changes.committed_at IS 'Date the change was deployed.'; +COMMENT ON TABLE vibetype.legal_term IS '@omit create,update,delete +Legal terms like privacy policies or terms of service.'; -- --- Name: COLUMN changes.committer_name; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN legal_term.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.changes.committer_name IS 'Name of the user who deployed the change.'; +COMMENT ON COLUMN vibetype.legal_term.id IS 'Unique identifier for each legal term.'; -- --- Name: COLUMN changes.committer_email; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN legal_term.language; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.changes.committer_email IS 'Email address of the user who deployed the change.'; +COMMENT ON COLUMN vibetype.legal_term.language IS 'Language code in ISO 639-1 format with optional region (e.g., `en` for English, `en_GB` for British English)'; -- --- Name: COLUMN changes.planned_at; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN legal_term.term; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.changes.planned_at IS 'Date the change was added to the plan.'; +COMMENT ON COLUMN vibetype.legal_term.term IS 'Text of the legal term. Markdown is expected to be used. It must be non-empty and cannot exceed 500,000 characters.'; -- --- Name: COLUMN changes.planner_name; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN legal_term.version; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.changes.planner_name IS 'Name of the user who planed the change.'; +COMMENT ON COLUMN vibetype.legal_term.version IS 'Semantic versioning string to track changes to the legal terms (format: `X.Y.Z`).'; -- --- Name: COLUMN changes.planner_email; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN legal_term.created_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.changes.planner_email IS 'Email address of the user who planned the change.'; +COMMENT ON COLUMN vibetype.legal_term.created_at IS 'Timestamp when the term was created. Set to the current time by default.'; -- --- Name: dependencies; Type: TABLE; Schema: sqitch; Owner: postgres +-- Name: legal_term_acceptance; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE sqitch.dependencies ( - change_id text NOT NULL, - type text NOT NULL, - dependency text NOT NULL, - dependency_id text, - CONSTRAINT dependencies_check CHECK ((((type = 'require'::text) AND (dependency_id IS NOT NULL)) OR ((type = 'conflict'::text) AND (dependency_id IS NULL)))) +CREATE TABLE vibetype.legal_term_acceptance ( + id uuid DEFAULT gen_random_uuid() NOT NULL, + account_id uuid NOT NULL, + legal_term_id uuid NOT NULL, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL ); -ALTER TABLE sqitch.dependencies OWNER TO postgres; +ALTER TABLE vibetype.legal_term_acceptance OWNER TO postgres; -- --- Name: TABLE dependencies; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: TABLE legal_term_acceptance; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE sqitch.dependencies IS 'Tracks the currently satisfied dependencies.'; +COMMENT ON TABLE vibetype.legal_term_acceptance IS '@omit update,delete\nTracks each user account''s acceptance of legal terms and conditions.'; -- --- Name: COLUMN dependencies.change_id; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN legal_term_acceptance.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.dependencies.change_id IS 'ID of the depending change.'; +COMMENT ON COLUMN vibetype.legal_term_acceptance.id IS '@omit create +Unique identifier for this legal term acceptance record. Automatically generated for each new acceptance.'; -- --- Name: COLUMN dependencies.type; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN legal_term_acceptance.account_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.dependencies.type IS 'Type of dependency.'; +COMMENT ON COLUMN vibetype.legal_term_acceptance.account_id IS 'The user account ID that accepted the legal terms. If the account is deleted, this acceptance record will also be deleted.'; -- --- Name: COLUMN dependencies.dependency; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN legal_term_acceptance.legal_term_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.dependencies.dependency IS 'Dependency name.'; +COMMENT ON COLUMN vibetype.legal_term_acceptance.legal_term_id IS 'The ID of the legal terms that were accepted. Deletion of these legal terms is restricted while they are still referenced in this table.'; -- --- Name: COLUMN dependencies.dependency_id; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN legal_term_acceptance.created_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.dependencies.dependency_id IS 'Change ID the dependency resolves to.'; +COMMENT ON COLUMN vibetype.legal_term_acceptance.created_at IS '@omit create +Timestamp showing when the legal terms were accepted, set automatically at the time of acceptance.'; -- --- Name: events; Type: TABLE; Schema: sqitch; Owner: postgres +-- Name: profile_picture; Type: TABLE; Schema: vibetype; Owner: postgres -- -CREATE TABLE sqitch.events ( - event text NOT NULL, - change_id text NOT NULL, - change text NOT NULL, - project text NOT NULL, - note text DEFAULT ''::text NOT NULL, - requires text[] DEFAULT '{}'::text[] NOT NULL, - conflicts text[] DEFAULT '{}'::text[] NOT NULL, - tags text[] DEFAULT '{}'::text[] NOT NULL, - committed_at timestamp with time zone DEFAULT clock_timestamp() NOT NULL, - committer_name text NOT NULL, - committer_email text NOT NULL, - planned_at timestamp with time zone NOT NULL, - planner_name text NOT NULL, - planner_email text NOT NULL, - CONSTRAINT events_event_check CHECK ((event = ANY (ARRAY['deploy'::text, 'revert'::text, 'fail'::text, 'merge'::text]))) +CREATE TABLE vibetype.profile_picture ( + id uuid DEFAULT gen_random_uuid() NOT NULL, + account_id uuid NOT NULL, + upload_id uuid NOT NULL ); -ALTER TABLE sqitch.events OWNER TO postgres; +ALTER TABLE vibetype.profile_picture OWNER TO postgres; -- --- Name: TABLE events; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: TABLE profile_picture; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON TABLE sqitch.events IS 'Contains full history of all deployment events.'; +COMMENT ON TABLE vibetype.profile_picture IS 'Mapping of account ids to upload ids.'; -- --- Name: COLUMN events.event; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN profile_picture.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.event IS 'Type of event.'; +COMMENT ON COLUMN vibetype.profile_picture.id IS '@omit create,update +The profile picture''s internal id.'; -- --- Name: COLUMN events.change_id; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN profile_picture.account_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.change_id IS 'Change ID.'; +COMMENT ON COLUMN vibetype.profile_picture.account_id IS 'The account''s id.'; -- --- Name: COLUMN events.change; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN profile_picture.upload_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.change IS 'Change name.'; +COMMENT ON COLUMN vibetype.profile_picture.upload_id IS 'The upload''s id.'; -- --- Name: COLUMN events.project; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: report; Type: TABLE; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.project IS 'Name of the Sqitch project to which the change belongs.'; +CREATE TABLE vibetype.report ( + id uuid DEFAULT gen_random_uuid() NOT NULL, + reason text NOT NULL, + target_account_id uuid, + target_event_id uuid, + target_upload_id uuid, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, + created_by uuid NOT NULL, + CONSTRAINT report_check CHECK ((num_nonnulls(target_account_id, target_event_id, target_upload_id) = 1)), + CONSTRAINT report_reason_check CHECK (((char_length(reason) > 0) AND (char_length(reason) < 2000))) +); + +ALTER TABLE vibetype.report OWNER TO postgres; -- --- Name: COLUMN events.note; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: TABLE report; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.note IS 'Description of the change.'; +COMMENT ON TABLE vibetype.report IS '@omit update,delete +Stores reports made by users on other users, events, or uploads for moderation purposes.'; -- --- Name: COLUMN events.requires; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN report.id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.requires IS 'Array of the names of required changes.'; +COMMENT ON COLUMN vibetype.report.id IS '@omit create +Unique identifier for the report, generated randomly using UUIDs.'; -- --- Name: COLUMN events.conflicts; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN report.reason; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.conflicts IS 'Array of the names of conflicting changes.'; +COMMENT ON COLUMN vibetype.report.reason IS 'The reason for the report, provided by the reporting user. Must be non-empty and less than 2000 characters.'; -- --- Name: COLUMN events.tags; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN report.target_account_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.tags IS 'Tags associated with the change.'; +COMMENT ON COLUMN vibetype.report.target_account_id IS 'The ID of the account being reported, if applicable.'; -- --- Name: COLUMN events.committed_at; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN report.target_event_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.committed_at IS 'Date the event was committed.'; +COMMENT ON COLUMN vibetype.report.target_event_id IS 'The ID of the event being reported, if applicable.'; -- --- Name: COLUMN events.committer_name; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN report.target_upload_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.committer_name IS 'Name of the user who committed the event.'; +COMMENT ON COLUMN vibetype.report.target_upload_id IS 'The ID of the upload being reported, if applicable.'; -- --- Name: COLUMN events.committer_email; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN report.created_at; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.committer_email IS 'Email address of the user who committed the event.'; +COMMENT ON COLUMN vibetype.report.created_at IS '@omit create +Timestamp of when the report was created, defaults to the current timestamp.'; -- --- Name: COLUMN events.planned_at; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN report.created_by; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.planned_at IS 'Date the event was added to the plan.'; +COMMENT ON COLUMN vibetype.report.created_by IS 'The ID of the user who created the report.'; -- --- Name: COLUMN events.planner_name; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: CONSTRAINT report_check ON report; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.planner_name IS 'Name of the user who planed the change.'; +COMMENT ON CONSTRAINT report_check ON vibetype.report IS 'Ensures that the report targets exactly one element (account, event, or upload).'; -- --- Name: COLUMN events.planner_email; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: CONSTRAINT report_reason_check ON report; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.events.planner_email IS 'Email address of the user who plan planned the change.'; +COMMENT ON CONSTRAINT report_reason_check ON vibetype.report IS 'Ensures the reason field contains between 1 and 2000 characters.'; -- --- Name: projects; Type: TABLE; Schema: sqitch; Owner: postgres +-- Name: account; Type: TABLE; Schema: vibetype_private; Owner: postgres -- -CREATE TABLE sqitch.projects ( - project text NOT NULL, - uri text, - created_at timestamp with time zone DEFAULT clock_timestamp() NOT NULL, - creator_name text NOT NULL, - creator_email text NOT NULL -); - +CREATE TABLE vibetype_private.account ( + id uuid DEFAULT gen_random_uuid() NOT NULL, + birth_date date, + email_address text NOT NULL, + email_address_verification uuid DEFAULT gen_random_uuid(), + email_address_verification_valid_until timestamp with time zone, + location public.geography(Point,4326), + password_hash text NOT NULL, + password_reset_verification uuid, + password_reset_verification_valid_until timestamp with time zone, + upload_quota_bytes bigint DEFAULT 10485760 NOT NULL, + created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, + last_activity timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, + CONSTRAINT account_email_address_check CHECK ((char_length(email_address) < 255)) +); -ALTER TABLE sqitch.projects OWNER TO postgres; + +ALTER TABLE vibetype_private.account OWNER TO postgres; -- --- Name: TABLE projects; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: TABLE account; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON TABLE sqitch.projects IS 'Sqitch projects deployed to this database.'; +COMMENT ON TABLE vibetype_private.account IS 'Private account data.'; -- --- Name: COLUMN projects.project; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN account.id; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.projects.project IS 'Unique Name of a project.'; +COMMENT ON COLUMN vibetype_private.account.id IS 'The account''s internal id.'; -- --- Name: COLUMN projects.uri; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN account.birth_date; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.projects.uri IS 'Optional project URI'; +COMMENT ON COLUMN vibetype_private.account.birth_date IS 'The account owner''s date of birth.'; -- --- Name: COLUMN projects.created_at; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN account.email_address; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.projects.created_at IS 'Date the project was added to the database.'; +COMMENT ON COLUMN vibetype_private.account.email_address IS 'The account''s email address for account related information.'; -- --- Name: COLUMN projects.creator_name; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN account.email_address_verification; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.projects.creator_name IS 'Name of the user who added the project.'; +COMMENT ON COLUMN vibetype_private.account.email_address_verification IS 'The UUID used to verify an email address, or null if already verified.'; -- --- Name: COLUMN projects.creator_email; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN account.email_address_verification_valid_until; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.projects.creator_email IS 'Email address of the user who added the project.'; +COMMENT ON COLUMN vibetype_private.account.email_address_verification_valid_until IS 'The timestamp until which an email address verification is valid.'; -- --- Name: releases; Type: TABLE; Schema: sqitch; Owner: postgres +-- Name: COLUMN account.location; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -CREATE TABLE sqitch.releases ( - version real NOT NULL, - installed_at timestamp with time zone DEFAULT clock_timestamp() NOT NULL, - installer_name text NOT NULL, - installer_email text NOT NULL -); +COMMENT ON COLUMN vibetype_private.account.location IS 'The account''s geometric location.'; -ALTER TABLE sqitch.releases OWNER TO postgres; +-- +-- Name: COLUMN account.password_hash; Type: COMMENT; Schema: vibetype_private; Owner: postgres +-- + +COMMENT ON COLUMN vibetype_private.account.password_hash IS 'The account''s password, hashed and salted.'; + -- --- Name: TABLE releases; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN account.password_reset_verification; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON TABLE sqitch.releases IS 'Sqitch registry releases.'; +COMMENT ON COLUMN vibetype_private.account.password_reset_verification IS 'The UUID used to reset a password, or null if there is no pending reset request.'; -- --- Name: COLUMN releases.version; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN account.password_reset_verification_valid_until; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.releases.version IS 'Version of the Sqitch registry.'; +COMMENT ON COLUMN vibetype_private.account.password_reset_verification_valid_until IS 'The timestamp until which a password reset is valid.'; -- --- Name: COLUMN releases.installed_at; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN account.upload_quota_bytes; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.releases.installed_at IS 'Date the registry release was installed.'; +COMMENT ON COLUMN vibetype_private.account.upload_quota_bytes IS 'The account''s upload quota in bytes.'; -- --- Name: COLUMN releases.installer_name; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN account.created_at; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.releases.installer_name IS 'Name of the user who installed the registry release.'; +COMMENT ON COLUMN vibetype_private.account.created_at IS 'Timestamp at which the account was last active.'; -- --- Name: COLUMN releases.installer_email; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN account.last_activity; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.releases.installer_email IS 'Email address of the user who installed the registry release.'; +COMMENT ON COLUMN vibetype_private.account.last_activity IS 'Timestamp at which the account last requested an access token.'; -- --- Name: tags; Type: TABLE; Schema: sqitch; Owner: postgres +-- Name: achievement_code; Type: TABLE; Schema: vibetype_private; Owner: postgres -- -CREATE TABLE sqitch.tags ( - tag_id text NOT NULL, - tag text NOT NULL, - project text NOT NULL, - change_id text NOT NULL, - note text DEFAULT ''::text NOT NULL, - committed_at timestamp with time zone DEFAULT clock_timestamp() NOT NULL, - committer_name text NOT NULL, - committer_email text NOT NULL, - planned_at timestamp with time zone NOT NULL, - planner_name text NOT NULL, - planner_email text NOT NULL +CREATE TABLE vibetype_private.achievement_code ( + id uuid DEFAULT gen_random_uuid() NOT NULL, + alias text NOT NULL, + achievement vibetype.achievement_type NOT NULL, + CONSTRAINT achievement_code_alias_check CHECK ((char_length(alias) < 1000)) ); -ALTER TABLE sqitch.tags OWNER TO postgres; +ALTER TABLE vibetype_private.achievement_code OWNER TO postgres; -- --- Name: TABLE tags; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: TABLE achievement_code; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON TABLE sqitch.tags IS 'Tracks the tags currently applied to the database.'; +COMMENT ON TABLE vibetype_private.achievement_code IS 'Codes that unlock achievements.'; -- --- Name: COLUMN tags.tag_id; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN achievement_code.id; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.tags.tag_id IS 'Tag primary key.'; +COMMENT ON COLUMN vibetype_private.achievement_code.id IS 'The code that unlocks an achievement.'; -- --- Name: COLUMN tags.tag; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN achievement_code.alias; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.tags.tag IS 'Project-unique tag name.'; +COMMENT ON COLUMN vibetype_private.achievement_code.alias IS 'An alternative code, e.g. human readable, that unlocks an achievement.'; -- --- Name: COLUMN tags.project; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN achievement_code.achievement; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.tags.project IS 'Name of the Sqitch project to which the tag belongs.'; +COMMENT ON COLUMN vibetype_private.achievement_code.achievement IS 'The achievement that is unlocked by the code.'; -- --- Name: COLUMN tags.change_id; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: jwt; Type: TABLE; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.tags.change_id IS 'ID of last change deployed before the tag was applied.'; +CREATE TABLE vibetype_private.jwt ( + id uuid DEFAULT gen_random_uuid() NOT NULL, + token vibetype.jwt NOT NULL +); + +ALTER TABLE vibetype_private.jwt OWNER TO postgres; -- --- Name: COLUMN tags.note; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: TABLE jwt; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.tags.note IS 'Description of the tag.'; +COMMENT ON TABLE vibetype_private.jwt IS 'A list of tokens.'; -- --- Name: COLUMN tags.committed_at; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN jwt.id; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.tags.committed_at IS 'Date the tag was applied to the database.'; +COMMENT ON COLUMN vibetype_private.jwt.id IS 'The token''s id.'; -- --- Name: COLUMN tags.committer_name; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: COLUMN jwt.token; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON COLUMN sqitch.tags.committer_name IS 'Name of the user who applied the tag.'; +COMMENT ON COLUMN vibetype_private.jwt.token IS 'The token.'; -- --- Name: COLUMN tags.committer_email; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: invitation id; Type: DEFAULT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.tags.committer_email IS 'Email address of the user who applied the tag.'; +ALTER TABLE ONLY vibetype.invitation ALTER COLUMN id SET DEFAULT gen_random_uuid(); -- --- Name: COLUMN tags.planned_at; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: invitation created_at; Type: DEFAULT; Schema: vibetype; Owner: postgres -- -COMMENT ON COLUMN sqitch.tags.planned_at IS 'Date the tag was added to the plan.'; +ALTER TABLE ONLY vibetype.invitation ALTER COLUMN created_at SET DEFAULT CURRENT_TIMESTAMP; -- --- Name: COLUMN tags.planner_name; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: changes changes_pkey; Type: CONSTRAINT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN sqitch.tags.planner_name IS 'Name of the user who planed the tag.'; +ALTER TABLE ONLY sqitch.changes + ADD CONSTRAINT changes_pkey PRIMARY KEY (change_id); -- --- Name: COLUMN tags.planner_email; Type: COMMENT; Schema: sqitch; Owner: postgres +-- Name: changes changes_project_script_hash_key; Type: CONSTRAINT; Schema: sqitch; Owner: postgres -- -COMMENT ON COLUMN sqitch.tags.planner_email IS 'Email address of the user who planned the tag.'; +ALTER TABLE ONLY sqitch.changes + ADD CONSTRAINT changes_project_script_hash_key UNIQUE (project, script_hash); + + +-- +-- Name: dependencies dependencies_pkey; Type: CONSTRAINT; Schema: sqitch; Owner: postgres +-- + +ALTER TABLE ONLY sqitch.dependencies + ADD CONSTRAINT dependencies_pkey PRIMARY KEY (change_id, dependency); + + +-- +-- Name: events events_pkey; Type: CONSTRAINT; Schema: sqitch; Owner: postgres +-- + +ALTER TABLE ONLY sqitch.events + ADD CONSTRAINT events_pkey PRIMARY KEY (change_id, committed_at); + + +-- +-- Name: projects projects_pkey; Type: CONSTRAINT; Schema: sqitch; Owner: postgres +-- + +ALTER TABLE ONLY sqitch.projects + ADD CONSTRAINT projects_pkey PRIMARY KEY (project); + + +-- +-- Name: projects projects_uri_key; Type: CONSTRAINT; Schema: sqitch; Owner: postgres +-- + +ALTER TABLE ONLY sqitch.projects + ADD CONSTRAINT projects_uri_key UNIQUE (uri); + + +-- +-- Name: releases releases_pkey; Type: CONSTRAINT; Schema: sqitch; Owner: postgres +-- + +ALTER TABLE ONLY sqitch.releases + ADD CONSTRAINT releases_pkey PRIMARY KEY (version); -- --- Name: invitation id; Type: DEFAULT; Schema: maevsi; Owner: postgres +-- Name: tags tags_pkey; Type: CONSTRAINT; Schema: sqitch; Owner: postgres -- -ALTER TABLE ONLY maevsi.invitation ALTER COLUMN id SET DEFAULT gen_random_uuid(); +ALTER TABLE ONLY sqitch.tags + ADD CONSTRAINT tags_pkey PRIMARY KEY (tag_id); -- --- Name: invitation created_at; Type: DEFAULT; Schema: maevsi; Owner: postgres +-- Name: tags tags_project_tag_key; Type: CONSTRAINT; Schema: sqitch; Owner: postgres -- -ALTER TABLE ONLY maevsi.invitation ALTER COLUMN created_at SET DEFAULT CURRENT_TIMESTAMP; +ALTER TABLE ONLY sqitch.tags + ADD CONSTRAINT tags_project_tag_key UNIQUE (project, tag); -- --- Name: account_block account_block_created_by_blocked_account_id_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account_block account_block_created_by_blocked_account_id_key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.account_block +ALTER TABLE ONLY vibetype.account_block ADD CONSTRAINT account_block_created_by_blocked_account_id_key UNIQUE (created_by, blocked_account_id); -- --- Name: account_block account_block_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account_block account_block_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.account_block +ALTER TABLE ONLY vibetype.account_block ADD CONSTRAINT account_block_pkey PRIMARY KEY (id); -- --- Name: account_interest account_interest_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account_interest account_interest_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.account_interest +ALTER TABLE ONLY vibetype.account_interest ADD CONSTRAINT account_interest_pkey PRIMARY KEY (account_id, category); -- --- Name: account account_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account account_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.account +ALTER TABLE ONLY vibetype.account ADD CONSTRAINT account_pkey PRIMARY KEY (id); -- --- Name: account_preference_event_size account_preference_event_size_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account_preference_event_size account_preference_event_size_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.account_preference_event_size +ALTER TABLE ONLY vibetype.account_preference_event_size ADD CONSTRAINT account_preference_event_size_pkey PRIMARY KEY (account_id, event_size); -- --- Name: account_social_network account_social_network_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account_social_network account_social_network_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.account_social_network +ALTER TABLE ONLY vibetype.account_social_network ADD CONSTRAINT account_social_network_pkey PRIMARY KEY (account_id, social_network); -- --- Name: CONSTRAINT account_social_network_pkey ON account_social_network; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: CONSTRAINT account_social_network_pkey ON account_social_network; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON CONSTRAINT account_social_network_pkey ON maevsi.account_social_network IS 'Ensures uniqueness by combining the account ID and social network, allowing each account to have a single entry per social network.'; +COMMENT ON CONSTRAINT account_social_network_pkey ON vibetype.account_social_network IS 'Ensures uniqueness by combining the account ID and social network, allowing each account to have a single entry per social network.'; -- --- Name: account account_username_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account account_username_key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.account +ALTER TABLE ONLY vibetype.account ADD CONSTRAINT account_username_key UNIQUE (username); -- --- Name: achievement achievement_account_id_achievement_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: achievement achievement_account_id_achievement_key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.achievement +ALTER TABLE ONLY vibetype.achievement ADD CONSTRAINT achievement_account_id_achievement_key UNIQUE (account_id, achievement); -- --- Name: achievement achievement_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: achievement achievement_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.achievement +ALTER TABLE ONLY vibetype.achievement ADD CONSTRAINT achievement_pkey PRIMARY KEY (id); -- --- Name: address address_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: address address_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.address +ALTER TABLE ONLY vibetype.address ADD CONSTRAINT address_pkey PRIMARY KEY (id); -- --- Name: contact contact_created_by_account_id_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: contact contact_created_by_account_id_key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.contact +ALTER TABLE ONLY vibetype.contact ADD CONSTRAINT contact_created_by_account_id_key UNIQUE (created_by, account_id); -- --- Name: CONSTRAINT contact_created_by_account_id_key ON contact; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: CONSTRAINT contact_created_by_account_id_key ON contact; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON CONSTRAINT contact_created_by_account_id_key ON maevsi.contact IS 'Ensures the uniqueness of the combination of `created_by` and `account_id` for a contact.'; +COMMENT ON CONSTRAINT contact_created_by_account_id_key ON vibetype.contact IS 'Ensures the uniqueness of the combination of `created_by` and `account_id` for a contact.'; -- --- Name: contact contact_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: contact contact_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.contact +ALTER TABLE ONLY vibetype.contact ADD CONSTRAINT contact_pkey PRIMARY KEY (id); -- --- Name: event_category_mapping event_category_mapping_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_category_mapping event_category_mapping_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_category_mapping +ALTER TABLE ONLY vibetype.event_category_mapping ADD CONSTRAINT event_category_mapping_pkey PRIMARY KEY (event_id, category); -- --- Name: event_category event_category_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_category event_category_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_category +ALTER TABLE ONLY vibetype.event_category ADD CONSTRAINT event_category_pkey PRIMARY KEY (category); -- --- Name: event event_created_by_slug_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event event_created_by_slug_key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event +ALTER TABLE ONLY vibetype.event ADD CONSTRAINT event_created_by_slug_key UNIQUE (created_by, slug); -- --- Name: event_favorite event_favorite_created_by_event_id_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_favorite event_favorite_created_by_event_id_key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_favorite +ALTER TABLE ONLY vibetype.event_favorite ADD CONSTRAINT event_favorite_created_by_event_id_key UNIQUE (created_by, event_id); -- --- Name: CONSTRAINT event_favorite_created_by_event_id_key ON event_favorite; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: CONSTRAINT event_favorite_created_by_event_id_key ON event_favorite; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON CONSTRAINT event_favorite_created_by_event_id_key ON maevsi.event_favorite IS 'Ensures that each user can mark an event as a favorite only once.'; +COMMENT ON CONSTRAINT event_favorite_created_by_event_id_key ON vibetype.event_favorite IS 'Ensures that each user can mark an event as a favorite only once.'; -- --- Name: event_favorite event_favorite_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_favorite event_favorite_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_favorite +ALTER TABLE ONLY vibetype.event_favorite ADD CONSTRAINT event_favorite_pkey PRIMARY KEY (id); -- --- Name: event_group event_group_created_by_slug_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_group event_group_created_by_slug_key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_group +ALTER TABLE ONLY vibetype.event_group ADD CONSTRAINT event_group_created_by_slug_key UNIQUE (created_by, slug); -- --- Name: event_group event_group_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_group event_group_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_group +ALTER TABLE ONLY vibetype.event_group ADD CONSTRAINT event_group_pkey PRIMARY KEY (id); -- --- Name: event_grouping event_grouping_event_id_event_group_id_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_grouping event_grouping_event_id_event_group_id_key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_grouping +ALTER TABLE ONLY vibetype.event_grouping ADD CONSTRAINT event_grouping_event_id_event_group_id_key UNIQUE (event_id, event_group_id); -- --- Name: event_grouping event_grouping_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_grouping event_grouping_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_grouping +ALTER TABLE ONLY vibetype.event_grouping ADD CONSTRAINT event_grouping_pkey PRIMARY KEY (id); -- --- Name: event event_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event event_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event +ALTER TABLE ONLY vibetype.event ADD CONSTRAINT event_pkey PRIMARY KEY (id); -- --- Name: event_recommendation event_recommendation_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_recommendation event_recommendation_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_recommendation +ALTER TABLE ONLY vibetype.event_recommendation ADD CONSTRAINT event_recommendation_pkey PRIMARY KEY (account_id, event_id); -- --- Name: event_upload event_upload_event_id_upload_id_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_upload event_upload_event_id_upload_id_key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_upload +ALTER TABLE ONLY vibetype.event_upload ADD CONSTRAINT event_upload_event_id_upload_id_key UNIQUE (event_id, upload_id); -- --- Name: event_upload event_upload_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_upload event_upload_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_upload +ALTER TABLE ONLY vibetype.event_upload ADD CONSTRAINT event_upload_pkey PRIMARY KEY (id); -- --- Name: guest guest_event_id_contact_id_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: guest guest_event_id_contact_id_key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.guest +ALTER TABLE ONLY vibetype.guest ADD CONSTRAINT guest_event_id_contact_id_key UNIQUE (event_id, contact_id); -- --- Name: guest guest_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: guest guest_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.guest +ALTER TABLE ONLY vibetype.guest ADD CONSTRAINT guest_pkey PRIMARY KEY (id); -- --- Name: legal_term_acceptance legal_term_acceptance_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: legal_term_acceptance legal_term_acceptance_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.legal_term_acceptance +ALTER TABLE ONLY vibetype.legal_term_acceptance ADD CONSTRAINT legal_term_acceptance_pkey PRIMARY KEY (id); -- --- Name: legal_term legal_term_language_version_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: legal_term legal_term_language_version_key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.legal_term +ALTER TABLE ONLY vibetype.legal_term ADD CONSTRAINT legal_term_language_version_key UNIQUE (language, version); -- --- Name: legal_term legal_term_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: legal_term legal_term_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.legal_term +ALTER TABLE ONLY vibetype.legal_term ADD CONSTRAINT legal_term_pkey PRIMARY KEY (id); -- --- Name: notification notification_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: notification notification_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.notification +ALTER TABLE ONLY vibetype.notification ADD CONSTRAINT notification_pkey PRIMARY KEY (id); -- --- Name: profile_picture profile_picture_account_id_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: profile_picture profile_picture_account_id_key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.profile_picture +ALTER TABLE ONLY vibetype.profile_picture ADD CONSTRAINT profile_picture_account_id_key UNIQUE (account_id); -- --- Name: profile_picture profile_picture_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: profile_picture profile_picture_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.profile_picture +ALTER TABLE ONLY vibetype.profile_picture ADD CONSTRAINT profile_picture_pkey PRIMARY KEY (id); -- --- Name: report report_created_by_target_account_id_target_event_id_target__key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: report report_created_by_target_account_id_target_event_id_target__key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.report +ALTER TABLE ONLY vibetype.report ADD CONSTRAINT report_created_by_target_account_id_target_event_id_target__key UNIQUE (created_by, target_account_id, target_event_id, target_upload_id); -- --- Name: CONSTRAINT report_created_by_target_account_id_target_event_id_target__key ON report; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: CONSTRAINT report_created_by_target_account_id_target_event_id_target__key ON report; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON CONSTRAINT report_created_by_target_account_id_target_event_id_target__key ON maevsi.report IS 'Ensures that the same user cannot submit multiple reports on the same element (account, event, or upload).'; +COMMENT ON CONSTRAINT report_created_by_target_account_id_target_event_id_target__key ON vibetype.report IS 'Ensures that the same user cannot submit multiple reports on the same element (account, event, or upload).'; -- --- Name: report report_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: report report_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.report +ALTER TABLE ONLY vibetype.report ADD CONSTRAINT report_pkey PRIMARY KEY (id); -- --- Name: upload upload_pkey; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: upload upload_pkey; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.upload +ALTER TABLE ONLY vibetype.upload ADD CONSTRAINT upload_pkey PRIMARY KEY (id); -- --- Name: upload upload_storage_key_key; Type: CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: upload upload_storage_key_key; Type: CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.upload +ALTER TABLE ONLY vibetype.upload ADD CONSTRAINT upload_storage_key_key UNIQUE (storage_key); -- --- Name: account account_email_address_key; Type: CONSTRAINT; Schema: maevsi_private; Owner: postgres +-- Name: account account_email_address_key; Type: CONSTRAINT; Schema: vibetype_private; Owner: postgres -- -ALTER TABLE ONLY maevsi_private.account +ALTER TABLE ONLY vibetype_private.account ADD CONSTRAINT account_email_address_key UNIQUE (email_address); -- --- Name: account account_pkey; Type: CONSTRAINT; Schema: maevsi_private; Owner: postgres +-- Name: account account_pkey; Type: CONSTRAINT; Schema: vibetype_private; Owner: postgres -- -ALTER TABLE ONLY maevsi_private.account +ALTER TABLE ONLY vibetype_private.account ADD CONSTRAINT account_pkey PRIMARY KEY (id); -- --- Name: achievement_code achievement_code_alias_key; Type: CONSTRAINT; Schema: maevsi_private; Owner: postgres +-- Name: achievement_code achievement_code_alias_key; Type: CONSTRAINT; Schema: vibetype_private; Owner: postgres -- -ALTER TABLE ONLY maevsi_private.achievement_code +ALTER TABLE ONLY vibetype_private.achievement_code ADD CONSTRAINT achievement_code_alias_key UNIQUE (alias); -- --- Name: achievement_code achievement_code_pkey; Type: CONSTRAINT; Schema: maevsi_private; Owner: postgres +-- Name: achievement_code achievement_code_pkey; Type: CONSTRAINT; Schema: vibetype_private; Owner: postgres -- -ALTER TABLE ONLY maevsi_private.achievement_code +ALTER TABLE ONLY vibetype_private.achievement_code ADD CONSTRAINT achievement_code_pkey PRIMARY KEY (id); -- --- Name: jwt jwt_pkey; Type: CONSTRAINT; Schema: maevsi_private; Owner: postgres +-- Name: jwt jwt_pkey; Type: CONSTRAINT; Schema: vibetype_private; Owner: postgres -- -ALTER TABLE ONLY maevsi_private.jwt +ALTER TABLE ONLY vibetype_private.jwt ADD CONSTRAINT jwt_pkey PRIMARY KEY (id); -- --- Name: jwt jwt_token_key; Type: CONSTRAINT; Schema: maevsi_private; Owner: postgres +-- Name: jwt jwt_token_key; Type: CONSTRAINT; Schema: vibetype_private; Owner: postgres -- -ALTER TABLE ONLY maevsi_private.jwt +ALTER TABLE ONLY vibetype_private.jwt ADD CONSTRAINT jwt_token_key UNIQUE (token); -- --- Name: changes changes_pkey; Type: CONSTRAINT; Schema: sqitch; Owner: postgres --- - -ALTER TABLE ONLY sqitch.changes - ADD CONSTRAINT changes_pkey PRIMARY KEY (change_id); - - --- --- Name: changes changes_project_script_hash_key; Type: CONSTRAINT; Schema: sqitch; Owner: postgres --- - -ALTER TABLE ONLY sqitch.changes - ADD CONSTRAINT changes_project_script_hash_key UNIQUE (project, script_hash); - - --- --- Name: dependencies dependencies_pkey; Type: CONSTRAINT; Schema: sqitch; Owner: postgres --- - -ALTER TABLE ONLY sqitch.dependencies - ADD CONSTRAINT dependencies_pkey PRIMARY KEY (change_id, dependency); - - --- --- Name: events events_pkey; Type: CONSTRAINT; Schema: sqitch; Owner: postgres --- - -ALTER TABLE ONLY sqitch.events - ADD CONSTRAINT events_pkey PRIMARY KEY (change_id, committed_at); - - --- --- Name: projects projects_pkey; Type: CONSTRAINT; Schema: sqitch; Owner: postgres --- - -ALTER TABLE ONLY sqitch.projects - ADD CONSTRAINT projects_pkey PRIMARY KEY (project); - - --- --- Name: projects projects_uri_key; Type: CONSTRAINT; Schema: sqitch; Owner: postgres --- - -ALTER TABLE ONLY sqitch.projects - ADD CONSTRAINT projects_uri_key UNIQUE (uri); - - --- --- Name: releases releases_pkey; Type: CONSTRAINT; Schema: sqitch; Owner: postgres --- - -ALTER TABLE ONLY sqitch.releases - ADD CONSTRAINT releases_pkey PRIMARY KEY (version); - - --- --- Name: tags tags_pkey; Type: CONSTRAINT; Schema: sqitch; Owner: postgres --- - -ALTER TABLE ONLY sqitch.tags - ADD CONSTRAINT tags_pkey PRIMARY KEY (tag_id); - - --- --- Name: tags tags_project_tag_key; Type: CONSTRAINT; Schema: sqitch; Owner: postgres --- - -ALTER TABLE ONLY sqitch.tags - ADD CONSTRAINT tags_project_tag_key UNIQUE (project, tag); - - --- --- Name: idx_event_created_by; Type: INDEX; Schema: maevsi; Owner: postgres +-- Name: idx_event_created_by; Type: INDEX; Schema: vibetype; Owner: postgres -- -CREATE INDEX idx_event_created_by ON maevsi.event USING btree (created_by); +CREATE INDEX idx_event_created_by ON vibetype.event USING btree (created_by); -- --- Name: INDEX idx_event_created_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: INDEX idx_event_created_by; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON INDEX maevsi.idx_event_created_by IS 'Speeds up reverse foreign key lookups.'; +COMMENT ON INDEX vibetype.idx_event_created_by IS 'Speeds up reverse foreign key lookups.'; -- --- Name: idx_event_group_created_by; Type: INDEX; Schema: maevsi; Owner: postgres +-- Name: idx_event_group_created_by; Type: INDEX; Schema: vibetype; Owner: postgres -- -CREATE INDEX idx_event_group_created_by ON maevsi.event_group USING btree (created_by); +CREATE INDEX idx_event_group_created_by ON vibetype.event_group USING btree (created_by); -- --- Name: INDEX idx_event_group_created_by; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: INDEX idx_event_group_created_by; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON INDEX maevsi.idx_event_group_created_by IS 'Speeds up reverse foreign key lookups.'; +COMMENT ON INDEX vibetype.idx_event_group_created_by IS 'Speeds up reverse foreign key lookups.'; -- --- Name: idx_event_grouping_event_group_id; Type: INDEX; Schema: maevsi; Owner: postgres +-- Name: idx_event_grouping_event_group_id; Type: INDEX; Schema: vibetype; Owner: postgres -- -CREATE INDEX idx_event_grouping_event_group_id ON maevsi.event_grouping USING btree (event_group_id); +CREATE INDEX idx_event_grouping_event_group_id ON vibetype.event_grouping USING btree (event_group_id); -- --- Name: INDEX idx_event_grouping_event_group_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: INDEX idx_event_grouping_event_group_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON INDEX maevsi.idx_event_grouping_event_group_id IS 'Speeds up reverse foreign key lookups.'; +COMMENT ON INDEX vibetype.idx_event_grouping_event_group_id IS 'Speeds up reverse foreign key lookups.'; -- --- Name: idx_event_grouping_event_id; Type: INDEX; Schema: maevsi; Owner: postgres +-- Name: idx_event_grouping_event_id; Type: INDEX; Schema: vibetype; Owner: postgres -- -CREATE INDEX idx_event_grouping_event_id ON maevsi.event_grouping USING btree (event_id); +CREATE INDEX idx_event_grouping_event_id ON vibetype.event_grouping USING btree (event_id); -- --- Name: INDEX idx_event_grouping_event_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: INDEX idx_event_grouping_event_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON INDEX maevsi.idx_event_grouping_event_id IS 'Speeds up reverse foreign key lookups.'; +COMMENT ON INDEX vibetype.idx_event_grouping_event_id IS 'Speeds up reverse foreign key lookups.'; -- --- Name: idx_event_location; Type: INDEX; Schema: maevsi; Owner: postgres +-- Name: idx_event_location; Type: INDEX; Schema: vibetype; Owner: postgres -- -CREATE INDEX idx_event_location ON maevsi.event USING gist (location_geography); +CREATE INDEX idx_event_location ON vibetype.event USING gist (location_geography); -- --- Name: INDEX idx_event_location; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: INDEX idx_event_location; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON INDEX maevsi.idx_event_location IS 'Spatial index on column location in maevsi.event.'; +COMMENT ON INDEX vibetype.idx_event_location IS 'Spatial index on column location in vibetype.event.'; -- --- Name: idx_event_search_vector; Type: INDEX; Schema: maevsi; Owner: postgres +-- Name: idx_event_search_vector; Type: INDEX; Schema: vibetype; Owner: postgres -- -CREATE INDEX idx_event_search_vector ON maevsi.event USING gin (search_vector); +CREATE INDEX idx_event_search_vector ON vibetype.event USING gin (search_vector); -- --- Name: idx_guest_contact_id; Type: INDEX; Schema: maevsi; Owner: postgres +-- Name: idx_guest_contact_id; Type: INDEX; Schema: vibetype; Owner: postgres -- -CREATE INDEX idx_guest_contact_id ON maevsi.guest USING btree (contact_id); +CREATE INDEX idx_guest_contact_id ON vibetype.guest USING btree (contact_id); -- --- Name: INDEX idx_guest_contact_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: INDEX idx_guest_contact_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON INDEX maevsi.idx_guest_contact_id IS 'Speeds up reverse foreign key lookups.'; +COMMENT ON INDEX vibetype.idx_guest_contact_id IS 'Speeds up reverse foreign key lookups.'; -- --- Name: idx_guest_event_id; Type: INDEX; Schema: maevsi; Owner: postgres +-- Name: idx_guest_event_id; Type: INDEX; Schema: vibetype; Owner: postgres -- -CREATE INDEX idx_guest_event_id ON maevsi.guest USING btree (event_id); +CREATE INDEX idx_guest_event_id ON vibetype.guest USING btree (event_id); -- --- Name: INDEX idx_guest_event_id; Type: COMMENT; Schema: maevsi; Owner: postgres +-- Name: INDEX idx_guest_event_id; Type: COMMENT; Schema: vibetype; Owner: postgres -- -COMMENT ON INDEX maevsi.idx_guest_event_id IS 'Speeds up reverse foreign key lookups.'; +COMMENT ON INDEX vibetype.idx_guest_event_id IS 'Speeds up reverse foreign key lookups.'; -- --- Name: idx_account_private_location; Type: INDEX; Schema: maevsi_private; Owner: postgres +-- Name: idx_account_private_location; Type: INDEX; Schema: vibetype_private; Owner: postgres -- -CREATE INDEX idx_account_private_location ON maevsi_private.account USING gist (location); +CREATE INDEX idx_account_private_location ON vibetype_private.account USING gist (location); -- --- Name: INDEX idx_account_private_location; Type: COMMENT; Schema: maevsi_private; Owner: postgres +-- Name: INDEX idx_account_private_location; Type: COMMENT; Schema: vibetype_private; Owner: postgres -- -COMMENT ON INDEX maevsi_private.idx_account_private_location IS 'Spatial index on column location in maevsi_private.account.'; +COMMENT ON INDEX vibetype_private.idx_account_private_location IS 'Spatial index on column location in vibetype_private.account.'; -- --- Name: guest maevsi_guest_update; Type: TRIGGER; Schema: maevsi; Owner: postgres +-- Name: guest vibetype_guest_update; Type: TRIGGER; Schema: vibetype; Owner: postgres -- -CREATE TRIGGER maevsi_guest_update BEFORE UPDATE ON maevsi.guest FOR EACH ROW EXECUTE FUNCTION maevsi.trigger_guest_update(); +CREATE TRIGGER vibetype_guest_update BEFORE UPDATE ON vibetype.guest FOR EACH ROW EXECUTE FUNCTION vibetype.trigger_guest_update(); -- --- Name: legal_term maevsi_legal_term_delete; Type: TRIGGER; Schema: maevsi; Owner: postgres +-- Name: legal_term vibetype_legal_term_delete; Type: TRIGGER; Schema: vibetype; Owner: postgres -- -CREATE TRIGGER maevsi_legal_term_delete BEFORE DELETE ON maevsi.legal_term FOR EACH ROW EXECUTE FUNCTION maevsi.legal_term_change(); +CREATE TRIGGER vibetype_legal_term_delete BEFORE DELETE ON vibetype.legal_term FOR EACH ROW EXECUTE FUNCTION vibetype.legal_term_change(); -- --- Name: legal_term maevsi_legal_term_update; Type: TRIGGER; Schema: maevsi; Owner: postgres +-- Name: legal_term vibetype_legal_term_update; Type: TRIGGER; Schema: vibetype; Owner: postgres -- -CREATE TRIGGER maevsi_legal_term_update BEFORE UPDATE ON maevsi.legal_term FOR EACH ROW EXECUTE FUNCTION maevsi.legal_term_change(); +CREATE TRIGGER vibetype_legal_term_update BEFORE UPDATE ON vibetype.legal_term FOR EACH ROW EXECUTE FUNCTION vibetype.legal_term_change(); -- --- Name: address maevsi_trigger_address_update; Type: TRIGGER; Schema: maevsi; Owner: postgres +-- Name: address vibetype_trigger_address_update; Type: TRIGGER; Schema: vibetype; Owner: postgres -- -CREATE TRIGGER maevsi_trigger_address_update BEFORE UPDATE ON maevsi.address FOR EACH ROW EXECUTE FUNCTION maevsi.trigger_metadata_update(); +CREATE TRIGGER vibetype_trigger_address_update BEFORE UPDATE ON vibetype.address FOR EACH ROW EXECUTE FUNCTION vibetype.trigger_metadata_update(); -- --- Name: contact maevsi_trigger_contact_update_account_id; Type: TRIGGER; Schema: maevsi; Owner: postgres +-- Name: contact vibetype_trigger_contact_update_account_id; Type: TRIGGER; Schema: vibetype; Owner: postgres -- -CREATE TRIGGER maevsi_trigger_contact_update_account_id BEFORE UPDATE OF account_id, created_by ON maevsi.contact FOR EACH ROW EXECUTE FUNCTION maevsi.trigger_contact_update_account_id(); +CREATE TRIGGER vibetype_trigger_contact_update_account_id BEFORE UPDATE OF account_id, created_by ON vibetype.contact FOR EACH ROW EXECUTE FUNCTION vibetype.trigger_contact_update_account_id(); -- --- Name: event maevsi_trigger_event_search_vector; Type: TRIGGER; Schema: maevsi; Owner: postgres +-- Name: event vibetype_trigger_event_search_vector; Type: TRIGGER; Schema: vibetype; Owner: postgres -- -CREATE TRIGGER maevsi_trigger_event_search_vector BEFORE INSERT OR UPDATE OF name, description, language ON maevsi.event FOR EACH ROW EXECUTE FUNCTION maevsi.trigger_event_search_vector(); +CREATE TRIGGER vibetype_trigger_event_search_vector BEFORE INSERT OR UPDATE OF name, description, language ON vibetype.event FOR EACH ROW EXECUTE FUNCTION vibetype.trigger_event_search_vector(); -- --- Name: account maevsi_private_account_email_address_verification_valid_until; Type: TRIGGER; Schema: maevsi_private; Owner: postgres +-- Name: account vibetype_private_account_email_address_verification_valid_until; Type: TRIGGER; Schema: vibetype_private; Owner: postgres -- -CREATE TRIGGER maevsi_private_account_email_address_verification_valid_until BEFORE INSERT OR UPDATE OF email_address_verification ON maevsi_private.account FOR EACH ROW EXECUTE FUNCTION maevsi_private.account_email_address_verification_valid_until(); +CREATE TRIGGER vibetype_private_account_email_address_verification_valid_until BEFORE INSERT OR UPDATE OF email_address_verification ON vibetype_private.account FOR EACH ROW EXECUTE FUNCTION vibetype_private.account_email_address_verification_valid_until(); -- --- Name: account maevsi_private_account_password_reset_verification_valid_until; Type: TRIGGER; Schema: maevsi_private; Owner: postgres +-- Name: account vibetype_private_account_password_reset_verification_valid_unti; Type: TRIGGER; Schema: vibetype_private; Owner: postgres -- -CREATE TRIGGER maevsi_private_account_password_reset_verification_valid_until BEFORE INSERT OR UPDATE OF password_reset_verification ON maevsi_private.account FOR EACH ROW EXECUTE FUNCTION maevsi_private.account_password_reset_verification_valid_until(); +CREATE TRIGGER vibetype_private_account_password_reset_verification_valid_unti BEFORE INSERT OR UPDATE OF password_reset_verification ON vibetype_private.account FOR EACH ROW EXECUTE FUNCTION vibetype_private.account_password_reset_verification_valid_until(); -- --- Name: account_block account_block_blocked_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: changes changes_project_fkey; Type: FK CONSTRAINT; Schema: sqitch; Owner: postgres -- -ALTER TABLE ONLY maevsi.account_block - ADD CONSTRAINT account_block_blocked_account_id_fkey FOREIGN KEY (blocked_account_id) REFERENCES maevsi.account(id); +ALTER TABLE ONLY sqitch.changes + ADD CONSTRAINT changes_project_fkey FOREIGN KEY (project) REFERENCES sqitch.projects(project) ON UPDATE CASCADE; -- --- Name: account_block account_block_created_by_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: dependencies dependencies_change_id_fkey; Type: FK CONSTRAINT; Schema: sqitch; Owner: postgres -- -ALTER TABLE ONLY maevsi.account_block - ADD CONSTRAINT account_block_created_by_fkey FOREIGN KEY (created_by) REFERENCES maevsi.account(id); +ALTER TABLE ONLY sqitch.dependencies + ADD CONSTRAINT dependencies_change_id_fkey FOREIGN KEY (change_id) REFERENCES sqitch.changes(change_id) ON UPDATE CASCADE ON DELETE CASCADE; -- --- Name: account account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: dependencies dependencies_dependency_id_fkey; Type: FK CONSTRAINT; Schema: sqitch; Owner: postgres -- -ALTER TABLE ONLY maevsi.account - ADD CONSTRAINT account_id_fkey FOREIGN KEY (id) REFERENCES maevsi_private.account(id) ON DELETE CASCADE; +ALTER TABLE ONLY sqitch.dependencies + ADD CONSTRAINT dependencies_dependency_id_fkey FOREIGN KEY (dependency_id) REFERENCES sqitch.changes(change_id) ON UPDATE CASCADE; -- --- Name: account_interest account_interest_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: events events_project_fkey; Type: FK CONSTRAINT; Schema: sqitch; Owner: postgres -- -ALTER TABLE ONLY maevsi.account_interest - ADD CONSTRAINT account_interest_account_id_fkey FOREIGN KEY (account_id) REFERENCES maevsi.account(id) ON DELETE CASCADE; +ALTER TABLE ONLY sqitch.events + ADD CONSTRAINT events_project_fkey FOREIGN KEY (project) REFERENCES sqitch.projects(project) ON UPDATE CASCADE; -- --- Name: account_interest account_interest_category_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: tags tags_change_id_fkey; Type: FK CONSTRAINT; Schema: sqitch; Owner: postgres -- -ALTER TABLE ONLY maevsi.account_interest - ADD CONSTRAINT account_interest_category_fkey FOREIGN KEY (category) REFERENCES maevsi.event_category(category) ON DELETE CASCADE; +ALTER TABLE ONLY sqitch.tags + ADD CONSTRAINT tags_change_id_fkey FOREIGN KEY (change_id) REFERENCES sqitch.changes(change_id) ON UPDATE CASCADE; -- --- Name: account_preference_event_size account_preference_event_size_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: tags tags_project_fkey; Type: FK CONSTRAINT; Schema: sqitch; Owner: postgres -- -ALTER TABLE ONLY maevsi.account_preference_event_size - ADD CONSTRAINT account_preference_event_size_account_id_fkey FOREIGN KEY (account_id) REFERENCES maevsi.account(id); +ALTER TABLE ONLY sqitch.tags + ADD CONSTRAINT tags_project_fkey FOREIGN KEY (project) REFERENCES sqitch.projects(project) ON UPDATE CASCADE; -- --- Name: account_social_network account_social_network_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account_block account_block_blocked_account_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.account_social_network - ADD CONSTRAINT account_social_network_account_id_fkey FOREIGN KEY (account_id) REFERENCES maevsi.account(id) ON DELETE CASCADE; +ALTER TABLE ONLY vibetype.account_block + ADD CONSTRAINT account_block_blocked_account_id_fkey FOREIGN KEY (blocked_account_id) REFERENCES vibetype.account(id); -- --- Name: achievement achievement_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account_block account_block_created_by_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.achievement - ADD CONSTRAINT achievement_account_id_fkey FOREIGN KEY (account_id) REFERENCES maevsi.account(id); +ALTER TABLE ONLY vibetype.account_block + ADD CONSTRAINT account_block_created_by_fkey FOREIGN KEY (created_by) REFERENCES vibetype.account(id); -- --- Name: address address_created_by_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account account_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.address - ADD CONSTRAINT address_created_by_fkey FOREIGN KEY (created_by) REFERENCES maevsi.account(id); +ALTER TABLE ONLY vibetype.account + ADD CONSTRAINT account_id_fkey FOREIGN KEY (id) REFERENCES vibetype_private.account(id) ON DELETE CASCADE; -- --- Name: address address_updated_by_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account_interest account_interest_account_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.address - ADD CONSTRAINT address_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES maevsi.account(id); +ALTER TABLE ONLY vibetype.account_interest + ADD CONSTRAINT account_interest_account_id_fkey FOREIGN KEY (account_id) REFERENCES vibetype.account(id) ON DELETE CASCADE; -- --- Name: contact contact_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account_interest account_interest_category_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.contact - ADD CONSTRAINT contact_account_id_fkey FOREIGN KEY (account_id) REFERENCES maevsi.account(id); +ALTER TABLE ONLY vibetype.account_interest + ADD CONSTRAINT account_interest_category_fkey FOREIGN KEY (category) REFERENCES vibetype.event_category(category) ON DELETE CASCADE; -- --- Name: contact contact_address_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account_preference_event_size account_preference_event_size_account_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.contact - ADD CONSTRAINT contact_address_id_fkey FOREIGN KEY (address_id) REFERENCES maevsi.address(id); +ALTER TABLE ONLY vibetype.account_preference_event_size + ADD CONSTRAINT account_preference_event_size_account_id_fkey FOREIGN KEY (account_id) REFERENCES vibetype.account(id); -- --- Name: contact contact_created_by_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: account_social_network account_social_network_account_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.contact - ADD CONSTRAINT contact_created_by_fkey FOREIGN KEY (created_by) REFERENCES maevsi.account(id) ON DELETE CASCADE; +ALTER TABLE ONLY vibetype.account_social_network + ADD CONSTRAINT account_social_network_account_id_fkey FOREIGN KEY (account_id) REFERENCES vibetype.account(id) ON DELETE CASCADE; -- --- Name: event event_address_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: achievement achievement_account_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event - ADD CONSTRAINT event_address_id_fkey FOREIGN KEY (address_id) REFERENCES maevsi.address(id); +ALTER TABLE ONLY vibetype.achievement + ADD CONSTRAINT achievement_account_id_fkey FOREIGN KEY (account_id) REFERENCES vibetype.account(id); -- --- Name: event_category_mapping event_category_mapping_category_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: address address_created_by_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_category_mapping - ADD CONSTRAINT event_category_mapping_category_fkey FOREIGN KEY (category) REFERENCES maevsi.event_category(category) ON DELETE CASCADE; +ALTER TABLE ONLY vibetype.address + ADD CONSTRAINT address_created_by_fkey FOREIGN KEY (created_by) REFERENCES vibetype.account(id); -- --- Name: event_category_mapping event_category_mapping_event_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: address address_updated_by_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_category_mapping - ADD CONSTRAINT event_category_mapping_event_id_fkey FOREIGN KEY (event_id) REFERENCES maevsi.event(id) ON DELETE CASCADE; +ALTER TABLE ONLY vibetype.address + ADD CONSTRAINT address_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES vibetype.account(id); -- --- Name: event event_created_by_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: contact contact_account_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event - ADD CONSTRAINT event_created_by_fkey FOREIGN KEY (created_by) REFERENCES maevsi.account(id); +ALTER TABLE ONLY vibetype.contact + ADD CONSTRAINT contact_account_id_fkey FOREIGN KEY (account_id) REFERENCES vibetype.account(id); -- --- Name: event_favorite event_favorite_created_by_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: contact contact_address_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_favorite - ADD CONSTRAINT event_favorite_created_by_fkey FOREIGN KEY (created_by) REFERENCES maevsi.account(id); +ALTER TABLE ONLY vibetype.contact + ADD CONSTRAINT contact_address_id_fkey FOREIGN KEY (address_id) REFERENCES vibetype.address(id); -- --- Name: event_favorite event_favorite_event_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: contact contact_created_by_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_favorite - ADD CONSTRAINT event_favorite_event_id_fkey FOREIGN KEY (event_id) REFERENCES maevsi.event(id); +ALTER TABLE ONLY vibetype.contact + ADD CONSTRAINT contact_created_by_fkey FOREIGN KEY (created_by) REFERENCES vibetype.account(id) ON DELETE CASCADE; -- --- Name: event_group event_group_created_by_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event event_address_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_group - ADD CONSTRAINT event_group_created_by_fkey FOREIGN KEY (created_by) REFERENCES maevsi.account(id); +ALTER TABLE ONLY vibetype.event + ADD CONSTRAINT event_address_id_fkey FOREIGN KEY (address_id) REFERENCES vibetype.address(id); -- --- Name: event_grouping event_grouping_event_group_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_category_mapping event_category_mapping_category_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_grouping - ADD CONSTRAINT event_grouping_event_group_id_fkey FOREIGN KEY (event_group_id) REFERENCES maevsi.event_group(id); +ALTER TABLE ONLY vibetype.event_category_mapping + ADD CONSTRAINT event_category_mapping_category_fkey FOREIGN KEY (category) REFERENCES vibetype.event_category(category) ON DELETE CASCADE; -- --- Name: event_grouping event_grouping_event_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_category_mapping event_category_mapping_event_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_grouping - ADD CONSTRAINT event_grouping_event_id_fkey FOREIGN KEY (event_id) REFERENCES maevsi.event(id); +ALTER TABLE ONLY vibetype.event_category_mapping + ADD CONSTRAINT event_category_mapping_event_id_fkey FOREIGN KEY (event_id) REFERENCES vibetype.event(id) ON DELETE CASCADE; -- --- Name: event_recommendation event_recommendation_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event event_created_by_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_recommendation - ADD CONSTRAINT event_recommendation_account_id_fkey FOREIGN KEY (account_id) REFERENCES maevsi.account(id) ON DELETE CASCADE; +ALTER TABLE ONLY vibetype.event + ADD CONSTRAINT event_created_by_fkey FOREIGN KEY (created_by) REFERENCES vibetype.account(id); -- --- Name: event_recommendation event_recommendation_event_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_favorite event_favorite_created_by_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_recommendation - ADD CONSTRAINT event_recommendation_event_id_fkey FOREIGN KEY (event_id) REFERENCES maevsi.event(id) ON DELETE CASCADE; +ALTER TABLE ONLY vibetype.event_favorite + ADD CONSTRAINT event_favorite_created_by_fkey FOREIGN KEY (created_by) REFERENCES vibetype.account(id); -- --- Name: event_upload event_upload_event_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_favorite event_favorite_event_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_upload - ADD CONSTRAINT event_upload_event_id_fkey FOREIGN KEY (event_id) REFERENCES maevsi.event(id); +ALTER TABLE ONLY vibetype.event_favorite + ADD CONSTRAINT event_favorite_event_id_fkey FOREIGN KEY (event_id) REFERENCES vibetype.event(id); -- --- Name: event_upload event_upload_upload_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_group event_group_created_by_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.event_upload - ADD CONSTRAINT event_upload_upload_id_fkey FOREIGN KEY (upload_id) REFERENCES maevsi.upload(id); +ALTER TABLE ONLY vibetype.event_group + ADD CONSTRAINT event_group_created_by_fkey FOREIGN KEY (created_by) REFERENCES vibetype.account(id); -- --- Name: guest guest_contact_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_grouping event_grouping_event_group_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.guest - ADD CONSTRAINT guest_contact_id_fkey FOREIGN KEY (contact_id) REFERENCES maevsi.contact(id); +ALTER TABLE ONLY vibetype.event_grouping + ADD CONSTRAINT event_grouping_event_group_id_fkey FOREIGN KEY (event_group_id) REFERENCES vibetype.event_group(id); -- --- Name: guest guest_event_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_grouping event_grouping_event_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.guest - ADD CONSTRAINT guest_event_id_fkey FOREIGN KEY (event_id) REFERENCES maevsi.event(id); +ALTER TABLE ONLY vibetype.event_grouping + ADD CONSTRAINT event_grouping_event_id_fkey FOREIGN KEY (event_id) REFERENCES vibetype.event(id); -- --- Name: guest guest_updated_by_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_recommendation event_recommendation_account_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.guest - ADD CONSTRAINT guest_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES maevsi.account(id); +ALTER TABLE ONLY vibetype.event_recommendation + ADD CONSTRAINT event_recommendation_account_id_fkey FOREIGN KEY (account_id) REFERENCES vibetype.account(id) ON DELETE CASCADE; -- --- Name: invitation invitation_created_by_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_recommendation event_recommendation_event_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.invitation - ADD CONSTRAINT invitation_created_by_fkey FOREIGN KEY (created_by) REFERENCES maevsi.account(id); +ALTER TABLE ONLY vibetype.event_recommendation + ADD CONSTRAINT event_recommendation_event_id_fkey FOREIGN KEY (event_id) REFERENCES vibetype.event(id) ON DELETE CASCADE; -- --- Name: invitation invitation_guest_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_upload event_upload_event_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.invitation - ADD CONSTRAINT invitation_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES maevsi.guest(id); +ALTER TABLE ONLY vibetype.event_upload + ADD CONSTRAINT event_upload_event_id_fkey FOREIGN KEY (event_id) REFERENCES vibetype.event(id); -- --- Name: legal_term_acceptance legal_term_acceptance_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: event_upload event_upload_upload_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.legal_term_acceptance - ADD CONSTRAINT legal_term_acceptance_account_id_fkey FOREIGN KEY (account_id) REFERENCES maevsi.account(id) ON DELETE CASCADE; +ALTER TABLE ONLY vibetype.event_upload + ADD CONSTRAINT event_upload_upload_id_fkey FOREIGN KEY (upload_id) REFERENCES vibetype.upload(id); -- --- Name: legal_term_acceptance legal_term_acceptance_legal_term_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: guest guest_contact_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.legal_term_acceptance - ADD CONSTRAINT legal_term_acceptance_legal_term_id_fkey FOREIGN KEY (legal_term_id) REFERENCES maevsi.legal_term(id) ON DELETE RESTRICT; +ALTER TABLE ONLY vibetype.guest + ADD CONSTRAINT guest_contact_id_fkey FOREIGN KEY (contact_id) REFERENCES vibetype.contact(id); -- --- Name: profile_picture profile_picture_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: guest guest_event_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.profile_picture - ADD CONSTRAINT profile_picture_account_id_fkey FOREIGN KEY (account_id) REFERENCES maevsi.account(id); +ALTER TABLE ONLY vibetype.guest + ADD CONSTRAINT guest_event_id_fkey FOREIGN KEY (event_id) REFERENCES vibetype.event(id); -- --- Name: profile_picture profile_picture_upload_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: guest guest_updated_by_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.profile_picture - ADD CONSTRAINT profile_picture_upload_id_fkey FOREIGN KEY (upload_id) REFERENCES maevsi.upload(id); +ALTER TABLE ONLY vibetype.guest + ADD CONSTRAINT guest_updated_by_fkey FOREIGN KEY (updated_by) REFERENCES vibetype.account(id); -- --- Name: report report_created_by_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: invitation invitation_created_by_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.report - ADD CONSTRAINT report_created_by_fkey FOREIGN KEY (created_by) REFERENCES maevsi.account(id); +ALTER TABLE ONLY vibetype.invitation + ADD CONSTRAINT invitation_created_by_fkey FOREIGN KEY (created_by) REFERENCES vibetype.account(id); -- --- Name: report report_target_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: invitation invitation_guest_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.report - ADD CONSTRAINT report_target_account_id_fkey FOREIGN KEY (target_account_id) REFERENCES maevsi.account(id); +ALTER TABLE ONLY vibetype.invitation + ADD CONSTRAINT invitation_guest_id_fkey FOREIGN KEY (guest_id) REFERENCES vibetype.guest(id); -- --- Name: report report_target_event_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: legal_term_acceptance legal_term_acceptance_account_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.report - ADD CONSTRAINT report_target_event_id_fkey FOREIGN KEY (target_event_id) REFERENCES maevsi.event(id); +ALTER TABLE ONLY vibetype.legal_term_acceptance + ADD CONSTRAINT legal_term_acceptance_account_id_fkey FOREIGN KEY (account_id) REFERENCES vibetype.account(id) ON DELETE CASCADE; -- --- Name: report report_target_upload_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: legal_term_acceptance legal_term_acceptance_legal_term_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.report - ADD CONSTRAINT report_target_upload_id_fkey FOREIGN KEY (target_upload_id) REFERENCES maevsi.upload(id); +ALTER TABLE ONLY vibetype.legal_term_acceptance + ADD CONSTRAINT legal_term_acceptance_legal_term_id_fkey FOREIGN KEY (legal_term_id) REFERENCES vibetype.legal_term(id) ON DELETE RESTRICT; -- --- Name: upload upload_account_id_fkey; Type: FK CONSTRAINT; Schema: maevsi; Owner: postgres +-- Name: profile_picture profile_picture_account_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY maevsi.upload - ADD CONSTRAINT upload_account_id_fkey FOREIGN KEY (account_id) REFERENCES maevsi.account(id); +ALTER TABLE ONLY vibetype.profile_picture + ADD CONSTRAINT profile_picture_account_id_fkey FOREIGN KEY (account_id) REFERENCES vibetype.account(id); -- --- Name: changes changes_project_fkey; Type: FK CONSTRAINT; Schema: sqitch; Owner: postgres +-- Name: profile_picture profile_picture_upload_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY sqitch.changes - ADD CONSTRAINT changes_project_fkey FOREIGN KEY (project) REFERENCES sqitch.projects(project) ON UPDATE CASCADE; +ALTER TABLE ONLY vibetype.profile_picture + ADD CONSTRAINT profile_picture_upload_id_fkey FOREIGN KEY (upload_id) REFERENCES vibetype.upload(id); -- --- Name: dependencies dependencies_change_id_fkey; Type: FK CONSTRAINT; Schema: sqitch; Owner: postgres +-- Name: report report_created_by_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY sqitch.dependencies - ADD CONSTRAINT dependencies_change_id_fkey FOREIGN KEY (change_id) REFERENCES sqitch.changes(change_id) ON UPDATE CASCADE ON DELETE CASCADE; +ALTER TABLE ONLY vibetype.report + ADD CONSTRAINT report_created_by_fkey FOREIGN KEY (created_by) REFERENCES vibetype.account(id); -- --- Name: dependencies dependencies_dependency_id_fkey; Type: FK CONSTRAINT; Schema: sqitch; Owner: postgres +-- Name: report report_target_account_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY sqitch.dependencies - ADD CONSTRAINT dependencies_dependency_id_fkey FOREIGN KEY (dependency_id) REFERENCES sqitch.changes(change_id) ON UPDATE CASCADE; +ALTER TABLE ONLY vibetype.report + ADD CONSTRAINT report_target_account_id_fkey FOREIGN KEY (target_account_id) REFERENCES vibetype.account(id); -- --- Name: events events_project_fkey; Type: FK CONSTRAINT; Schema: sqitch; Owner: postgres +-- Name: report report_target_event_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY sqitch.events - ADD CONSTRAINT events_project_fkey FOREIGN KEY (project) REFERENCES sqitch.projects(project) ON UPDATE CASCADE; +ALTER TABLE ONLY vibetype.report + ADD CONSTRAINT report_target_event_id_fkey FOREIGN KEY (target_event_id) REFERENCES vibetype.event(id); -- --- Name: tags tags_change_id_fkey; Type: FK CONSTRAINT; Schema: sqitch; Owner: postgres +-- Name: report report_target_upload_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY sqitch.tags - ADD CONSTRAINT tags_change_id_fkey FOREIGN KEY (change_id) REFERENCES sqitch.changes(change_id) ON UPDATE CASCADE; +ALTER TABLE ONLY vibetype.report + ADD CONSTRAINT report_target_upload_id_fkey FOREIGN KEY (target_upload_id) REFERENCES vibetype.upload(id); -- --- Name: tags tags_project_fkey; Type: FK CONSTRAINT; Schema: sqitch; Owner: postgres +-- Name: upload upload_account_id_fkey; Type: FK CONSTRAINT; Schema: vibetype; Owner: postgres -- -ALTER TABLE ONLY sqitch.tags - ADD CONSTRAINT tags_project_fkey FOREIGN KEY (project) REFERENCES sqitch.projects(project) ON UPDATE CASCADE; +ALTER TABLE ONLY vibetype.upload + ADD CONSTRAINT upload_account_id_fkey FOREIGN KEY (account_id) REFERENCES vibetype.account(id); -- --- Name: account; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: account; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.account ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.account ENABLE ROW LEVEL SECURITY; -- --- Name: account_block; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: account_block; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.account_block ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.account_block ENABLE ROW LEVEL SECURITY; -- --- Name: account_block account_block_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: account_block account_block_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY account_block_insert ON maevsi.account_block FOR INSERT WITH CHECK (((maevsi.invoker_account_id() IS NOT NULL) AND (created_by = maevsi.invoker_account_id()))); +CREATE POLICY account_block_insert ON vibetype.account_block FOR INSERT WITH CHECK (((vibetype.invoker_account_id() IS NOT NULL) AND (created_by = vibetype.invoker_account_id()))); -- --- Name: account_block account_block_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: account_block account_block_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY account_block_select ON maevsi.account_block FOR SELECT USING (((created_by = maevsi.invoker_account_id()) OR (blocked_account_id = maevsi.invoker_account_id()))); +CREATE POLICY account_block_select ON vibetype.account_block FOR SELECT USING (((created_by = vibetype.invoker_account_id()) OR (blocked_account_id = vibetype.invoker_account_id()))); -- --- Name: account_interest; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: account_interest; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.account_interest ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.account_interest ENABLE ROW LEVEL SECURITY; -- --- Name: account_interest account_interest_delete; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: account_interest account_interest_delete; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY account_interest_delete ON maevsi.account_interest FOR DELETE USING ((account_id = maevsi.invoker_account_id())); +CREATE POLICY account_interest_delete ON vibetype.account_interest FOR DELETE USING ((account_id = vibetype.invoker_account_id())); -- --- Name: account_interest account_interest_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: account_interest account_interest_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY account_interest_insert ON maevsi.account_interest FOR INSERT WITH CHECK ((account_id = maevsi.invoker_account_id())); +CREATE POLICY account_interest_insert ON vibetype.account_interest FOR INSERT WITH CHECK ((account_id = vibetype.invoker_account_id())); -- --- Name: account_interest account_interest_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: account_interest account_interest_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY account_interest_select ON maevsi.account_interest FOR SELECT USING ((account_id = maevsi.invoker_account_id())); +CREATE POLICY account_interest_select ON vibetype.account_interest FOR SELECT USING ((account_id = vibetype.invoker_account_id())); -- --- Name: account_preference_event_size; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: account_preference_event_size; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.account_preference_event_size ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.account_preference_event_size ENABLE ROW LEVEL SECURITY; -- --- Name: account_preference_event_size account_preference_event_size_delete; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: account_preference_event_size account_preference_event_size_delete; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY account_preference_event_size_delete ON maevsi.account_preference_event_size FOR DELETE USING ((account_id = maevsi.invoker_account_id())); +CREATE POLICY account_preference_event_size_delete ON vibetype.account_preference_event_size FOR DELETE USING ((account_id = vibetype.invoker_account_id())); -- --- Name: account_preference_event_size account_preference_event_size_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: account_preference_event_size account_preference_event_size_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY account_preference_event_size_insert ON maevsi.account_preference_event_size FOR INSERT WITH CHECK ((account_id = maevsi.invoker_account_id())); +CREATE POLICY account_preference_event_size_insert ON vibetype.account_preference_event_size FOR INSERT WITH CHECK ((account_id = vibetype.invoker_account_id())); -- --- Name: account_preference_event_size account_preference_event_size_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: account_preference_event_size account_preference_event_size_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY account_preference_event_size_select ON maevsi.account_preference_event_size FOR SELECT USING ((account_id = maevsi.invoker_account_id())); +CREATE POLICY account_preference_event_size_select ON vibetype.account_preference_event_size FOR SELECT USING ((account_id = vibetype.invoker_account_id())); -- --- Name: account account_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: account account_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY account_select ON maevsi.account FOR SELECT USING (true); +CREATE POLICY account_select ON vibetype.account FOR SELECT USING (true); -- --- Name: account_social_network; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: account_social_network; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.account_social_network ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.account_social_network ENABLE ROW LEVEL SECURITY; -- --- Name: account_social_network account_social_network_delete; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: account_social_network account_social_network_delete; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY account_social_network_delete ON maevsi.account_social_network FOR DELETE USING ((account_id = maevsi.invoker_account_id())); +CREATE POLICY account_social_network_delete ON vibetype.account_social_network FOR DELETE USING ((account_id = vibetype.invoker_account_id())); -- --- Name: account_social_network account_social_network_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: account_social_network account_social_network_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY account_social_network_insert ON maevsi.account_social_network FOR INSERT WITH CHECK ((account_id = maevsi.invoker_account_id())); +CREATE POLICY account_social_network_insert ON vibetype.account_social_network FOR INSERT WITH CHECK ((account_id = vibetype.invoker_account_id())); -- --- Name: account_social_network account_social_network_update; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: account_social_network account_social_network_update; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY account_social_network_update ON maevsi.account_social_network FOR UPDATE USING ((account_id = maevsi.invoker_account_id())); +CREATE POLICY account_social_network_update ON vibetype.account_social_network FOR UPDATE USING ((account_id = vibetype.invoker_account_id())); -- --- Name: achievement; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: achievement; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.achievement ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.achievement ENABLE ROW LEVEL SECURITY; -- --- Name: achievement achievement_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: achievement achievement_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY achievement_select ON maevsi.achievement FOR SELECT USING (true); +CREATE POLICY achievement_select ON vibetype.achievement FOR SELECT USING (true); -- --- Name: address; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: address; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.address ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.address ENABLE ROW LEVEL SECURITY; -- --- Name: address address_delete; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: address address_delete; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY address_delete ON maevsi.address FOR DELETE USING ((created_by = maevsi.invoker_account_id())); +CREATE POLICY address_delete ON vibetype.address FOR DELETE USING ((created_by = vibetype.invoker_account_id())); -- --- Name: address address_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: address address_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY address_insert ON maevsi.address FOR INSERT WITH CHECK ((created_by = maevsi.invoker_account_id())); +CREATE POLICY address_insert ON vibetype.address FOR INSERT WITH CHECK ((created_by = vibetype.invoker_account_id())); -- --- Name: address address_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: address address_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY address_select ON maevsi.address FOR SELECT USING (((created_by = maevsi.invoker_account_id()) AND (NOT (created_by IN ( SELECT account_block_ids.id - FROM maevsi_private.account_block_ids() account_block_ids(id)))))); +CREATE POLICY address_select ON vibetype.address FOR SELECT USING (((created_by = vibetype.invoker_account_id()) AND (NOT (created_by IN ( SELECT account_block_ids.id + FROM vibetype_private.account_block_ids() account_block_ids(id)))))); -- --- Name: address address_update; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: address address_update; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY address_update ON maevsi.address FOR UPDATE USING ((created_by = maevsi.invoker_account_id())); +CREATE POLICY address_update ON vibetype.address FOR UPDATE USING ((created_by = vibetype.invoker_account_id())); -- --- Name: contact; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: contact; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.contact ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.contact ENABLE ROW LEVEL SECURITY; -- --- Name: contact contact_delete; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: contact contact_delete; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY contact_delete ON maevsi.contact FOR DELETE USING (((maevsi.invoker_account_id() IS NOT NULL) AND (created_by = maevsi.invoker_account_id()) AND (account_id IS DISTINCT FROM maevsi.invoker_account_id()))); +CREATE POLICY contact_delete ON vibetype.contact FOR DELETE USING (((vibetype.invoker_account_id() IS NOT NULL) AND (created_by = vibetype.invoker_account_id()) AND (account_id IS DISTINCT FROM vibetype.invoker_account_id()))); -- --- Name: contact contact_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: contact contact_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY contact_insert ON maevsi.contact FOR INSERT WITH CHECK (((created_by = maevsi.invoker_account_id()) AND (NOT (account_id IN ( SELECT account_block.blocked_account_id - FROM maevsi.account_block - WHERE (account_block.created_by = maevsi.invoker_account_id())))))); +CREATE POLICY contact_insert ON vibetype.contact FOR INSERT WITH CHECK (((created_by = vibetype.invoker_account_id()) AND (NOT (account_id IN ( SELECT account_block.blocked_account_id + FROM vibetype.account_block + WHERE (account_block.created_by = vibetype.invoker_account_id())))))); -- --- Name: contact contact_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: contact contact_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY contact_select ON maevsi.contact FOR SELECT USING ((((account_id = maevsi.invoker_account_id()) AND (NOT (created_by IN ( SELECT account_block_ids.id - FROM maevsi_private.account_block_ids() account_block_ids(id))))) OR ((created_by = maevsi.invoker_account_id()) AND ((account_id IS NULL) OR (NOT (account_id IN ( SELECT account_block_ids.id - FROM maevsi_private.account_block_ids() account_block_ids(id)))))) OR (id IN ( SELECT maevsi.guest_contact_ids() AS guest_contact_ids)))); +CREATE POLICY contact_select ON vibetype.contact FOR SELECT USING ((((account_id = vibetype.invoker_account_id()) AND (NOT (created_by IN ( SELECT account_block_ids.id + FROM vibetype_private.account_block_ids() account_block_ids(id))))) OR ((created_by = vibetype.invoker_account_id()) AND ((account_id IS NULL) OR (NOT (account_id IN ( SELECT account_block_ids.id + FROM vibetype_private.account_block_ids() account_block_ids(id)))))) OR (id IN ( SELECT vibetype.guest_contact_ids() AS guest_contact_ids)))); -- --- Name: contact contact_update; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: contact contact_update; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY contact_update ON maevsi.contact FOR UPDATE USING (((created_by = maevsi.invoker_account_id()) AND (NOT (account_id IN ( SELECT account_block.blocked_account_id - FROM maevsi.account_block - WHERE (account_block.created_by = maevsi.invoker_account_id())))))); +CREATE POLICY contact_update ON vibetype.contact FOR UPDATE USING (((created_by = vibetype.invoker_account_id()) AND (NOT (account_id IN ( SELECT account_block.blocked_account_id + FROM vibetype.account_block + WHERE (account_block.created_by = vibetype.invoker_account_id())))))); -- --- Name: event; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: event; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.event ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event ENABLE ROW LEVEL SECURITY; -- --- Name: event_category_mapping; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: event_category_mapping; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.event_category_mapping ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event_category_mapping ENABLE ROW LEVEL SECURITY; -- --- Name: event_category_mapping event_category_mapping_delete; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event_category_mapping event_category_mapping_delete; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_category_mapping_delete ON maevsi.event_category_mapping FOR DELETE USING (((maevsi.invoker_account_id() IS NOT NULL) AND (( SELECT event.created_by - FROM maevsi.event - WHERE (event.id = event_category_mapping.event_id)) = maevsi.invoker_account_id()))); +CREATE POLICY event_category_mapping_delete ON vibetype.event_category_mapping FOR DELETE USING (((vibetype.invoker_account_id() IS NOT NULL) AND (( SELECT event.created_by + FROM vibetype.event + WHERE (event.id = event_category_mapping.event_id)) = vibetype.invoker_account_id()))); -- --- Name: event_category_mapping event_category_mapping_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event_category_mapping event_category_mapping_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_category_mapping_insert ON maevsi.event_category_mapping FOR INSERT WITH CHECK (((maevsi.invoker_account_id() IS NOT NULL) AND (( SELECT event.created_by - FROM maevsi.event - WHERE (event.id = event_category_mapping.event_id)) = maevsi.invoker_account_id()))); +CREATE POLICY event_category_mapping_insert ON vibetype.event_category_mapping FOR INSERT WITH CHECK (((vibetype.invoker_account_id() IS NOT NULL) AND (( SELECT event.created_by + FROM vibetype.event + WHERE (event.id = event_category_mapping.event_id)) = vibetype.invoker_account_id()))); -- --- Name: event_category_mapping event_category_mapping_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event_category_mapping event_category_mapping_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_category_mapping_select ON maevsi.event_category_mapping FOR SELECT USING ((((maevsi.invoker_account_id() IS NOT NULL) AND (( SELECT event.created_by - FROM maevsi.event - WHERE (event.id = event_category_mapping.event_id)) = maevsi.invoker_account_id())) OR (event_id IN ( SELECT maevsi_private.events_invited() AS events_invited)) OR ((( SELECT event.visibility - FROM maevsi.event - WHERE (event.id = event_category_mapping.event_id)) = 'public'::maevsi.event_visibility) AND (NOT (( SELECT event.created_by - FROM maevsi.event +CREATE POLICY event_category_mapping_select ON vibetype.event_category_mapping FOR SELECT USING ((((vibetype.invoker_account_id() IS NOT NULL) AND (( SELECT event.created_by + FROM vibetype.event + WHERE (event.id = event_category_mapping.event_id)) = vibetype.invoker_account_id())) OR (event_id IN ( SELECT vibetype_private.events_invited() AS events_invited)) OR ((( SELECT event.visibility + FROM vibetype.event + WHERE (event.id = event_category_mapping.event_id)) = 'public'::vibetype.event_visibility) AND (NOT (( SELECT event.created_by + FROM vibetype.event WHERE (event.id = event_category_mapping.event_id)) IN ( SELECT account_block_ids.id - FROM maevsi_private.account_block_ids() account_block_ids(id))))))); + FROM vibetype_private.account_block_ids() account_block_ids(id))))))); -- --- Name: event event_delete; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event event_delete; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_delete ON maevsi.event FOR DELETE USING ((created_by = maevsi.invoker_account_id())); +CREATE POLICY event_delete ON vibetype.event FOR DELETE USING ((created_by = vibetype.invoker_account_id())); -- --- Name: event_favorite; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: event_favorite; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.event_favorite ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event_favorite ENABLE ROW LEVEL SECURITY; -- --- Name: event_favorite event_favorite_delete; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event_favorite event_favorite_delete; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_favorite_delete ON maevsi.event_favorite FOR DELETE USING ((created_by = maevsi.invoker_account_id())); +CREATE POLICY event_favorite_delete ON vibetype.event_favorite FOR DELETE USING ((created_by = vibetype.invoker_account_id())); -- --- Name: event_favorite event_favorite_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event_favorite event_favorite_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_favorite_insert ON maevsi.event_favorite FOR INSERT WITH CHECK ((created_by = maevsi.invoker_account_id())); +CREATE POLICY event_favorite_insert ON vibetype.event_favorite FOR INSERT WITH CHECK ((created_by = vibetype.invoker_account_id())); -- --- Name: event_favorite event_favorite_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event_favorite event_favorite_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_favorite_select ON maevsi.event_favorite FOR SELECT USING ((created_by = maevsi.invoker_account_id())); +CREATE POLICY event_favorite_select ON vibetype.event_favorite FOR SELECT USING ((created_by = vibetype.invoker_account_id())); -- --- Name: event_group; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: event_group; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.event_group ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event_group ENABLE ROW LEVEL SECURITY; -- --- Name: event_grouping; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: event_grouping; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.event_grouping ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event_grouping ENABLE ROW LEVEL SECURITY; -- --- Name: event event_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event event_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_insert ON maevsi.event FOR INSERT WITH CHECK (((maevsi.invoker_account_id() IS NOT NULL) AND (created_by = maevsi.invoker_account_id()))); +CREATE POLICY event_insert ON vibetype.event FOR INSERT WITH CHECK (((vibetype.invoker_account_id() IS NOT NULL) AND (created_by = vibetype.invoker_account_id()))); -- --- Name: event_recommendation; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: event_recommendation; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.event_recommendation ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event_recommendation ENABLE ROW LEVEL SECURITY; -- --- Name: event_recommendation event_recommendation_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event_recommendation event_recommendation_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_recommendation_select ON maevsi.event_recommendation FOR SELECT USING (((maevsi.invoker_account_id() IS NOT NULL) AND (account_id = maevsi.invoker_account_id()))); +CREATE POLICY event_recommendation_select ON vibetype.event_recommendation FOR SELECT USING (((vibetype.invoker_account_id() IS NOT NULL) AND (account_id = vibetype.invoker_account_id()))); -- --- Name: event event_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event event_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_select ON maevsi.event FOR SELECT USING ((((visibility = 'public'::maevsi.event_visibility) AND ((guest_count_maximum IS NULL) OR (guest_count_maximum > maevsi.guest_count(id))) AND (NOT (created_by IN ( SELECT account_block_ids.id - FROM maevsi_private.account_block_ids() account_block_ids(id))))) OR (created_by = maevsi.invoker_account_id()) OR (id IN ( SELECT maevsi_private.events_invited() AS events_invited)))); +CREATE POLICY event_select ON vibetype.event FOR SELECT USING ((((visibility = 'public'::vibetype.event_visibility) AND ((guest_count_maximum IS NULL) OR (guest_count_maximum > vibetype.guest_count(id))) AND (NOT (created_by IN ( SELECT account_block_ids.id + FROM vibetype_private.account_block_ids() account_block_ids(id))))) OR (created_by = vibetype.invoker_account_id()) OR (id IN ( SELECT vibetype_private.events_invited() AS events_invited)))); -- --- Name: event event_update; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event event_update; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_update ON maevsi.event FOR UPDATE USING (((maevsi.invoker_account_id() IS NOT NULL) AND (created_by = maevsi.invoker_account_id()))); +CREATE POLICY event_update ON vibetype.event FOR UPDATE USING (((vibetype.invoker_account_id() IS NOT NULL) AND (created_by = vibetype.invoker_account_id()))); -- --- Name: event_upload; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: event_upload; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.event_upload ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.event_upload ENABLE ROW LEVEL SECURITY; -- --- Name: event_upload event_upload_delete; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event_upload event_upload_delete; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_upload_delete ON maevsi.event_upload FOR DELETE USING ((event_id IN ( SELECT event.id - FROM maevsi.event - WHERE (event.created_by = maevsi.invoker_account_id())))); +CREATE POLICY event_upload_delete ON vibetype.event_upload FOR DELETE USING ((event_id IN ( SELECT event.id + FROM vibetype.event + WHERE (event.created_by = vibetype.invoker_account_id())))); -- --- Name: event_upload event_upload_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event_upload event_upload_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_upload_insert ON maevsi.event_upload FOR INSERT WITH CHECK (((event_id IN ( SELECT event.id - FROM maevsi.event - WHERE (event.created_by = maevsi.invoker_account_id()))) AND (upload_id IN ( SELECT upload.id - FROM maevsi.upload - WHERE (upload.account_id = maevsi.invoker_account_id()))))); +CREATE POLICY event_upload_insert ON vibetype.event_upload FOR INSERT WITH CHECK (((event_id IN ( SELECT event.id + FROM vibetype.event + WHERE (event.created_by = vibetype.invoker_account_id()))) AND (upload_id IN ( SELECT upload.id + FROM vibetype.upload + WHERE (upload.account_id = vibetype.invoker_account_id()))))); -- --- Name: event_upload event_upload_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: event_upload event_upload_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY event_upload_select ON maevsi.event_upload FOR SELECT USING ((event_id IN ( SELECT event.id - FROM maevsi.event))); +CREATE POLICY event_upload_select ON vibetype.event_upload FOR SELECT USING ((event_id IN ( SELECT event.id + FROM vibetype.event))); -- --- Name: guest; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: guest; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.guest ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.guest ENABLE ROW LEVEL SECURITY; -- --- Name: guest guest_delete; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: guest guest_delete; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY guest_delete ON maevsi.guest FOR DELETE USING ((event_id IN ( SELECT maevsi.events_organized() AS events_organized))); +CREATE POLICY guest_delete ON vibetype.guest FOR DELETE USING ((event_id IN ( SELECT vibetype.events_organized() AS events_organized))); -- --- Name: guest guest_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: guest guest_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY guest_insert ON maevsi.guest FOR INSERT WITH CHECK (((event_id IN ( SELECT maevsi.events_organized() AS events_organized)) AND ((maevsi.event_guest_count_maximum(event_id) IS NULL) OR (maevsi.event_guest_count_maximum(event_id) > maevsi.guest_count(event_id))) AND (contact_id IN ( SELECT contact.id - FROM maevsi.contact - WHERE (contact.created_by = maevsi.invoker_account_id()) +CREATE POLICY guest_insert ON vibetype.guest FOR INSERT WITH CHECK (((event_id IN ( SELECT vibetype.events_organized() AS events_organized)) AND ((vibetype.event_guest_count_maximum(event_id) IS NULL) OR (vibetype.event_guest_count_maximum(event_id) > vibetype.guest_count(event_id))) AND (contact_id IN ( SELECT contact.id + FROM vibetype.contact + WHERE (contact.created_by = vibetype.invoker_account_id()) EXCEPT SELECT c.id - FROM (maevsi.contact c - JOIN maevsi.account_block b ON (((c.account_id = b.blocked_account_id) AND (c.created_by = b.created_by)))) - WHERE (c.created_by = maevsi.invoker_account_id()))))); + FROM (vibetype.contact c + JOIN vibetype.account_block b ON (((c.account_id = b.blocked_account_id) AND (c.created_by = b.created_by)))) + WHERE (c.created_by = vibetype.invoker_account_id()))))); -- --- Name: guest guest_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: guest guest_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY guest_select ON maevsi.guest FOR SELECT USING (((id = ANY (maevsi.guest_claim_array())) OR (contact_id IN ( SELECT contact.id - FROM maevsi.contact - WHERE (contact.account_id = maevsi.invoker_account_id()) +CREATE POLICY guest_select ON vibetype.guest FOR SELECT USING (((id = ANY (vibetype.guest_claim_array())) OR (contact_id IN ( SELECT contact.id + FROM vibetype.contact + WHERE (contact.account_id = vibetype.invoker_account_id()) EXCEPT SELECT c.id - FROM (maevsi.contact c - JOIN maevsi.account_block b ON (((c.account_id = b.created_by) AND (c.created_by = b.blocked_account_id)))) - WHERE (c.account_id = maevsi.invoker_account_id()))) OR ((event_id IN ( SELECT maevsi.events_organized() AS events_organized)) AND (contact_id IN ( SELECT c.id - FROM maevsi.contact c + FROM (vibetype.contact c + JOIN vibetype.account_block b ON (((c.account_id = b.created_by) AND (c.created_by = b.blocked_account_id)))) + WHERE (c.account_id = vibetype.invoker_account_id()))) OR ((event_id IN ( SELECT vibetype.events_organized() AS events_organized)) AND (contact_id IN ( SELECT c.id + FROM vibetype.contact c WHERE ((c.account_id IS NULL) OR (NOT (c.account_id IN ( SELECT account_block_ids.id - FROM maevsi_private.account_block_ids() account_block_ids(id)))))))))); + FROM vibetype_private.account_block_ids() account_block_ids(id)))))))))); -- --- Name: guest guest_update; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: guest guest_update; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY guest_update ON maevsi.guest FOR UPDATE USING (((id = ANY (maevsi.guest_claim_array())) OR (contact_id IN ( SELECT contact.id - FROM maevsi.contact - WHERE (contact.account_id = maevsi.invoker_account_id()) +CREATE POLICY guest_update ON vibetype.guest FOR UPDATE USING (((id = ANY (vibetype.guest_claim_array())) OR (contact_id IN ( SELECT contact.id + FROM vibetype.contact + WHERE (contact.account_id = vibetype.invoker_account_id()) EXCEPT SELECT c.id - FROM (maevsi.contact c - JOIN maevsi.account_block b ON (((c.account_id = b.created_by) AND (c.created_by = b.blocked_account_id)))) - WHERE (c.account_id = maevsi.invoker_account_id()))) OR ((event_id IN ( SELECT maevsi.events_organized() AS events_organized)) AND (contact_id IN ( SELECT c.id - FROM maevsi.contact c + FROM (vibetype.contact c + JOIN vibetype.account_block b ON (((c.account_id = b.created_by) AND (c.created_by = b.blocked_account_id)))) + WHERE (c.account_id = vibetype.invoker_account_id()))) OR ((event_id IN ( SELECT vibetype.events_organized() AS events_organized)) AND (contact_id IN ( SELECT c.id + FROM vibetype.contact c WHERE ((c.account_id IS NULL) OR (NOT (c.account_id IN ( SELECT account_block_ids.id - FROM maevsi_private.account_block_ids() account_block_ids(id)))))))))); + FROM vibetype_private.account_block_ids() account_block_ids(id)))))))))); -- --- Name: invitation; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: invitation; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.invitation ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.invitation ENABLE ROW LEVEL SECURITY; -- --- Name: invitation invitation_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: invitation invitation_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY invitation_insert ON maevsi.invitation FOR INSERT WITH CHECK (((created_by = maevsi.invoker_account_id()) AND (maevsi.invoker_account_id() = ( SELECT e.created_by - FROM (maevsi.guest g - JOIN maevsi.event e ON ((g.event_id = e.id))) +CREATE POLICY invitation_insert ON vibetype.invitation FOR INSERT WITH CHECK (((created_by = vibetype.invoker_account_id()) AND (vibetype.invoker_account_id() = ( SELECT e.created_by + FROM (vibetype.guest g + JOIN vibetype.event e ON ((g.event_id = e.id))) WHERE (g.id = invitation.guest_id))))); -- --- Name: invitation invitation_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: invitation invitation_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY invitation_select ON maevsi.invitation FOR SELECT USING ((created_by = maevsi.invoker_account_id())); +CREATE POLICY invitation_select ON vibetype.invitation FOR SELECT USING ((created_by = vibetype.invoker_account_id())); -- --- Name: legal_term; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: legal_term; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.legal_term ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.legal_term ENABLE ROW LEVEL SECURITY; -- --- Name: legal_term_acceptance; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: legal_term_acceptance; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.legal_term_acceptance ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.legal_term_acceptance ENABLE ROW LEVEL SECURITY; -- --- Name: legal_term_acceptance legal_term_acceptance_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: legal_term_acceptance legal_term_acceptance_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY legal_term_acceptance_insert ON maevsi.legal_term_acceptance FOR INSERT WITH CHECK (((maevsi.invoker_account_id() IS NOT NULL) AND (account_id = maevsi.invoker_account_id()))); +CREATE POLICY legal_term_acceptance_insert ON vibetype.legal_term_acceptance FOR INSERT WITH CHECK (((vibetype.invoker_account_id() IS NOT NULL) AND (account_id = vibetype.invoker_account_id()))); -- --- Name: legal_term_acceptance legal_term_acceptance_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: legal_term_acceptance legal_term_acceptance_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY legal_term_acceptance_select ON maevsi.legal_term_acceptance FOR SELECT USING (((maevsi.invoker_account_id() IS NOT NULL) AND (account_id = maevsi.invoker_account_id()))); +CREATE POLICY legal_term_acceptance_select ON vibetype.legal_term_acceptance FOR SELECT USING (((vibetype.invoker_account_id() IS NOT NULL) AND (account_id = vibetype.invoker_account_id()))); -- --- Name: legal_term legal_term_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: legal_term legal_term_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY legal_term_select ON maevsi.legal_term FOR SELECT USING (true); +CREATE POLICY legal_term_select ON vibetype.legal_term FOR SELECT USING (true); -- --- Name: profile_picture; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: profile_picture; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.profile_picture ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.profile_picture ENABLE ROW LEVEL SECURITY; -- --- Name: profile_picture profile_picture_delete; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: profile_picture profile_picture_delete; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY profile_picture_delete ON maevsi.profile_picture FOR DELETE USING (((( SELECT CURRENT_USER AS "current_user") = 'maevsi_tusd'::name) OR ((maevsi.invoker_account_id() IS NOT NULL) AND (account_id = maevsi.invoker_account_id())))); +CREATE POLICY profile_picture_delete ON vibetype.profile_picture FOR DELETE USING (((( SELECT CURRENT_USER AS "current_user") = 'vibetype_tusd'::name) OR ((vibetype.invoker_account_id() IS NOT NULL) AND (account_id = vibetype.invoker_account_id())))); -- --- Name: profile_picture profile_picture_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: profile_picture profile_picture_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY profile_picture_insert ON maevsi.profile_picture FOR INSERT WITH CHECK (((maevsi.invoker_account_id() IS NOT NULL) AND (account_id = maevsi.invoker_account_id()))); +CREATE POLICY profile_picture_insert ON vibetype.profile_picture FOR INSERT WITH CHECK (((vibetype.invoker_account_id() IS NOT NULL) AND (account_id = vibetype.invoker_account_id()))); -- --- Name: profile_picture profile_picture_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: profile_picture profile_picture_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY profile_picture_select ON maevsi.profile_picture FOR SELECT USING (true); +CREATE POLICY profile_picture_select ON vibetype.profile_picture FOR SELECT USING (true); -- --- Name: profile_picture profile_picture_update; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: profile_picture profile_picture_update; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY profile_picture_update ON maevsi.profile_picture FOR UPDATE USING (((maevsi.invoker_account_id() IS NOT NULL) AND (account_id = maevsi.invoker_account_id()))); +CREATE POLICY profile_picture_update ON vibetype.profile_picture FOR UPDATE USING (((vibetype.invoker_account_id() IS NOT NULL) AND (account_id = vibetype.invoker_account_id()))); -- --- Name: report; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: report; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.report ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.report ENABLE ROW LEVEL SECURITY; -- --- Name: report report_insert; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: report report_insert; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY report_insert ON maevsi.report FOR INSERT WITH CHECK (((maevsi.invoker_account_id() IS NOT NULL) AND (created_by = maevsi.invoker_account_id()))); +CREATE POLICY report_insert ON vibetype.report FOR INSERT WITH CHECK (((vibetype.invoker_account_id() IS NOT NULL) AND (created_by = vibetype.invoker_account_id()))); -- --- Name: report report_select; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: report report_select; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY report_select ON maevsi.report FOR SELECT USING (((maevsi.invoker_account_id() IS NOT NULL) AND (created_by = maevsi.invoker_account_id()))); +CREATE POLICY report_select ON vibetype.report FOR SELECT USING (((vibetype.invoker_account_id() IS NOT NULL) AND (created_by = vibetype.invoker_account_id()))); -- --- Name: upload; Type: ROW SECURITY; Schema: maevsi; Owner: postgres +-- Name: upload; Type: ROW SECURITY; Schema: vibetype; Owner: postgres -- -ALTER TABLE maevsi.upload ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype.upload ENABLE ROW LEVEL SECURITY; -- --- Name: upload upload_delete_using; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: upload upload_delete_using; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY upload_delete_using ON maevsi.upload FOR DELETE USING ((( SELECT CURRENT_USER AS "current_user") = 'maevsi_tusd'::name)); +CREATE POLICY upload_delete_using ON vibetype.upload FOR DELETE USING ((( SELECT CURRENT_USER AS "current_user") = 'vibetype_tusd'::name)); -- --- Name: upload upload_select_using; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: upload upload_select_using; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY upload_select_using ON maevsi.upload FOR SELECT USING (((( SELECT CURRENT_USER AS "current_user") = 'maevsi_tusd'::name) OR ((maevsi.invoker_account_id() IS NOT NULL) AND (account_id = maevsi.invoker_account_id())) OR (id IN ( SELECT profile_picture.upload_id - FROM maevsi.profile_picture)))); +CREATE POLICY upload_select_using ON vibetype.upload FOR SELECT USING (((( SELECT CURRENT_USER AS "current_user") = 'vibetype_tusd'::name) OR ((vibetype.invoker_account_id() IS NOT NULL) AND (account_id = vibetype.invoker_account_id())) OR (id IN ( SELECT profile_picture.upload_id + FROM vibetype.profile_picture)))); -- --- Name: upload upload_update_using; Type: POLICY; Schema: maevsi; Owner: postgres +-- Name: upload upload_update_using; Type: POLICY; Schema: vibetype; Owner: postgres -- -CREATE POLICY upload_update_using ON maevsi.upload FOR UPDATE USING ((( SELECT CURRENT_USER AS "current_user") = 'maevsi_tusd'::name)); +CREATE POLICY upload_update_using ON vibetype.upload FOR UPDATE USING ((( SELECT CURRENT_USER AS "current_user") = 'vibetype_tusd'::name)); -- --- Name: achievement_code; Type: ROW SECURITY; Schema: maevsi_private; Owner: postgres +-- Name: achievement_code; Type: ROW SECURITY; Schema: vibetype_private; Owner: postgres -- -ALTER TABLE maevsi_private.achievement_code ENABLE ROW LEVEL SECURITY; +ALTER TABLE vibetype_private.achievement_code ENABLE ROW LEVEL SECURITY; -- --- Name: achievement_code achievement_code_select; Type: POLICY; Schema: maevsi_private; Owner: postgres +-- Name: achievement_code achievement_code_select; Type: POLICY; Schema: vibetype_private; Owner: postgres -- -CREATE POLICY achievement_code_select ON maevsi_private.achievement_code FOR SELECT USING (true); +CREATE POLICY achievement_code_select ON vibetype_private.achievement_code FOR SELECT USING (true); -- --- Name: SCHEMA maevsi; Type: ACL; Schema: -; Owner: postgres +-- Name: SCHEMA vibetype; Type: ACL; Schema: -; Owner: postgres -- -GRANT USAGE ON SCHEMA maevsi TO maevsi_anonymous; -GRANT USAGE ON SCHEMA maevsi TO maevsi_account; -GRANT USAGE ON SCHEMA maevsi TO maevsi_tusd; +GRANT USAGE ON SCHEMA vibetype TO vibetype_anonymous; +GRANT USAGE ON SCHEMA vibetype TO vibetype_account; +GRANT USAGE ON SCHEMA vibetype TO vibetype_tusd; -- --- Name: SCHEMA maevsi_test; Type: ACL; Schema: -; Owner: postgres +-- Name: SCHEMA vibetype_test; Type: ACL; Schema: -; Owner: postgres -- -GRANT USAGE ON SCHEMA maevsi_test TO maevsi_anonymous; -GRANT USAGE ON SCHEMA maevsi_test TO maevsi_account; +GRANT USAGE ON SCHEMA vibetype_test TO vibetype_anonymous; +GRANT USAGE ON SCHEMA vibetype_test TO vibetype_account; -- @@ -6489,8 +6489,8 @@ REVOKE ALL ON FUNCTION public.bytea(public.geometry) FROM PUBLIC; -- REVOKE ALL ON FUNCTION public.geography(public.geometry) FROM PUBLIC; -GRANT ALL ON FUNCTION public.geography(public.geometry) TO maevsi_anonymous; -GRANT ALL ON FUNCTION public.geography(public.geometry) TO maevsi_account; +GRANT ALL ON FUNCTION public.geography(public.geometry) TO vibetype_anonymous; +GRANT ALL ON FUNCTION public.geography(public.geometry) TO vibetype_account; -- @@ -6568,5691 +6568,5691 @@ REVOKE ALL ON FUNCTION public.geometry(polygon) FROM PUBLIC; -- REVOKE ALL ON FUNCTION public.geometry(text) FROM PUBLIC; -GRANT ALL ON FUNCTION public.geometry(text) TO maevsi_anonymous; -GRANT ALL ON FUNCTION public.geometry(text) TO maevsi_account; +GRANT ALL ON FUNCTION public.geometry(text) TO vibetype_anonymous; +GRANT ALL ON FUNCTION public.geometry(text) TO vibetype_account; -- --- Name: FUNCTION account_delete(password text); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _postgis_deprecate(oldname text, newname text, version text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.account_delete(password text) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.account_delete(password text) TO maevsi_account; +REVOKE ALL ON FUNCTION public._postgis_deprecate(oldname text, newname text, version text) FROM PUBLIC; -- --- Name: FUNCTION account_email_address_verification(code uuid); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _postgis_index_extent(tbl regclass, col text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.account_email_address_verification(code uuid) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.account_email_address_verification(code uuid) TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.account_email_address_verification(code uuid) TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._postgis_index_extent(tbl regclass, col text) FROM PUBLIC; -- --- Name: FUNCTION account_password_change(password_current text, password_new text); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _postgis_join_selectivity(regclass, text, regclass, text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.account_password_change(password_current text, password_new text) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.account_password_change(password_current text, password_new text) TO maevsi_account; +REVOKE ALL ON FUNCTION public._postgis_join_selectivity(regclass, text, regclass, text, text) FROM PUBLIC; -- --- Name: FUNCTION account_password_reset(code uuid, password text); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _postgis_pgsql_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.account_password_reset(code uuid, password text) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.account_password_reset(code uuid, password text) TO maevsi_anonymous; -GRANT ALL ON FUNCTION maevsi.account_password_reset(code uuid, password text) TO maevsi_account; +REVOKE ALL ON FUNCTION public._postgis_pgsql_version() FROM PUBLIC; -- --- Name: FUNCTION account_password_reset_request(email_address text, language text); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _postgis_scripts_pgsql_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.account_password_reset_request(email_address text, language text) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.account_password_reset_request(email_address text, language text) TO maevsi_anonymous; -GRANT ALL ON FUNCTION maevsi.account_password_reset_request(email_address text, language text) TO maevsi_account; +REVOKE ALL ON FUNCTION public._postgis_scripts_pgsql_version() FROM PUBLIC; -- --- Name: FUNCTION account_registration(username text, email_address text, password text, language text); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _postgis_selectivity(tbl regclass, att_name text, geom public.geometry, mode text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.account_registration(username text, email_address text, password text, language text) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.account_registration(username text, email_address text, password text, language text) TO maevsi_anonymous; -GRANT ALL ON FUNCTION maevsi.account_registration(username text, email_address text, password text, language text) TO maevsi_account; +REVOKE ALL ON FUNCTION public._postgis_selectivity(tbl regclass, att_name text, geom public.geometry, mode text) FROM PUBLIC; -- --- Name: FUNCTION account_registration_refresh(account_id uuid, language text); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _postgis_stats(tbl regclass, att_name text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.account_registration_refresh(account_id uuid, language text) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.account_registration_refresh(account_id uuid, language text) TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._postgis_stats(tbl regclass, att_name text, text) FROM PUBLIC; -- --- Name: FUNCTION account_upload_quota_bytes(); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_3ddfullywithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.account_upload_quota_bytes() FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.account_upload_quota_bytes() TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_3ddfullywithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION achievement_unlock(code uuid, alias text); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_3ddwithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.achievement_unlock(code uuid, alias text) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.achievement_unlock(code uuid, alias text) TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_3ddwithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION authenticate(username text, password text); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_3dintersects(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.authenticate(username text, password text) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.authenticate(username text, password text) TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.authenticate(username text, password text) TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_3dintersects(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: TABLE event; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_asgml(integer, public.geometry, integer, integer, text, text); Type: ACL; Schema: public; Owner: postgres -- -GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE maevsi.event TO maevsi_account; -GRANT SELECT ON TABLE maevsi.event TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_asgml(integer, public.geometry, integer, integer, text, text) FROM PUBLIC; -- --- Name: FUNCTION event_delete(id uuid, password text); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_asx3d(integer, public.geometry, integer, integer, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.event_delete(id uuid, password text) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.event_delete(id uuid, password text) TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_asx3d(integer, public.geometry, integer, integer, text) FROM PUBLIC; -- --- Name: FUNCTION event_guest_count_maximum(event_id uuid); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_bestsrid(public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.event_guest_count_maximum(event_id uuid) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.event_guest_count_maximum(event_id uuid) TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.event_guest_count_maximum(event_id uuid) TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_bestsrid(public.geography) FROM PUBLIC; -- --- Name: FUNCTION event_is_existing(created_by uuid, slug text); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_bestsrid(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.event_is_existing(created_by uuid, slug text) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.event_is_existing(created_by uuid, slug text) TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.event_is_existing(created_by uuid, slug text) TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_bestsrid(public.geography, public.geography) FROM PUBLIC; -- --- Name: FUNCTION event_search(query text, language maevsi.language); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_concavehull(param_inputgeom public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.event_search(query text, language maevsi.language) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.event_search(query text, language maevsi.language) TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.event_search(query text, language maevsi.language) TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_concavehull(param_inputgeom public.geometry) FROM PUBLIC; -- --- Name: FUNCTION event_unlock(guest_id uuid); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_contains(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.event_unlock(guest_id uuid) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.event_unlock(guest_id uuid) TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.event_unlock(guest_id uuid) TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_contains(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION events_organized(); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_containsproperly(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.events_organized() FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.events_organized() TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.events_organized() TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_containsproperly(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION guest_claim_array(); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_coveredby(geog1 public.geography, geog2 public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.guest_claim_array() FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.guest_claim_array() TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.guest_claim_array() TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_coveredby(geog1 public.geography, geog2 public.geography) FROM PUBLIC; -- --- Name: FUNCTION guest_contact_ids(); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_coveredby(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.guest_contact_ids() FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.guest_contact_ids() TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.guest_contact_ids() TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_coveredby(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION guest_count(event_id uuid); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_covers(geog1 public.geography, geog2 public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.guest_count(event_id uuid) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.guest_count(event_id uuid) TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.guest_count(event_id uuid) TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_covers(geog1 public.geography, geog2 public.geography) FROM PUBLIC; -- --- Name: FUNCTION invite(guest_id uuid, language text); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_covers(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.invite(guest_id uuid, language text) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.invite(guest_id uuid, language text) TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_covers(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION invoker_account_id(); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_crosses(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.invoker_account_id() FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.invoker_account_id() TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.invoker_account_id() TO maevsi_anonymous; -GRANT ALL ON FUNCTION maevsi.invoker_account_id() TO maevsi_tusd; +REVOKE ALL ON FUNCTION public._st_crosses(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION jwt_refresh(jwt_id uuid); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_dfullywithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.jwt_refresh(jwt_id uuid) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.jwt_refresh(jwt_id uuid) TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.jwt_refresh(jwt_id uuid) TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_dfullywithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION language_iso_full_text_search(language maevsi.language); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_distancetree(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.language_iso_full_text_search(language maevsi.language) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.language_iso_full_text_search(language maevsi.language) TO maevsi_anonymous; -GRANT ALL ON FUNCTION maevsi.language_iso_full_text_search(language maevsi.language) TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_distancetree(public.geography, public.geography) FROM PUBLIC; -- --- Name: FUNCTION legal_term_change(); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_distancetree(public.geography, public.geography, double precision, boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.legal_term_change() FROM PUBLIC; +REVOKE ALL ON FUNCTION public._st_distancetree(public.geography, public.geography, double precision, boolean) FROM PUBLIC; -- --- Name: FUNCTION notification_acknowledge(id uuid, is_acknowledged boolean); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_distanceuncached(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.notification_acknowledge(id uuid, is_acknowledged boolean) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.notification_acknowledge(id uuid, is_acknowledged boolean) TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_distanceuncached(public.geography, public.geography) FROM PUBLIC; -- --- Name: FUNCTION profile_picture_set(upload_id uuid); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_distanceuncached(public.geography, public.geography, boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.profile_picture_set(upload_id uuid) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.profile_picture_set(upload_id uuid) TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_distanceuncached(public.geography, public.geography, boolean) FROM PUBLIC; -- --- Name: FUNCTION trigger_contact_update_account_id(); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_distanceuncached(public.geography, public.geography, double precision, boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.trigger_contact_update_account_id() FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.trigger_contact_update_account_id() TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_distanceuncached(public.geography, public.geography, double precision, boolean) FROM PUBLIC; -- --- Name: FUNCTION trigger_event_search_vector(); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_dwithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.trigger_event_search_vector() FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.trigger_event_search_vector() TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.trigger_event_search_vector() TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_dwithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION trigger_guest_update(); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_dwithin(geog1 public.geography, geog2 public.geography, tolerance double precision, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.trigger_guest_update() FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.trigger_guest_update() TO maevsi_account; -GRANT ALL ON FUNCTION maevsi.trigger_guest_update() TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_dwithin(geog1 public.geography, geog2 public.geography, tolerance double precision, use_spheroid boolean) FROM PUBLIC; -- --- Name: FUNCTION trigger_metadata_update(); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_dwithinuncached(public.geography, public.geography, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.trigger_metadata_update() FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.trigger_metadata_update() TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_dwithinuncached(public.geography, public.geography, double precision) FROM PUBLIC; -- --- Name: TABLE upload; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_dwithinuncached(public.geography, public.geography, double precision, boolean); Type: ACL; Schema: public; Owner: postgres -- -GRANT SELECT ON TABLE maevsi.upload TO maevsi_account; -GRANT SELECT ON TABLE maevsi.upload TO maevsi_anonymous; -GRANT SELECT,DELETE,UPDATE ON TABLE maevsi.upload TO maevsi_tusd; +REVOKE ALL ON FUNCTION public._st_dwithinuncached(public.geography, public.geography, double precision, boolean) FROM PUBLIC; -- --- Name: FUNCTION upload_create(size_byte bigint); Type: ACL; Schema: maevsi; Owner: postgres +-- Name: FUNCTION _st_equals(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi.upload_create(size_byte bigint) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi.upload_create(size_byte bigint) TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_equals(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION account_block_ids(); Type: ACL; Schema: maevsi_private; Owner: postgres +-- Name: FUNCTION _st_expand(public.geography, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_private.account_block_ids() FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi_private.account_block_ids() TO maevsi_account; -GRANT ALL ON FUNCTION maevsi_private.account_block_ids() TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_expand(public.geography, double precision) FROM PUBLIC; -- --- Name: FUNCTION account_email_address_verification_valid_until(); Type: ACL; Schema: maevsi_private; Owner: postgres +-- Name: FUNCTION _st_geomfromgml(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_private.account_email_address_verification_valid_until() FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi_private.account_email_address_verification_valid_until() TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_geomfromgml(text, integer) FROM PUBLIC; -- --- Name: FUNCTION account_password_reset_verification_valid_until(); Type: ACL; Schema: maevsi_private; Owner: postgres +-- Name: FUNCTION _st_intersects(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_private.account_password_reset_verification_valid_until() FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi_private.account_password_reset_verification_valid_until() TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_intersects(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION events_invited(); Type: ACL; Schema: maevsi_private; Owner: postgres +-- Name: FUNCTION _st_linecrossingdirection(line1 public.geometry, line2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_private.events_invited() FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi_private.events_invited() TO maevsi_account; -GRANT ALL ON FUNCTION maevsi_private.events_invited() TO maevsi_anonymous; +REVOKE ALL ON FUNCTION public._st_linecrossingdirection(line1 public.geometry, line2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION account_block_create(_created_by uuid, _blocked_account_id uuid); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION _st_longestline(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.account_block_create(_created_by uuid, _blocked_account_id uuid) FROM PUBLIC; +REVOKE ALL ON FUNCTION public._st_longestline(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION account_block_remove(_created_by uuid, _blocked_account_id uuid); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION _st_maxdistance(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.account_block_remove(_created_by uuid, _blocked_account_id uuid) FROM PUBLIC; +REVOKE ALL ON FUNCTION public._st_maxdistance(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION account_create(_username text, _email text); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION _st_orderingequals(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.account_create(_username text, _email text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public._st_orderingequals(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION account_filter_radius_event(_event_id uuid, _distance_max double precision); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION _st_overlaps(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.account_filter_radius_event(_event_id uuid, _distance_max double precision) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi_test.account_filter_radius_event(_event_id uuid, _distance_max double precision) TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_overlaps(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION account_location_coordinates(_account_id uuid); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION _st_pointoutside(public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.account_location_coordinates(_account_id uuid) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi_test.account_location_coordinates(_account_id uuid) TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_pointoutside(public.geography) FROM PUBLIC; -- --- Name: FUNCTION account_location_update(_account_id uuid, _latitude double precision, _longitude double precision); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION _st_sortablehash(geom public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.account_location_update(_account_id uuid, _latitude double precision, _longitude double precision) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi_test.account_location_update(_account_id uuid, _latitude double precision, _longitude double precision) TO maevsi_account; +REVOKE ALL ON FUNCTION public._st_sortablehash(geom public.geometry) FROM PUBLIC; -- --- Name: FUNCTION account_remove(_username text); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION _st_touches(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.account_remove(_username text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public._st_touches(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION contact_create(_created_by uuid, _email_address text); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION _st_voronoi(g1 public.geometry, clip public.geometry, tolerance double precision, return_polygons boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.contact_create(_created_by uuid, _email_address text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public._st_voronoi(g1 public.geometry, clip public.geometry, tolerance double precision, return_polygons boolean) FROM PUBLIC; -- --- Name: FUNCTION contact_select_by_account_id(_account_id uuid); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION _st_within(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.contact_select_by_account_id(_account_id uuid) FROM PUBLIC; +REVOKE ALL ON FUNCTION public._st_within(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION contact_test(_test_case text, _account_id uuid, _expected_result uuid[]); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION addgeometrycolumn(table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.contact_test(_test_case text, _account_id uuid, _expected_result uuid[]) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.addgeometrycolumn(table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean) FROM PUBLIC; -- --- Name: FUNCTION event_category_create(_category text); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION addgeometrycolumn(schema_name character varying, table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.event_category_create(_category text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.addgeometrycolumn(schema_name character varying, table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean) FROM PUBLIC; -- --- Name: FUNCTION event_category_mapping_create(_created_by uuid, _event_id uuid, _category text); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION addgeometrycolumn(catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer, new_type character varying, new_dim integer, use_typmod boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.event_category_mapping_create(_created_by uuid, _event_id uuid, _category text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.addgeometrycolumn(catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer, new_type character varying, new_dim integer, use_typmod boolean) FROM PUBLIC; -- --- Name: FUNCTION event_category_mapping_test(_test_case text, _account_id uuid, _expected_result uuid[]); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION armor(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.event_category_mapping_test(_test_case text, _account_id uuid, _expected_result uuid[]) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.armor(bytea) FROM PUBLIC; -- --- Name: FUNCTION event_create(_created_by uuid, _name text, _slug text, _start text, _visibility text); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION armor(bytea, text[], text[]); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.event_create(_created_by uuid, _name text, _slug text, _start text, _visibility text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.armor(bytea, text[], text[]) FROM PUBLIC; -- --- Name: FUNCTION event_filter_radius_account(_account_id uuid, _distance_max double precision); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION box3dtobox(public.box3d); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.event_filter_radius_account(_account_id uuid, _distance_max double precision) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi_test.event_filter_radius_account(_account_id uuid, _distance_max double precision) TO maevsi_account; +REVOKE ALL ON FUNCTION public.box3dtobox(public.box3d) FROM PUBLIC; -- --- Name: FUNCTION event_location_coordinates(_event_id uuid); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION contains_2d(public.box2df, public.box2df); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.event_location_coordinates(_event_id uuid) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi_test.event_location_coordinates(_event_id uuid) TO maevsi_account; +REVOKE ALL ON FUNCTION public.contains_2d(public.box2df, public.box2df) FROM PUBLIC; -- --- Name: FUNCTION event_location_update(_event_id uuid, _latitude double precision, _longitude double precision); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION contains_2d(public.box2df, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.event_location_update(_event_id uuid, _latitude double precision, _longitude double precision) FROM PUBLIC; -GRANT ALL ON FUNCTION maevsi_test.event_location_update(_event_id uuid, _latitude double precision, _longitude double precision) TO maevsi_account; +REVOKE ALL ON FUNCTION public.contains_2d(public.box2df, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION event_test(_test_case text, _account_id uuid, _expected_result uuid[]); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION contains_2d(public.geometry, public.box2df); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.event_test(_test_case text, _account_id uuid, _expected_result uuid[]) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.contains_2d(public.geometry, public.box2df) FROM PUBLIC; -- --- Name: FUNCTION guest_claim_from_account_guest(_account_id uuid); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION crypt(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.guest_claim_from_account_guest(_account_id uuid) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.crypt(text, text) FROM PUBLIC; -- --- Name: FUNCTION guest_create(_created_by uuid, _event_id uuid, _contact_id uuid); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION dearmor(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.guest_create(_created_by uuid, _event_id uuid, _contact_id uuid) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.dearmor(text) FROM PUBLIC; -- --- Name: FUNCTION guest_test(_test_case text, _account_id uuid, _expected_result uuid[]); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION decrypt(bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.guest_test(_test_case text, _account_id uuid, _expected_result uuid[]) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.decrypt(bytea, bytea, text) FROM PUBLIC; -- --- Name: FUNCTION invoker_set(_invoker_id uuid); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION decrypt_iv(bytea, bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.invoker_set(_invoker_id uuid) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.decrypt_iv(bytea, bytea, bytea, text) FROM PUBLIC; -- --- Name: FUNCTION invoker_unset(); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION digest(bytea, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.invoker_unset() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.digest(bytea, text) FROM PUBLIC; -- --- Name: FUNCTION uuid_array_test(_test_case text, _array uuid[], _expected_array uuid[]); Type: ACL; Schema: maevsi_test; Owner: postgres +-- Name: FUNCTION digest(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION maevsi_test.uuid_array_test(_test_case text, _array uuid[], _expected_array uuid[]) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.digest(text, text) FROM PUBLIC; -- --- Name: FUNCTION _postgis_deprecate(oldname text, newname text, version text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION dropgeometrycolumn(table_name character varying, column_name character varying); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._postgis_deprecate(oldname text, newname text, version text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.dropgeometrycolumn(table_name character varying, column_name character varying) FROM PUBLIC; -- --- Name: FUNCTION _postgis_index_extent(tbl regclass, col text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION dropgeometrycolumn(schema_name character varying, table_name character varying, column_name character varying); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._postgis_index_extent(tbl regclass, col text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.dropgeometrycolumn(schema_name character varying, table_name character varying, column_name character varying) FROM PUBLIC; -- --- Name: FUNCTION _postgis_join_selectivity(regclass, text, regclass, text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION dropgeometrycolumn(catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._postgis_join_selectivity(regclass, text, regclass, text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.dropgeometrycolumn(catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying) FROM PUBLIC; -- --- Name: FUNCTION _postgis_pgsql_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION dropgeometrytable(table_name character varying); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._postgis_pgsql_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.dropgeometrytable(table_name character varying) FROM PUBLIC; -- --- Name: FUNCTION _postgis_scripts_pgsql_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION dropgeometrytable(schema_name character varying, table_name character varying); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._postgis_scripts_pgsql_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.dropgeometrytable(schema_name character varying, table_name character varying) FROM PUBLIC; -- --- Name: FUNCTION _postgis_selectivity(tbl regclass, att_name text, geom public.geometry, mode text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION dropgeometrytable(catalog_name character varying, schema_name character varying, table_name character varying); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._postgis_selectivity(tbl regclass, att_name text, geom public.geometry, mode text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.dropgeometrytable(catalog_name character varying, schema_name character varying, table_name character varying) FROM PUBLIC; -- --- Name: FUNCTION _postgis_stats(tbl regclass, att_name text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION encrypt(bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._postgis_stats(tbl regclass, att_name text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.encrypt(bytea, bytea, text) FROM PUBLIC; -- --- Name: FUNCTION _st_3ddfullywithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION encrypt_iv(bytea, bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_3ddfullywithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.encrypt_iv(bytea, bytea, bytea, text) FROM PUBLIC; -- --- Name: FUNCTION _st_3ddwithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION equals(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_3ddwithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.equals(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION _st_3dintersects(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION find_srid(character varying, character varying, character varying); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_3dintersects(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.find_srid(character varying, character varying, character varying) FROM PUBLIC; -- --- Name: FUNCTION _st_asgml(integer, public.geometry, integer, integer, text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION gen_random_bytes(integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_asgml(integer, public.geometry, integer, integer, text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.gen_random_bytes(integer) FROM PUBLIC; -- --- Name: FUNCTION _st_asx3d(integer, public.geometry, integer, integer, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION gen_random_uuid(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_asx3d(integer, public.geometry, integer, integer, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.gen_random_uuid() FROM PUBLIC; -- --- Name: FUNCTION _st_bestsrid(public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION gen_salt(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_bestsrid(public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.gen_salt(text) FROM PUBLIC; -- --- Name: FUNCTION _st_bestsrid(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION gen_salt(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_bestsrid(public.geography, public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.gen_salt(text, integer) FROM PUBLIC; -- --- Name: FUNCTION _st_concavehull(param_inputgeom public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geog_brin_inclusion_add_value(internal, internal, internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_concavehull(param_inputgeom public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geog_brin_inclusion_add_value(internal, internal, internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_contains(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geog_brin_inclusion_merge(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_contains(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geog_brin_inclusion_merge(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_containsproperly(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_cmp(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_containsproperly(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_cmp(public.geography, public.geography) FROM PUBLIC; -- --- Name: FUNCTION _st_coveredby(geog1 public.geography, geog2 public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_distance_knn(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_coveredby(geog1 public.geography, geog2 public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_distance_knn(public.geography, public.geography) FROM PUBLIC; -- --- Name: FUNCTION _st_coveredby(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_eq(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_coveredby(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_eq(public.geography, public.geography) FROM PUBLIC; -- --- Name: FUNCTION _st_covers(geog1 public.geography, geog2 public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_ge(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_covers(geog1 public.geography, geog2 public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_ge(public.geography, public.geography) FROM PUBLIC; -- --- Name: FUNCTION _st_covers(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_gist_compress(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_covers(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_gist_compress(internal) FROM PUBLIC; -- --- Name: FUNCTION _st_crosses(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_gist_consistent(internal, public.geography, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_crosses(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_gist_consistent(internal, public.geography, integer) FROM PUBLIC; -- --- Name: FUNCTION _st_dfullywithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_gist_decompress(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_dfullywithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_gist_decompress(internal) FROM PUBLIC; -- --- Name: FUNCTION _st_distancetree(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_gist_distance(internal, public.geography, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_distancetree(public.geography, public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_gist_distance(internal, public.geography, integer) FROM PUBLIC; -- --- Name: FUNCTION _st_distancetree(public.geography, public.geography, double precision, boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_gist_penalty(internal, internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_distancetree(public.geography, public.geography, double precision, boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_gist_penalty(internal, internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_distanceuncached(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_gist_picksplit(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_distanceuncached(public.geography, public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_gist_picksplit(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_distanceuncached(public.geography, public.geography, boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_gist_same(public.box2d, public.box2d, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_distanceuncached(public.geography, public.geography, boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_gist_same(public.box2d, public.box2d, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_distanceuncached(public.geography, public.geography, double precision, boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_gist_union(bytea, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_distanceuncached(public.geography, public.geography, double precision, boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_gist_union(bytea, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_dwithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_gt(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_dwithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_gt(public.geography, public.geography) FROM PUBLIC; -- --- Name: FUNCTION _st_dwithin(geog1 public.geography, geog2 public.geography, tolerance double precision, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_le(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_dwithin(geog1 public.geography, geog2 public.geography, tolerance double precision, use_spheroid boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_le(public.geography, public.geography) FROM PUBLIC; -- --- Name: FUNCTION _st_dwithinuncached(public.geography, public.geography, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_lt(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_dwithinuncached(public.geography, public.geography, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_lt(public.geography, public.geography) FROM PUBLIC; -- --- Name: FUNCTION _st_dwithinuncached(public.geography, public.geography, double precision, boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_overlaps(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_dwithinuncached(public.geography, public.geography, double precision, boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_overlaps(public.geography, public.geography) FROM PUBLIC; -- --- Name: FUNCTION _st_equals(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_spgist_choose_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_equals(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_spgist_choose_nd(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_expand(public.geography, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_spgist_compress_nd(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_expand(public.geography, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_spgist_compress_nd(internal) FROM PUBLIC; -- --- Name: FUNCTION _st_geomfromgml(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_spgist_config_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_geomfromgml(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_spgist_config_nd(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_intersects(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_spgist_inner_consistent_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_intersects(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_spgist_inner_consistent_nd(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_linecrossingdirection(line1 public.geometry, line2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_spgist_leaf_consistent_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_linecrossingdirection(line1 public.geometry, line2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_spgist_leaf_consistent_nd(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_longestline(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geography_spgist_picksplit_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_longestline(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geography_spgist_picksplit_nd(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_maxdistance(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geom2d_brin_inclusion_add_value(internal, internal, internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_maxdistance(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geom2d_brin_inclusion_add_value(internal, internal, internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_orderingequals(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geom2d_brin_inclusion_merge(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_orderingequals(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geom2d_brin_inclusion_merge(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_overlaps(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geom3d_brin_inclusion_add_value(internal, internal, internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_overlaps(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geom3d_brin_inclusion_add_value(internal, internal, internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_pointoutside(public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geom3d_brin_inclusion_merge(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_pointoutside(public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geom3d_brin_inclusion_merge(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_sortablehash(geom public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geom4d_brin_inclusion_add_value(internal, internal, internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_sortablehash(geom public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geom4d_brin_inclusion_add_value(internal, internal, internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_touches(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geom4d_brin_inclusion_merge(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_touches(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geom4d_brin_inclusion_merge(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION _st_voronoi(g1 public.geometry, clip public.geometry, tolerance double precision, return_polygons boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_above(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_voronoi(g1 public.geometry, clip public.geometry, tolerance double precision, return_polygons boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_above(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION _st_within(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_below(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public._st_within(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_below(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION addgeometrycolumn(table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_cmp(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.addgeometrycolumn(table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_cmp(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION addgeometrycolumn(schema_name character varying, table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_contained_3d(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.addgeometrycolumn(schema_name character varying, table_name character varying, column_name character varying, new_srid integer, new_type character varying, new_dim integer, use_typmod boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_contained_3d(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION addgeometrycolumn(catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer, new_type character varying, new_dim integer, use_typmod boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_contains(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.addgeometrycolumn(catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer, new_type character varying, new_dim integer, use_typmod boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_contains(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION armor(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_contains_3d(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.armor(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_contains_3d(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION armor(bytea, text[], text[]); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_contains_nd(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.armor(bytea, text[], text[]) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_contains_nd(public.geometry, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION box3dtobox(public.box3d); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_distance_box(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.box3dtobox(public.box3d) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_distance_box(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION contains_2d(public.box2df, public.box2df); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_distance_centroid(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.contains_2d(public.box2df, public.box2df) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_distance_centroid(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION contains_2d(public.box2df, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_distance_centroid_nd(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.contains_2d(public.box2df, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_distance_centroid_nd(public.geometry, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION contains_2d(public.geometry, public.box2df); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_distance_cpa(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.contains_2d(public.geometry, public.box2df) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_distance_cpa(public.geometry, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION crypt(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_eq(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.crypt(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_eq(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION dearmor(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_ge(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.dearmor(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_ge(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION decrypt(bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_compress_2d(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.decrypt(bytea, bytea, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_compress_2d(internal) FROM PUBLIC; -- --- Name: FUNCTION decrypt_iv(bytea, bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_compress_nd(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.decrypt_iv(bytea, bytea, bytea, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_compress_nd(internal) FROM PUBLIC; -- --- Name: FUNCTION digest(bytea, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_consistent_2d(internal, public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.digest(bytea, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_consistent_2d(internal, public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION digest(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_consistent_nd(internal, public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.digest(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_consistent_nd(internal, public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION dropgeometrycolumn(table_name character varying, column_name character varying); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_decompress_2d(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.dropgeometrycolumn(table_name character varying, column_name character varying) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_decompress_2d(internal) FROM PUBLIC; -- --- Name: FUNCTION dropgeometrycolumn(schema_name character varying, table_name character varying, column_name character varying); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_decompress_nd(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.dropgeometrycolumn(schema_name character varying, table_name character varying, column_name character varying) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_decompress_nd(internal) FROM PUBLIC; -- --- Name: FUNCTION dropgeometrycolumn(catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_distance_2d(internal, public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.dropgeometrycolumn(catalog_name character varying, schema_name character varying, table_name character varying, column_name character varying) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_distance_2d(internal, public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION dropgeometrytable(table_name character varying); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_distance_nd(internal, public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.dropgeometrytable(table_name character varying) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_distance_nd(internal, public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION dropgeometrytable(schema_name character varying, table_name character varying); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_penalty_2d(internal, internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.dropgeometrytable(schema_name character varying, table_name character varying) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_penalty_2d(internal, internal, internal) FROM PUBLIC; -- --- Name: FUNCTION dropgeometrytable(catalog_name character varying, schema_name character varying, table_name character varying); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_penalty_nd(internal, internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.dropgeometrytable(catalog_name character varying, schema_name character varying, table_name character varying) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_penalty_nd(internal, internal, internal) FROM PUBLIC; -- --- Name: FUNCTION encrypt(bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_picksplit_2d(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.encrypt(bytea, bytea, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_picksplit_2d(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION encrypt_iv(bytea, bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_picksplit_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.encrypt_iv(bytea, bytea, bytea, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_picksplit_nd(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION equals(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_same_2d(geom1 public.geometry, geom2 public.geometry, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.equals(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_same_2d(geom1 public.geometry, geom2 public.geometry, internal) FROM PUBLIC; -- --- Name: FUNCTION find_srid(character varying, character varying, character varying); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_same_nd(public.geometry, public.geometry, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.find_srid(character varying, character varying, character varying) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_same_nd(public.geometry, public.geometry, internal) FROM PUBLIC; -- --- Name: FUNCTION gen_random_bytes(integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_sortsupport_2d(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.gen_random_bytes(integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_sortsupport_2d(internal) FROM PUBLIC; -- --- Name: FUNCTION gen_random_uuid(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_union_2d(bytea, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.gen_random_uuid() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_union_2d(bytea, internal) FROM PUBLIC; -- --- Name: FUNCTION gen_salt(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gist_union_nd(bytea, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.gen_salt(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gist_union_nd(bytea, internal) FROM PUBLIC; -- --- Name: FUNCTION gen_salt(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_gt(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.gen_salt(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_gt(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geog_brin_inclusion_add_value(internal, internal, internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_hash(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geog_brin_inclusion_add_value(internal, internal, internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_hash(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geog_brin_inclusion_merge(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_le(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geog_brin_inclusion_merge(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_le(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_cmp(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_left(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_cmp(public.geography, public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_left(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_distance_knn(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_lt(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_distance_knn(public.geography, public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_lt(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_eq(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_neq(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_eq(public.geography, public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_neq(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_ge(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_overabove(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_ge(public.geography, public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_overabove(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_gist_compress(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_overbelow(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_gist_compress(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_overbelow(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_gist_consistent(internal, public.geography, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_overlaps(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_gist_consistent(internal, public.geography, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_overlaps(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_gist_decompress(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_overlaps_3d(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_gist_decompress(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_overlaps_3d(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_gist_distance(internal, public.geography, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_overlaps_nd(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_gist_distance(internal, public.geography, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_overlaps_nd(public.geometry, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_gist_penalty(internal, internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_overleft(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_gist_penalty(internal, internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_overleft(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_gist_picksplit(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_overright(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_gist_picksplit(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_overright(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_gist_same(public.box2d, public.box2d, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_right(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_gist_same(public.box2d, public.box2d, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_right(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_gist_union(bytea, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_same(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_gist_union(bytea, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_same(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_gt(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_same_3d(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_gt(public.geography, public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_same_3d(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_le(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_same_nd(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_le(public.geography, public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_same_nd(public.geometry, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geography_lt(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_sortsupport(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_lt(public.geography, public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_sortsupport(internal) FROM PUBLIC; -- --- Name: FUNCTION geography_overlaps(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_choose_2d(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_overlaps(public.geography, public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_choose_2d(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geography_spgist_choose_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_choose_3d(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_spgist_choose_nd(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_choose_3d(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geography_spgist_compress_nd(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_choose_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_spgist_compress_nd(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_choose_nd(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geography_spgist_config_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_compress_2d(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_spgist_config_nd(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_compress_2d(internal) FROM PUBLIC; -- --- Name: FUNCTION geography_spgist_inner_consistent_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_compress_3d(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_spgist_inner_consistent_nd(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_compress_3d(internal) FROM PUBLIC; -- --- Name: FUNCTION geography_spgist_leaf_consistent_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_compress_nd(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_spgist_leaf_consistent_nd(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_compress_nd(internal) FROM PUBLIC; -- --- Name: FUNCTION geography_spgist_picksplit_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_config_2d(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geography_spgist_picksplit_nd(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_config_2d(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geom2d_brin_inclusion_add_value(internal, internal, internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_config_3d(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geom2d_brin_inclusion_add_value(internal, internal, internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_config_3d(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geom2d_brin_inclusion_merge(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_config_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geom2d_brin_inclusion_merge(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_config_nd(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geom3d_brin_inclusion_add_value(internal, internal, internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_inner_consistent_2d(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geom3d_brin_inclusion_add_value(internal, internal, internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_inner_consistent_2d(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geom3d_brin_inclusion_merge(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_inner_consistent_3d(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geom3d_brin_inclusion_merge(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_inner_consistent_3d(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geom4d_brin_inclusion_add_value(internal, internal, internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_inner_consistent_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geom4d_brin_inclusion_add_value(internal, internal, internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_inner_consistent_nd(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geom4d_brin_inclusion_merge(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_leaf_consistent_2d(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geom4d_brin_inclusion_merge(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_leaf_consistent_2d(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_above(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_leaf_consistent_3d(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_above(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_leaf_consistent_3d(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_below(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_leaf_consistent_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_below(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_leaf_consistent_nd(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_cmp(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_picksplit_2d(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_cmp(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_picksplit_2d(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_contained_3d(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_picksplit_3d(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_contained_3d(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_picksplit_3d(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_contains(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_spgist_picksplit_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_contains(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_spgist_picksplit_nd(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_contains_3d(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_within(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_contains_3d(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_within(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geometry_contains_nd(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometry_within_nd(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_contains_nd(public.geometry, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometry_within_nd(public.geometry, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geometry_distance_box(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometrytype(public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_distance_box(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometrytype(public.geography) FROM PUBLIC; +GRANT ALL ON FUNCTION public.geometrytype(public.geography) TO vibetype_anonymous; +GRANT ALL ON FUNCTION public.geometrytype(public.geography) TO vibetype_account; -- --- Name: FUNCTION geometry_distance_centroid(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geometrytype(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_distance_centroid(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geometrytype(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geometry_distance_centroid_nd(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geomfromewkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_distance_centroid_nd(public.geometry, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geomfromewkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION geometry_distance_cpa(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION geomfromewkt(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_distance_cpa(public.geometry, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.geomfromewkt(text) FROM PUBLIC; -- --- Name: FUNCTION geometry_eq(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION get_proj4_from_srid(integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_eq(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.get_proj4_from_srid(integer) FROM PUBLIC; -- --- Name: FUNCTION geometry_ge(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION gserialized_gist_joinsel_2d(internal, oid, internal, smallint); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_ge(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.gserialized_gist_joinsel_2d(internal, oid, internal, smallint) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_compress_2d(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION gserialized_gist_joinsel_nd(internal, oid, internal, smallint); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_compress_2d(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.gserialized_gist_joinsel_nd(internal, oid, internal, smallint) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_compress_nd(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION gserialized_gist_sel_2d(internal, oid, internal, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_compress_nd(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.gserialized_gist_sel_2d(internal, oid, internal, integer) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_consistent_2d(internal, public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION gserialized_gist_sel_nd(internal, oid, internal, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_consistent_2d(internal, public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.gserialized_gist_sel_nd(internal, oid, internal, integer) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_consistent_nd(internal, public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION hmac(bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_consistent_nd(internal, public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.hmac(bytea, bytea, text) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_decompress_2d(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION hmac(text, text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_decompress_2d(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.hmac(text, text, text) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_decompress_nd(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION is_contained_2d(public.box2df, public.box2df); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_decompress_nd(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.is_contained_2d(public.box2df, public.box2df) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_distance_2d(internal, public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION is_contained_2d(public.box2df, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_distance_2d(internal, public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.is_contained_2d(public.box2df, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_distance_nd(internal, public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION is_contained_2d(public.geometry, public.box2df); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_distance_nd(internal, public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.is_contained_2d(public.geometry, public.box2df) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_penalty_2d(internal, internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION overlaps_2d(public.box2df, public.box2df); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_penalty_2d(internal, internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.overlaps_2d(public.box2df, public.box2df) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_penalty_nd(internal, internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION overlaps_2d(public.box2df, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_penalty_nd(internal, internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.overlaps_2d(public.box2df, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_picksplit_2d(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION overlaps_2d(public.geometry, public.box2df); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_picksplit_2d(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.overlaps_2d(public.geometry, public.box2df) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_picksplit_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION overlaps_geog(public.geography, public.gidx); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_picksplit_nd(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.overlaps_geog(public.geography, public.gidx) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_same_2d(geom1 public.geometry, geom2 public.geometry, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION overlaps_geog(public.gidx, public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_same_2d(geom1 public.geometry, geom2 public.geometry, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.overlaps_geog(public.gidx, public.geography) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_same_nd(public.geometry, public.geometry, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION overlaps_geog(public.gidx, public.gidx); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_same_nd(public.geometry, public.geometry, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.overlaps_geog(public.gidx, public.gidx) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_sortsupport_2d(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION overlaps_nd(public.geometry, public.gidx); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_sortsupport_2d(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.overlaps_nd(public.geometry, public.gidx) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_union_2d(bytea, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION overlaps_nd(public.gidx, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_union_2d(bytea, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.overlaps_nd(public.gidx, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geometry_gist_union_nd(bytea, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION overlaps_nd(public.gidx, public.gidx); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gist_union_nd(bytea, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.overlaps_nd(public.gidx, public.gidx) FROM PUBLIC; -- --- Name: FUNCTION geometry_gt(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asflatgeobuf_finalfn(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_gt(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asflatgeobuf_finalfn(internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_hash(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asflatgeobuf_transfn(internal, anyelement); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_hash(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asflatgeobuf_transfn(internal, anyelement) FROM PUBLIC; -- --- Name: FUNCTION geometry_le(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asflatgeobuf_transfn(internal, anyelement, boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_le(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asflatgeobuf_transfn(internal, anyelement, boolean) FROM PUBLIC; -- --- Name: FUNCTION geometry_left(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asflatgeobuf_transfn(internal, anyelement, boolean, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_left(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asflatgeobuf_transfn(internal, anyelement, boolean, text) FROM PUBLIC; -- --- Name: FUNCTION geometry_lt(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asgeobuf_finalfn(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_lt(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asgeobuf_finalfn(internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_neq(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asgeobuf_transfn(internal, anyelement); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_neq(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asgeobuf_transfn(internal, anyelement) FROM PUBLIC; -- --- Name: FUNCTION geometry_overabove(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asgeobuf_transfn(internal, anyelement, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_overabove(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asgeobuf_transfn(internal, anyelement, text) FROM PUBLIC; -- --- Name: FUNCTION geometry_overbelow(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asmvt_combinefn(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_overbelow(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asmvt_combinefn(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_overlaps(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asmvt_deserialfn(bytea, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_overlaps(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asmvt_deserialfn(bytea, internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_overlaps_3d(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asmvt_finalfn(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_overlaps_3d(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asmvt_finalfn(internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_overlaps_nd(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asmvt_serialfn(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_overlaps_nd(public.geometry, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asmvt_serialfn(internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_overleft(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asmvt_transfn(internal, anyelement); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_overleft(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asmvt_transfn(internal, anyelement) FROM PUBLIC; -- --- Name: FUNCTION geometry_overright(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asmvt_transfn(internal, anyelement, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_overright(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asmvt_transfn(internal, anyelement, text) FROM PUBLIC; -- --- Name: FUNCTION geometry_right(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asmvt_transfn(internal, anyelement, text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_right(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asmvt_transfn(internal, anyelement, text, integer) FROM PUBLIC; -- --- Name: FUNCTION geometry_same(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asmvt_transfn(internal, anyelement, text, integer, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_same(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asmvt_transfn(internal, anyelement, text, integer, text) FROM PUBLIC; -- --- Name: FUNCTION geometry_same_3d(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_asmvt_transfn(internal, anyelement, text, integer, text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_same_3d(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_asmvt_transfn(internal, anyelement, text, integer, text, text) FROM PUBLIC; -- --- Name: FUNCTION geometry_same_nd(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_accum_transfn(internal, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_same_nd(public.geometry, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_accum_transfn(internal, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geometry_sortsupport(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_accum_transfn(internal, public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_sortsupport(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_accum_transfn(internal, public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_choose_2d(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_accum_transfn(internal, public.geometry, double precision, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_choose_2d(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_accum_transfn(internal, public.geometry, double precision, integer) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_choose_3d(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_clusterintersecting_finalfn(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_choose_3d(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_clusterintersecting_finalfn(internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_choose_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_clusterwithin_finalfn(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_choose_nd(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_clusterwithin_finalfn(internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_compress_2d(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_collect_finalfn(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_compress_2d(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_collect_finalfn(internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_compress_3d(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_coverageunion_finalfn(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_compress_3d(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_coverageunion_finalfn(internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_compress_nd(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_makeline_finalfn(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_compress_nd(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_makeline_finalfn(internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_config_2d(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_polygonize_finalfn(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_config_2d(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_polygonize_finalfn(internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_config_3d(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_union_parallel_combinefn(internal, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_config_3d(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_union_parallel_combinefn(internal, internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_config_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_union_parallel_deserialfn(bytea, internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_config_nd(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_union_parallel_deserialfn(bytea, internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_inner_consistent_2d(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_union_parallel_finalfn(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_inner_consistent_2d(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_union_parallel_finalfn(internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_inner_consistent_3d(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_union_parallel_serialfn(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_inner_consistent_3d(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_union_parallel_serialfn(internal) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_inner_consistent_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_union_parallel_transfn(internal, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_inner_consistent_nd(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_union_parallel_transfn(internal, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_leaf_consistent_2d(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgis_geometry_union_parallel_transfn(internal, public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_leaf_consistent_2d(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgis_geometry_union_parallel_transfn(internal, public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_leaf_consistent_3d(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_armor_headers(text, OUT key text, OUT value text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_leaf_consistent_3d(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_armor_headers(text, OUT key text, OUT value text) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_leaf_consistent_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_key_id(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_leaf_consistent_nd(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_key_id(bytea) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_picksplit_2d(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_pub_decrypt(bytea, bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_picksplit_2d(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_pub_decrypt(bytea, bytea) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_picksplit_3d(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_pub_decrypt(bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_picksplit_3d(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_pub_decrypt(bytea, bytea, text) FROM PUBLIC; -- --- Name: FUNCTION geometry_spgist_picksplit_nd(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_pub_decrypt(bytea, bytea, text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_spgist_picksplit_nd(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_pub_decrypt(bytea, bytea, text, text) FROM PUBLIC; -- --- Name: FUNCTION geometry_within(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_within(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_pub_decrypt_bytea(bytea, bytea) FROM PUBLIC; -- --- Name: FUNCTION geometry_within_nd(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometry_within_nd(public.geometry, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_pub_decrypt_bytea(bytea, bytea, text) FROM PUBLIC; -- --- Name: FUNCTION geometrytype(public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometrytype(public.geography) FROM PUBLIC; -GRANT ALL ON FUNCTION public.geometrytype(public.geography) TO maevsi_anonymous; -GRANT ALL ON FUNCTION public.geometrytype(public.geography) TO maevsi_account; +REVOKE ALL ON FUNCTION public.pgp_pub_decrypt_bytea(bytea, bytea, text, text) FROM PUBLIC; -- --- Name: FUNCTION geometrytype(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_pub_encrypt(text, bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geometrytype(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_pub_encrypt(text, bytea) FROM PUBLIC; -- --- Name: FUNCTION geomfromewkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_pub_encrypt(text, bytea, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geomfromewkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_pub_encrypt(text, bytea, text) FROM PUBLIC; -- --- Name: FUNCTION geomfromewkt(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_pub_encrypt_bytea(bytea, bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.geomfromewkt(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_pub_encrypt_bytea(bytea, bytea) FROM PUBLIC; -- --- Name: FUNCTION get_proj4_from_srid(integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.get_proj4_from_srid(integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_pub_encrypt_bytea(bytea, bytea, text) FROM PUBLIC; -- --- Name: FUNCTION gserialized_gist_joinsel_2d(internal, oid, internal, smallint); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_sym_decrypt(bytea, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.gserialized_gist_joinsel_2d(internal, oid, internal, smallint) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_sym_decrypt(bytea, text) FROM PUBLIC; -- --- Name: FUNCTION gserialized_gist_joinsel_nd(internal, oid, internal, smallint); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_sym_decrypt(bytea, text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.gserialized_gist_joinsel_nd(internal, oid, internal, smallint) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_sym_decrypt(bytea, text, text) FROM PUBLIC; -- --- Name: FUNCTION gserialized_gist_sel_2d(internal, oid, internal, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_sym_decrypt_bytea(bytea, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.gserialized_gist_sel_2d(internal, oid, internal, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_sym_decrypt_bytea(bytea, text) FROM PUBLIC; -- --- Name: FUNCTION gserialized_gist_sel_nd(internal, oid, internal, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_sym_decrypt_bytea(bytea, text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.gserialized_gist_sel_nd(internal, oid, internal, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_sym_decrypt_bytea(bytea, text, text) FROM PUBLIC; -- --- Name: FUNCTION hmac(bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_sym_encrypt(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.hmac(bytea, bytea, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_sym_encrypt(text, text) FROM PUBLIC; -- --- Name: FUNCTION hmac(text, text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_sym_encrypt(text, text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.hmac(text, text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_sym_encrypt(text, text, text) FROM PUBLIC; -- --- Name: FUNCTION is_contained_2d(public.box2df, public.box2df); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_sym_encrypt_bytea(bytea, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.is_contained_2d(public.box2df, public.box2df) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_sym_encrypt_bytea(bytea, text) FROM PUBLIC; -- --- Name: FUNCTION is_contained_2d(public.box2df, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION pgp_sym_encrypt_bytea(bytea, text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.is_contained_2d(public.box2df, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.pgp_sym_encrypt_bytea(bytea, text, text) FROM PUBLIC; -- --- Name: FUNCTION is_contained_2d(public.geometry, public.box2df); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION populate_geometry_columns(use_typmod boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.is_contained_2d(public.geometry, public.box2df) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.populate_geometry_columns(use_typmod boolean) FROM PUBLIC; -- --- Name: FUNCTION overlaps_2d(public.box2df, public.box2df); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION populate_geometry_columns(tbl_oid oid, use_typmod boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.overlaps_2d(public.box2df, public.box2df) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.populate_geometry_columns(tbl_oid oid, use_typmod boolean) FROM PUBLIC; -- --- Name: FUNCTION overlaps_2d(public.box2df, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_addbbox(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.overlaps_2d(public.box2df, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_addbbox(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION overlaps_2d(public.geometry, public.box2df); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_cache_bbox(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.overlaps_2d(public.geometry, public.box2df) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_cache_bbox() FROM PUBLIC; -- --- Name: FUNCTION overlaps_geog(public.geography, public.gidx); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_constraint_dims(geomschema text, geomtable text, geomcolumn text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.overlaps_geog(public.geography, public.gidx) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_constraint_dims(geomschema text, geomtable text, geomcolumn text) FROM PUBLIC; -- --- Name: FUNCTION overlaps_geog(public.gidx, public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_constraint_srid(geomschema text, geomtable text, geomcolumn text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.overlaps_geog(public.gidx, public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_constraint_srid(geomschema text, geomtable text, geomcolumn text) FROM PUBLIC; -- --- Name: FUNCTION overlaps_geog(public.gidx, public.gidx); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_constraint_type(geomschema text, geomtable text, geomcolumn text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.overlaps_geog(public.gidx, public.gidx) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_constraint_type(geomschema text, geomtable text, geomcolumn text) FROM PUBLIC; -- --- Name: FUNCTION overlaps_nd(public.geometry, public.gidx); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_dropbbox(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.overlaps_nd(public.geometry, public.gidx) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_dropbbox(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION overlaps_nd(public.gidx, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_extensions_upgrade(target_version text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.overlaps_nd(public.gidx, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_extensions_upgrade(target_version text) FROM PUBLIC; -- --- Name: FUNCTION overlaps_nd(public.gidx, public.gidx); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_full_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.overlaps_nd(public.gidx, public.gidx) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_full_version() FROM PUBLIC; -- --- Name: FUNCTION pgis_asflatgeobuf_finalfn(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_geos_compiled_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asflatgeobuf_finalfn(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_geos_compiled_version() FROM PUBLIC; -- --- Name: FUNCTION pgis_asflatgeobuf_transfn(internal, anyelement); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_geos_noop(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asflatgeobuf_transfn(internal, anyelement) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_geos_noop(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgis_asflatgeobuf_transfn(internal, anyelement, boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_geos_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asflatgeobuf_transfn(internal, anyelement, boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_geos_version() FROM PUBLIC; -- --- Name: FUNCTION pgis_asflatgeobuf_transfn(internal, anyelement, boolean, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_getbbox(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asflatgeobuf_transfn(internal, anyelement, boolean, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_getbbox(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgis_asgeobuf_finalfn(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_hasbbox(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asgeobuf_finalfn(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_hasbbox(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgis_asgeobuf_transfn(internal, anyelement); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_index_supportfn(internal); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asgeobuf_transfn(internal, anyelement) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_index_supportfn(internal) FROM PUBLIC; -- --- Name: FUNCTION pgis_asgeobuf_transfn(internal, anyelement, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_lib_build_date(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asgeobuf_transfn(internal, anyelement, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_lib_build_date() FROM PUBLIC; -- --- Name: FUNCTION pgis_asmvt_combinefn(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_lib_revision(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asmvt_combinefn(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_lib_revision() FROM PUBLIC; -- --- Name: FUNCTION pgis_asmvt_deserialfn(bytea, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_lib_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asmvt_deserialfn(bytea, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_lib_version() FROM PUBLIC; -- --- Name: FUNCTION pgis_asmvt_finalfn(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_libjson_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asmvt_finalfn(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_libjson_version() FROM PUBLIC; -- --- Name: FUNCTION pgis_asmvt_serialfn(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_liblwgeom_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asmvt_serialfn(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_liblwgeom_version() FROM PUBLIC; -- --- Name: FUNCTION pgis_asmvt_transfn(internal, anyelement); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_libprotobuf_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asmvt_transfn(internal, anyelement) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_libprotobuf_version() FROM PUBLIC; -- --- Name: FUNCTION pgis_asmvt_transfn(internal, anyelement, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_libxml_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asmvt_transfn(internal, anyelement, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_libxml_version() FROM PUBLIC; -- --- Name: FUNCTION pgis_asmvt_transfn(internal, anyelement, text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_noop(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asmvt_transfn(internal, anyelement, text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_noop(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgis_asmvt_transfn(internal, anyelement, text, integer, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_proj_compiled_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asmvt_transfn(internal, anyelement, text, integer, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_proj_compiled_version() FROM PUBLIC; -- --- Name: FUNCTION pgis_asmvt_transfn(internal, anyelement, text, integer, text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_proj_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_asmvt_transfn(internal, anyelement, text, integer, text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_proj_version() FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_accum_transfn(internal, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_scripts_build_date(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_accum_transfn(internal, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_scripts_build_date() FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_accum_transfn(internal, public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_scripts_installed(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_accum_transfn(internal, public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_scripts_installed() FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_accum_transfn(internal, public.geometry, double precision, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_scripts_released(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_accum_transfn(internal, public.geometry, double precision, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_scripts_released() FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_clusterintersecting_finalfn(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_srs(auth_name text, auth_srid text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_clusterintersecting_finalfn(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_srs(auth_name text, auth_srid text) FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_clusterwithin_finalfn(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_srs_all(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_clusterwithin_finalfn(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_srs_all() FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_collect_finalfn(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_srs_codes(auth_name text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_collect_finalfn(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_srs_codes(auth_name text) FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_coverageunion_finalfn(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_srs_search(bounds public.geometry, authname text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_coverageunion_finalfn(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_srs_search(bounds public.geometry, authname text) FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_makeline_finalfn(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_svn_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_makeline_finalfn(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_svn_version() FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_polygonize_finalfn(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_transform_geometry(geom public.geometry, text, text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_polygonize_finalfn(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_transform_geometry(geom public.geometry, text, text, integer) FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_union_parallel_combinefn(internal, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_transform_pipeline_geometry(geom public.geometry, pipeline text, forward boolean, to_srid integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_union_parallel_combinefn(internal, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_transform_pipeline_geometry(geom public.geometry, pipeline text, forward boolean, to_srid integer) FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_union_parallel_deserialfn(bytea, internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_type_name(geomname character varying, coord_dimension integer, use_new_name boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_union_parallel_deserialfn(bytea, internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_type_name(geomname character varying, coord_dimension integer, use_new_name boolean) FROM PUBLIC; +GRANT ALL ON FUNCTION public.postgis_type_name(geomname character varying, coord_dimension integer, use_new_name boolean) TO vibetype_anonymous; +GRANT ALL ON FUNCTION public.postgis_type_name(geomname character varying, coord_dimension integer, use_new_name boolean) TO vibetype_account; -- --- Name: FUNCTION pgis_geometry_union_parallel_finalfn(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_typmod_dims(integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_union_parallel_finalfn(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_typmod_dims(integer) FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_union_parallel_serialfn(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_typmod_srid(integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_union_parallel_serialfn(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_typmod_srid(integer) FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_union_parallel_transfn(internal, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_typmod_type(integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_union_parallel_transfn(internal, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_typmod_type(integer) FROM PUBLIC; -- --- Name: FUNCTION pgis_geometry_union_parallel_transfn(internal, public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgis_geometry_union_parallel_transfn(internal, public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_version() FROM PUBLIC; -- --- Name: FUNCTION pgp_armor_headers(text, OUT key text, OUT value text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION postgis_wagyu_version(); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_armor_headers(text, OUT key text, OUT value text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.postgis_wagyu_version() FROM PUBLIC; -- --- Name: FUNCTION pgp_key_id(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_3dclosestpoint(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_key_id(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_3dclosestpoint(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgp_pub_decrypt(bytea, bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_3ddfullywithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_pub_decrypt(bytea, bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_3ddfullywithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION pgp_pub_decrypt(bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_3ddistance(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_pub_decrypt(bytea, bytea, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_3ddistance(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgp_pub_decrypt(bytea, bytea, text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_3ddwithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_pub_decrypt(bytea, bytea, text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_3ddwithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_3dintersects(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_pub_decrypt_bytea(bytea, bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_3dintersects(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_3dlength(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_pub_decrypt_bytea(bytea, bytea, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_3dlength(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_3dlineinterpolatepoint(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_pub_decrypt_bytea(bytea, bytea, text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_3dlineinterpolatepoint(public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION pgp_pub_encrypt(text, bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_3dlongestline(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_pub_encrypt(text, bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_3dlongestline(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgp_pub_encrypt(text, bytea, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_3dmakebox(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_pub_encrypt(text, bytea, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_3dmakebox(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgp_pub_encrypt_bytea(bytea, bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_3dmaxdistance(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_pub_encrypt_bytea(bytea, bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_3dmaxdistance(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_3dperimeter(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_pub_encrypt_bytea(bytea, bytea, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_3dperimeter(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgp_sym_decrypt(bytea, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_3dshortestline(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_sym_decrypt(bytea, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_3dshortestline(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgp_sym_decrypt(bytea, text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_addmeasure(public.geometry, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_sym_decrypt(bytea, text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_addmeasure(public.geometry, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION pgp_sym_decrypt_bytea(bytea, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_addpoint(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_sym_decrypt_bytea(bytea, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_addpoint(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgp_sym_decrypt_bytea(bytea, text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_addpoint(geom1 public.geometry, geom2 public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_sym_decrypt_bytea(bytea, text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_addpoint(geom1 public.geometry, geom2 public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION pgp_sym_encrypt(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_affine(public.geometry, double precision, double precision, double precision, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_sym_encrypt(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_affine(public.geometry, double precision, double precision, double precision, double precision, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION pgp_sym_encrypt(text, text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_affine(public.geometry, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_sym_encrypt(text, text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_affine(public.geometry, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION pgp_sym_encrypt_bytea(bytea, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_angle(line1 public.geometry, line2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_sym_encrypt_bytea(bytea, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_angle(line1 public.geometry, line2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION pgp_sym_encrypt_bytea(bytea, text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_angle(pt1 public.geometry, pt2 public.geometry, pt3 public.geometry, pt4 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.pgp_sym_encrypt_bytea(bytea, text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_angle(pt1 public.geometry, pt2 public.geometry, pt3 public.geometry, pt4 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION populate_geometry_columns(use_typmod boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_area(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.populate_geometry_columns(use_typmod boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_area(text) FROM PUBLIC; -- --- Name: FUNCTION populate_geometry_columns(tbl_oid oid, use_typmod boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_area(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.populate_geometry_columns(tbl_oid oid, use_typmod boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_area(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION postgis_addbbox(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_area(geog public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_addbbox(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_area(geog public.geography, use_spheroid boolean) FROM PUBLIC; -- --- Name: FUNCTION postgis_cache_bbox(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_area2d(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_cache_bbox() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_area2d(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION postgis_constraint_dims(geomschema text, geomtable text, geomcolumn text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asbinary(public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_constraint_dims(geomschema text, geomtable text, geomcolumn text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asbinary(public.geography) FROM PUBLIC; -- --- Name: FUNCTION postgis_constraint_srid(geomschema text, geomtable text, geomcolumn text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asbinary(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_constraint_srid(geomschema text, geomtable text, geomcolumn text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asbinary(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION postgis_constraint_type(geomschema text, geomtable text, geomcolumn text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asbinary(public.geography, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_constraint_type(geomschema text, geomtable text, geomcolumn text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asbinary(public.geography, text) FROM PUBLIC; -- --- Name: FUNCTION postgis_dropbbox(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asbinary(public.geometry, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_dropbbox(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asbinary(public.geometry, text) FROM PUBLIC; -- --- Name: FUNCTION postgis_extensions_upgrade(target_version text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asencodedpolyline(geom public.geometry, nprecision integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_extensions_upgrade(target_version text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asencodedpolyline(geom public.geometry, nprecision integer) FROM PUBLIC; -- --- Name: FUNCTION postgis_full_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asewkb(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_full_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asewkb(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION postgis_geos_compiled_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asewkb(public.geometry, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_geos_compiled_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asewkb(public.geometry, text) FROM PUBLIC; -- --- Name: FUNCTION postgis_geos_noop(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asewkt(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_geos_noop(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asewkt(text) FROM PUBLIC; -- --- Name: FUNCTION postgis_geos_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asewkt(public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_geos_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asewkt(public.geography) FROM PUBLIC; -- --- Name: FUNCTION postgis_getbbox(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asewkt(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_getbbox(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asewkt(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION postgis_hasbbox(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asewkt(public.geography, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_hasbbox(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asewkt(public.geography, integer) FROM PUBLIC; -- --- Name: FUNCTION postgis_index_supportfn(internal); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asewkt(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_index_supportfn(internal) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asewkt(public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION postgis_lib_build_date(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asgeojson(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_lib_build_date() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asgeojson(text) FROM PUBLIC; -- --- Name: FUNCTION postgis_lib_revision(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asgeojson(geog public.geography, maxdecimaldigits integer, options integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_lib_revision() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asgeojson(geog public.geography, maxdecimaldigits integer, options integer) FROM PUBLIC; +GRANT ALL ON FUNCTION public.st_asgeojson(geog public.geography, maxdecimaldigits integer, options integer) TO vibetype_anonymous; +GRANT ALL ON FUNCTION public.st_asgeojson(geog public.geography, maxdecimaldigits integer, options integer) TO vibetype_account; -- --- Name: FUNCTION postgis_lib_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asgeojson(geom public.geometry, maxdecimaldigits integer, options integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_lib_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asgeojson(geom public.geometry, maxdecimaldigits integer, options integer) FROM PUBLIC; -- --- Name: FUNCTION postgis_libjson_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asgeojson(r record, geom_column text, maxdecimaldigits integer, pretty_bool boolean, id_column text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_libjson_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asgeojson(r record, geom_column text, maxdecimaldigits integer, pretty_bool boolean, id_column text) FROM PUBLIC; -- --- Name: FUNCTION postgis_liblwgeom_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asgml(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_liblwgeom_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asgml(text) FROM PUBLIC; -- --- Name: FUNCTION postgis_libprotobuf_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asgml(geom public.geometry, maxdecimaldigits integer, options integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_libprotobuf_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asgml(geom public.geometry, maxdecimaldigits integer, options integer) FROM PUBLIC; -- --- Name: FUNCTION postgis_libxml_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asgml(geog public.geography, maxdecimaldigits integer, options integer, nprefix text, id text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_libxml_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asgml(geog public.geography, maxdecimaldigits integer, options integer, nprefix text, id text) FROM PUBLIC; -- --- Name: FUNCTION postgis_noop(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asgml(version integer, geog public.geography, maxdecimaldigits integer, options integer, nprefix text, id text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_noop(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asgml(version integer, geog public.geography, maxdecimaldigits integer, options integer, nprefix text, id text) FROM PUBLIC; -- --- Name: FUNCTION postgis_proj_compiled_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asgml(version integer, geom public.geometry, maxdecimaldigits integer, options integer, nprefix text, id text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_proj_compiled_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asgml(version integer, geom public.geometry, maxdecimaldigits integer, options integer, nprefix text, id text) FROM PUBLIC; -- --- Name: FUNCTION postgis_proj_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_ashexewkb(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_proj_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_ashexewkb(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION postgis_scripts_build_date(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_ashexewkb(public.geometry, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_scripts_build_date() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_ashexewkb(public.geometry, text) FROM PUBLIC; -- --- Name: FUNCTION postgis_scripts_installed(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_askml(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_scripts_installed() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_askml(text) FROM PUBLIC; -- --- Name: FUNCTION postgis_scripts_released(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_askml(geog public.geography, maxdecimaldigits integer, nprefix text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_scripts_released() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_askml(geog public.geography, maxdecimaldigits integer, nprefix text) FROM PUBLIC; -- --- Name: FUNCTION postgis_srs(auth_name text, auth_srid text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_askml(geom public.geometry, maxdecimaldigits integer, nprefix text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_srs(auth_name text, auth_srid text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_askml(geom public.geometry, maxdecimaldigits integer, nprefix text) FROM PUBLIC; -- --- Name: FUNCTION postgis_srs_all(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_aslatlontext(geom public.geometry, tmpl text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_srs_all() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_aslatlontext(geom public.geometry, tmpl text) FROM PUBLIC; -- --- Name: FUNCTION postgis_srs_codes(auth_name text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asmarc21(geom public.geometry, format text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_srs_codes(auth_name text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asmarc21(geom public.geometry, format text) FROM PUBLIC; -- --- Name: FUNCTION postgis_srs_search(bounds public.geometry, authname text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asmvtgeom(geom public.geometry, bounds public.box2d, extent integer, buffer integer, clip_geom boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_srs_search(bounds public.geometry, authname text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asmvtgeom(geom public.geometry, bounds public.box2d, extent integer, buffer integer, clip_geom boolean) FROM PUBLIC; -- --- Name: FUNCTION postgis_svn_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_assvg(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_svn_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_assvg(text) FROM PUBLIC; -- --- Name: FUNCTION postgis_transform_geometry(geom public.geometry, text, text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_assvg(geog public.geography, rel integer, maxdecimaldigits integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_transform_geometry(geom public.geometry, text, text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_assvg(geog public.geography, rel integer, maxdecimaldigits integer) FROM PUBLIC; -- --- Name: FUNCTION postgis_transform_pipeline_geometry(geom public.geometry, pipeline text, forward boolean, to_srid integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_assvg(geom public.geometry, rel integer, maxdecimaldigits integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_transform_pipeline_geometry(geom public.geometry, pipeline text, forward boolean, to_srid integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_assvg(geom public.geometry, rel integer, maxdecimaldigits integer) FROM PUBLIC; -- --- Name: FUNCTION postgis_type_name(geomname character varying, coord_dimension integer, use_new_name boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_astext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_type_name(geomname character varying, coord_dimension integer, use_new_name boolean) FROM PUBLIC; -GRANT ALL ON FUNCTION public.postgis_type_name(geomname character varying, coord_dimension integer, use_new_name boolean) TO maevsi_anonymous; -GRANT ALL ON FUNCTION public.postgis_type_name(geomname character varying, coord_dimension integer, use_new_name boolean) TO maevsi_account; +REVOKE ALL ON FUNCTION public.st_astext(text) FROM PUBLIC; -- --- Name: FUNCTION postgis_typmod_dims(integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_astext(public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_typmod_dims(integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_astext(public.geography) FROM PUBLIC; -- --- Name: FUNCTION postgis_typmod_srid(integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_astext(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_typmod_srid(integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_astext(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION postgis_typmod_type(integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_astext(public.geography, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_typmod_type(integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_astext(public.geography, integer) FROM PUBLIC; -- --- Name: FUNCTION postgis_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_astext(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_astext(public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION postgis_wagyu_version(); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_astwkb(geom public.geometry, prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.postgis_wagyu_version() FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_astwkb(geom public.geometry, prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean) FROM PUBLIC; -- --- Name: FUNCTION st_3dclosestpoint(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_astwkb(geom public.geometry[], ids bigint[], prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_3dclosestpoint(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_astwkb(geom public.geometry[], ids bigint[], prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean) FROM PUBLIC; -- --- Name: FUNCTION st_3ddfullywithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_asx3d(geom public.geometry, maxdecimaldigits integer, options integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_3ddfullywithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_asx3d(geom public.geometry, maxdecimaldigits integer, options integer) FROM PUBLIC; -- --- Name: FUNCTION st_3ddistance(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_azimuth(geog1 public.geography, geog2 public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_3ddistance(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_azimuth(geog1 public.geography, geog2 public.geography) FROM PUBLIC; -- --- Name: FUNCTION st_3ddwithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_azimuth(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_3ddwithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_azimuth(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_3dintersects(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_bdmpolyfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_3dintersects(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_bdmpolyfromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_3dlength(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_bdpolyfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_3dlength(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_bdpolyfromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_3dlineinterpolatepoint(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_boundary(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_3dlineinterpolatepoint(public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_boundary(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_3dlongestline(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_boundingdiagonal(geom public.geometry, fits boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_3dlongestline(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_boundingdiagonal(geom public.geometry, fits boolean) FROM PUBLIC; -- --- Name: FUNCTION st_3dmakebox(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_box2dfromgeohash(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_3dmakebox(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_box2dfromgeohash(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_3dmaxdistance(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_buffer(text, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_3dmaxdistance(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_buffer(text, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_3dperimeter(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_buffer(public.geography, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_3dperimeter(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_buffer(public.geography, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_3dshortestline(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_buffer(text, double precision, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_3dshortestline(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_buffer(text, double precision, integer) FROM PUBLIC; -- --- Name: FUNCTION st_addmeasure(public.geometry, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_buffer(text, double precision, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_addmeasure(public.geometry, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_buffer(text, double precision, text) FROM PUBLIC; -- --- Name: FUNCTION st_addpoint(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_buffer(public.geography, double precision, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_addpoint(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_buffer(public.geography, double precision, integer) FROM PUBLIC; -- --- Name: FUNCTION st_addpoint(geom1 public.geometry, geom2 public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_buffer(public.geography, double precision, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_addpoint(geom1 public.geometry, geom2 public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_buffer(public.geography, double precision, text) FROM PUBLIC; -- --- Name: FUNCTION st_affine(public.geometry, double precision, double precision, double precision, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_buffer(geom public.geometry, radius double precision, quadsegs integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_affine(public.geometry, double precision, double precision, double precision, double precision, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_buffer(geom public.geometry, radius double precision, quadsegs integer) FROM PUBLIC; -- --- Name: FUNCTION st_affine(public.geometry, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_buffer(geom public.geometry, radius double precision, options text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_affine(public.geometry, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_buffer(geom public.geometry, radius double precision, options text) FROM PUBLIC; -- --- Name: FUNCTION st_angle(line1 public.geometry, line2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_buildarea(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_angle(line1 public.geometry, line2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_buildarea(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_angle(pt1 public.geometry, pt2 public.geometry, pt3 public.geometry, pt4 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_centroid(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_angle(pt1 public.geometry, pt2 public.geometry, pt3 public.geometry, pt4 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_centroid(text) FROM PUBLIC; -- --- Name: FUNCTION st_area(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_centroid(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_area(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_centroid(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_area(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_centroid(public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_area(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_centroid(public.geography, use_spheroid boolean) FROM PUBLIC; -- --- Name: FUNCTION st_area(geog public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_chaikinsmoothing(public.geometry, integer, boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_area(geog public.geography, use_spheroid boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_chaikinsmoothing(public.geometry, integer, boolean) FROM PUBLIC; -- --- Name: FUNCTION st_area2d(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_cleangeometry(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_area2d(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_cleangeometry(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_asbinary(public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_clipbybox2d(geom public.geometry, box public.box2d); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asbinary(public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_clipbybox2d(geom public.geometry, box public.box2d) FROM PUBLIC; -- --- Name: FUNCTION st_asbinary(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_closestpoint(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asbinary(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_closestpoint(text, text) FROM PUBLIC; -- --- Name: FUNCTION st_asbinary(public.geography, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_closestpoint(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asbinary(public.geography, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_closestpoint(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_asbinary(public.geometry, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_closestpoint(public.geography, public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asbinary(public.geometry, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_closestpoint(public.geography, public.geography, use_spheroid boolean) FROM PUBLIC; -- --- Name: FUNCTION st_asencodedpolyline(geom public.geometry, nprecision integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_closestpointofapproach(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asencodedpolyline(geom public.geometry, nprecision integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_closestpointofapproach(public.geometry, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_asewkb(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_clusterdbscan(public.geometry, eps double precision, minpoints integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asewkb(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_clusterdbscan(public.geometry, eps double precision, minpoints integer) FROM PUBLIC; -- --- Name: FUNCTION st_asewkb(public.geometry, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_clusterintersecting(public.geometry[]); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asewkb(public.geometry, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_clusterintersecting(public.geometry[]) FROM PUBLIC; -- --- Name: FUNCTION st_asewkt(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_clusterintersectingwin(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asewkt(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_clusterintersectingwin(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_asewkt(public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_clusterkmeans(geom public.geometry, k integer, max_radius double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asewkt(public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_clusterkmeans(geom public.geometry, k integer, max_radius double precision) FROM PUBLIC; -- --- Name: FUNCTION st_asewkt(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_clusterwithin(public.geometry[], double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asewkt(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_clusterwithin(public.geometry[], double precision) FROM PUBLIC; -- --- Name: FUNCTION st_asewkt(public.geography, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_clusterwithinwin(public.geometry, distance double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asewkt(public.geography, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_clusterwithinwin(public.geometry, distance double precision) FROM PUBLIC; -- --- Name: FUNCTION st_asewkt(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_collect(public.geometry[]); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asewkt(public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_collect(public.geometry[]) FROM PUBLIC; -- --- Name: FUNCTION st_asgeojson(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_collect(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asgeojson(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_collect(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_asgeojson(geog public.geography, maxdecimaldigits integer, options integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_collectionextract(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asgeojson(geog public.geography, maxdecimaldigits integer, options integer) FROM PUBLIC; -GRANT ALL ON FUNCTION public.st_asgeojson(geog public.geography, maxdecimaldigits integer, options integer) TO maevsi_anonymous; -GRANT ALL ON FUNCTION public.st_asgeojson(geog public.geography, maxdecimaldigits integer, options integer) TO maevsi_account; +REVOKE ALL ON FUNCTION public.st_collectionextract(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_asgeojson(geom public.geometry, maxdecimaldigits integer, options integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_collectionextract(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asgeojson(geom public.geometry, maxdecimaldigits integer, options integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_collectionextract(public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION st_asgeojson(r record, geom_column text, maxdecimaldigits integer, pretty_bool boolean, id_column text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_collectionhomogenize(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asgeojson(r record, geom_column text, maxdecimaldigits integer, pretty_bool boolean, id_column text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_collectionhomogenize(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_asgml(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_combinebbox(public.box2d, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asgml(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_combinebbox(public.box2d, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_asgml(geom public.geometry, maxdecimaldigits integer, options integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_combinebbox(public.box3d, public.box3d); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asgml(geom public.geometry, maxdecimaldigits integer, options integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_combinebbox(public.box3d, public.box3d) FROM PUBLIC; -- --- Name: FUNCTION st_asgml(geog public.geography, maxdecimaldigits integer, options integer, nprefix text, id text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_combinebbox(public.box3d, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asgml(geog public.geography, maxdecimaldigits integer, options integer, nprefix text, id text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_combinebbox(public.box3d, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_asgml(version integer, geog public.geography, maxdecimaldigits integer, options integer, nprefix text, id text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_concavehull(param_geom public.geometry, param_pctconvex double precision, param_allow_holes boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asgml(version integer, geog public.geography, maxdecimaldigits integer, options integer, nprefix text, id text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_concavehull(param_geom public.geometry, param_pctconvex double precision, param_allow_holes boolean) FROM PUBLIC; -- --- Name: FUNCTION st_asgml(version integer, geom public.geometry, maxdecimaldigits integer, options integer, nprefix text, id text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_contains(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asgml(version integer, geom public.geometry, maxdecimaldigits integer, options integer, nprefix text, id text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_contains(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_ashexewkb(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_containsproperly(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_ashexewkb(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_containsproperly(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_ashexewkb(public.geometry, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_convexhull(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_ashexewkb(public.geometry, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_convexhull(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_askml(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_coorddim(geometry public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_askml(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_coorddim(geometry public.geometry) FROM PUBLIC; +GRANT ALL ON FUNCTION public.st_coorddim(geometry public.geometry) TO vibetype_anonymous; +GRANT ALL ON FUNCTION public.st_coorddim(geometry public.geometry) TO vibetype_account; -- --- Name: FUNCTION st_askml(geog public.geography, maxdecimaldigits integer, nprefix text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_coverageinvalidedges(geom public.geometry, tolerance double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_askml(geog public.geography, maxdecimaldigits integer, nprefix text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_coverageinvalidedges(geom public.geometry, tolerance double precision) FROM PUBLIC; -- --- Name: FUNCTION st_askml(geom public.geometry, maxdecimaldigits integer, nprefix text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_coveragesimplify(geom public.geometry, tolerance double precision, simplifyboundary boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_askml(geom public.geometry, maxdecimaldigits integer, nprefix text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_coveragesimplify(geom public.geometry, tolerance double precision, simplifyboundary boolean) FROM PUBLIC; -- --- Name: FUNCTION st_aslatlontext(geom public.geometry, tmpl text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_coverageunion(public.geometry[]); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_aslatlontext(geom public.geometry, tmpl text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_coverageunion(public.geometry[]) FROM PUBLIC; -- --- Name: FUNCTION st_asmarc21(geom public.geometry, format text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_coveredby(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asmarc21(geom public.geometry, format text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_coveredby(text, text) FROM PUBLIC; -- --- Name: FUNCTION st_asmvtgeom(geom public.geometry, bounds public.box2d, extent integer, buffer integer, clip_geom boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_coveredby(geog1 public.geography, geog2 public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asmvtgeom(geom public.geometry, bounds public.box2d, extent integer, buffer integer, clip_geom boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_coveredby(geog1 public.geography, geog2 public.geography) FROM PUBLIC; -- --- Name: FUNCTION st_assvg(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_coveredby(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_assvg(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_coveredby(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_assvg(geog public.geography, rel integer, maxdecimaldigits integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_covers(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_assvg(geog public.geography, rel integer, maxdecimaldigits integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_covers(text, text) FROM PUBLIC; -- --- Name: FUNCTION st_assvg(geom public.geometry, rel integer, maxdecimaldigits integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_covers(geog1 public.geography, geog2 public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_assvg(geom public.geometry, rel integer, maxdecimaldigits integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_covers(geog1 public.geography, geog2 public.geography) FROM PUBLIC; -- --- Name: FUNCTION st_astext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_covers(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_astext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_covers(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_astext(public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_cpawithin(public.geometry, public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_astext(public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_cpawithin(public.geometry, public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_astext(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_crosses(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_astext(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_crosses(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_astext(public.geography, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_curven(geometry public.geometry, i integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_astext(public.geography, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_curven(geometry public.geometry, i integer) FROM PUBLIC; -- --- Name: FUNCTION st_astext(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_curvetoline(geom public.geometry, tol double precision, toltype integer, flags integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_astext(public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_curvetoline(geom public.geometry, tol double precision, toltype integer, flags integer) FROM PUBLIC; -- --- Name: FUNCTION st_astwkb(geom public.geometry, prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_delaunaytriangles(g1 public.geometry, tolerance double precision, flags integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_astwkb(geom public.geometry, prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_delaunaytriangles(g1 public.geometry, tolerance double precision, flags integer) FROM PUBLIC; -- --- Name: FUNCTION st_astwkb(geom public.geometry[], ids bigint[], prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_dfullywithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_astwkb(geom public.geometry[], ids bigint[], prec integer, prec_z integer, prec_m integer, with_sizes boolean, with_boxes boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_dfullywithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_asx3d(geom public.geometry, maxdecimaldigits integer, options integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_difference(geom1 public.geometry, geom2 public.geometry, gridsize double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_asx3d(geom public.geometry, maxdecimaldigits integer, options integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_difference(geom1 public.geometry, geom2 public.geometry, gridsize double precision) FROM PUBLIC; -- --- Name: FUNCTION st_azimuth(geog1 public.geography, geog2 public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_dimension(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_azimuth(geog1 public.geography, geog2 public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_dimension(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_azimuth(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_disjoint(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_azimuth(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_disjoint(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_bdmpolyfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_distance(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_bdmpolyfromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_distance(text, text) FROM PUBLIC; -- --- Name: FUNCTION st_bdpolyfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_distance(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_bdpolyfromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_distance(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_boundary(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_distance(geog1 public.geography, geog2 public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_boundary(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_distance(geog1 public.geography, geog2 public.geography, use_spheroid boolean) FROM PUBLIC; -- --- Name: FUNCTION st_boundingdiagonal(geom public.geometry, fits boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_distancecpa(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_boundingdiagonal(geom public.geometry, fits boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_distancecpa(public.geometry, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_box2dfromgeohash(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_distancesphere(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_box2dfromgeohash(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_distancesphere(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_buffer(text, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_distancesphere(geom1 public.geometry, geom2 public.geometry, radius double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_buffer(text, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_distancesphere(geom1 public.geometry, geom2 public.geometry, radius double precision) FROM PUBLIC; -- --- Name: FUNCTION st_buffer(public.geography, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_distancespheroid(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_buffer(public.geography, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_distancespheroid(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_buffer(text, double precision, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_distancespheroid(geom1 public.geometry, geom2 public.geometry, public.spheroid); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_buffer(text, double precision, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_distancespheroid(geom1 public.geometry, geom2 public.geometry, public.spheroid) FROM PUBLIC; -- --- Name: FUNCTION st_buffer(text, double precision, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_dump(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_buffer(text, double precision, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_dump(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_buffer(public.geography, double precision, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_dumppoints(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_buffer(public.geography, double precision, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_dumppoints(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_buffer(public.geography, double precision, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_dumprings(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_buffer(public.geography, double precision, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_dumprings(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_buffer(geom public.geometry, radius double precision, quadsegs integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_dumpsegments(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_buffer(geom public.geometry, radius double precision, quadsegs integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_dumpsegments(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_buffer(geom public.geometry, radius double precision, options text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_dwithin(text, text, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_buffer(geom public.geometry, radius double precision, options text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_dwithin(text, text, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_buildarea(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_dwithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_buildarea(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_dwithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_centroid(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_dwithin(geog1 public.geography, geog2 public.geography, tolerance double precision, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_centroid(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_dwithin(geog1 public.geography, geog2 public.geography, tolerance double precision, use_spheroid boolean) FROM PUBLIC; -- --- Name: FUNCTION st_centroid(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_endpoint(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_centroid(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_endpoint(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_centroid(public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_envelope(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_centroid(public.geography, use_spheroid boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_envelope(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_chaikinsmoothing(public.geometry, integer, boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_equals(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_chaikinsmoothing(public.geometry, integer, boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_equals(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_cleangeometry(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_estimatedextent(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_cleangeometry(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_estimatedextent(text, text) FROM PUBLIC; -- --- Name: FUNCTION st_clipbybox2d(geom public.geometry, box public.box2d); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_estimatedextent(text, text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_clipbybox2d(geom public.geometry, box public.box2d) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_estimatedextent(text, text, text) FROM PUBLIC; -- --- Name: FUNCTION st_closestpoint(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_estimatedextent(text, text, text, boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_closestpoint(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_estimatedextent(text, text, text, boolean) FROM PUBLIC; -- --- Name: FUNCTION st_closestpoint(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_expand(public.box2d, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_closestpoint(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_expand(public.box2d, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_closestpoint(public.geography, public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_expand(public.box3d, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_closestpoint(public.geography, public.geography, use_spheroid boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_expand(public.box3d, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_closestpointofapproach(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_expand(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_closestpointofapproach(public.geometry, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_expand(public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_clusterdbscan(public.geometry, eps double precision, minpoints integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_expand(box public.box2d, dx double precision, dy double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_clusterdbscan(public.geometry, eps double precision, minpoints integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_expand(box public.box2d, dx double precision, dy double precision) FROM PUBLIC; -- --- Name: FUNCTION st_clusterintersecting(public.geometry[]); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_expand(box public.box3d, dx double precision, dy double precision, dz double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_clusterintersecting(public.geometry[]) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_expand(box public.box3d, dx double precision, dy double precision, dz double precision) FROM PUBLIC; -- --- Name: FUNCTION st_clusterintersectingwin(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_expand(geom public.geometry, dx double precision, dy double precision, dz double precision, dm double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_clusterintersectingwin(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_expand(geom public.geometry, dx double precision, dy double precision, dz double precision, dm double precision) FROM PUBLIC; -- --- Name: FUNCTION st_clusterkmeans(geom public.geometry, k integer, max_radius double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_exteriorring(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_clusterkmeans(geom public.geometry, k integer, max_radius double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_exteriorring(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_clusterwithin(public.geometry[], double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_filterbym(public.geometry, double precision, double precision, boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_clusterwithin(public.geometry[], double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_filterbym(public.geometry, double precision, double precision, boolean) FROM PUBLIC; -- --- Name: FUNCTION st_clusterwithinwin(public.geometry, distance double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_findextent(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_clusterwithinwin(public.geometry, distance double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_findextent(text, text) FROM PUBLIC; -- --- Name: FUNCTION st_collect(public.geometry[]); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_findextent(text, text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_collect(public.geometry[]) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_findextent(text, text, text) FROM PUBLIC; -- --- Name: FUNCTION st_collect(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_flipcoordinates(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_collect(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_flipcoordinates(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_collectionextract(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_force2d(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_collectionextract(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_force2d(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_collectionextract(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_force3d(geom public.geometry, zvalue double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_collectionextract(public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_force3d(geom public.geometry, zvalue double precision) FROM PUBLIC; -- --- Name: FUNCTION st_collectionhomogenize(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_force3dm(geom public.geometry, mvalue double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_collectionhomogenize(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_force3dm(geom public.geometry, mvalue double precision) FROM PUBLIC; -- --- Name: FUNCTION st_combinebbox(public.box2d, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_force3dz(geom public.geometry, zvalue double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_combinebbox(public.box2d, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_force3dz(geom public.geometry, zvalue double precision) FROM PUBLIC; -- --- Name: FUNCTION st_combinebbox(public.box3d, public.box3d); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_force4d(geom public.geometry, zvalue double precision, mvalue double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_combinebbox(public.box3d, public.box3d) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_force4d(geom public.geometry, zvalue double precision, mvalue double precision) FROM PUBLIC; -- --- Name: FUNCTION st_combinebbox(public.box3d, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_forcecollection(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_combinebbox(public.box3d, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_forcecollection(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_concavehull(param_geom public.geometry, param_pctconvex double precision, param_allow_holes boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_forcecurve(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_concavehull(param_geom public.geometry, param_pctconvex double precision, param_allow_holes boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_forcecurve(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_contains(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_forcepolygonccw(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_contains(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_forcepolygonccw(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_containsproperly(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_forcepolygoncw(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_containsproperly(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_forcepolygoncw(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_convexhull(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_forcerhr(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_convexhull(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_forcerhr(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_coorddim(geometry public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_forcesfs(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_coorddim(geometry public.geometry) FROM PUBLIC; -GRANT ALL ON FUNCTION public.st_coorddim(geometry public.geometry) TO maevsi_anonymous; -GRANT ALL ON FUNCTION public.st_coorddim(geometry public.geometry) TO maevsi_account; +REVOKE ALL ON FUNCTION public.st_forcesfs(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_coverageinvalidedges(geom public.geometry, tolerance double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_forcesfs(public.geometry, version text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_coverageinvalidedges(geom public.geometry, tolerance double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_forcesfs(public.geometry, version text) FROM PUBLIC; -- --- Name: FUNCTION st_coveragesimplify(geom public.geometry, tolerance double precision, simplifyboundary boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_frechetdistance(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_coveragesimplify(geom public.geometry, tolerance double precision, simplifyboundary boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_frechetdistance(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_coverageunion(public.geometry[]); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_fromflatgeobuf(anyelement, bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_coverageunion(public.geometry[]) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_fromflatgeobuf(anyelement, bytea) FROM PUBLIC; -- --- Name: FUNCTION st_coveredby(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_fromflatgeobuftotable(text, text, bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_coveredby(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_fromflatgeobuftotable(text, text, bytea) FROM PUBLIC; -- --- Name: FUNCTION st_coveredby(geog1 public.geography, geog2 public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_generatepoints(area public.geometry, npoints integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_coveredby(geog1 public.geography, geog2 public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_generatepoints(area public.geometry, npoints integer) FROM PUBLIC; -- --- Name: FUNCTION st_coveredby(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_generatepoints(area public.geometry, npoints integer, seed integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_coveredby(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_generatepoints(area public.geometry, npoints integer, seed integer) FROM PUBLIC; -- --- Name: FUNCTION st_covers(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geogfromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_covers(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geogfromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_covers(geog1 public.geography, geog2 public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geogfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_covers(geog1 public.geography, geog2 public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geogfromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_covers(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geographyfromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_covers(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geographyfromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_cpawithin(public.geometry, public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geohash(geog public.geography, maxchars integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_cpawithin(public.geometry, public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geohash(geog public.geography, maxchars integer) FROM PUBLIC; -- --- Name: FUNCTION st_crosses(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geohash(geom public.geometry, maxchars integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_crosses(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geohash(geom public.geometry, maxchars integer) FROM PUBLIC; -- --- Name: FUNCTION st_curven(geometry public.geometry, i integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomcollfromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_curven(geometry public.geometry, i integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomcollfromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_curvetoline(geom public.geometry, tol double precision, toltype integer, flags integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomcollfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_curvetoline(geom public.geometry, tol double precision, toltype integer, flags integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomcollfromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_delaunaytriangles(g1 public.geometry, tolerance double precision, flags integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomcollfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_delaunaytriangles(g1 public.geometry, tolerance double precision, flags integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomcollfromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_dfullywithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomcollfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_dfullywithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomcollfromwkb(bytea, integer) FROM PUBLIC; -- --- Name: FUNCTION st_difference(geom1 public.geometry, geom2 public.geometry, gridsize double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geometricmedian(g public.geometry, tolerance double precision, max_iter integer, fail_if_not_converged boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_difference(geom1 public.geometry, geom2 public.geometry, gridsize double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geometricmedian(g public.geometry, tolerance double precision, max_iter integer, fail_if_not_converged boolean) FROM PUBLIC; -- --- Name: FUNCTION st_dimension(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geometryfromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_dimension(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geometryfromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_disjoint(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geometryfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_disjoint(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geometryfromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_distance(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geometryn(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_distance(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geometryn(public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION st_distance(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geometrytype(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_distance(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geometrytype(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_distance(geog1 public.geography, geog2 public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromewkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_distance(geog1 public.geography, geog2 public.geography, use_spheroid boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromewkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_distancecpa(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromewkt(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_distancecpa(public.geometry, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromewkt(text) FROM PUBLIC; -- --- Name: FUNCTION st_distancesphere(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromgeohash(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_distancesphere(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromgeohash(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_distancesphere(geom1 public.geometry, geom2 public.geometry, radius double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromgeojson(json); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_distancesphere(geom1 public.geometry, geom2 public.geometry, radius double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromgeojson(json) FROM PUBLIC; -- --- Name: FUNCTION st_distancespheroid(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromgeojson(jsonb); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_distancespheroid(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromgeojson(jsonb) FROM PUBLIC; -- --- Name: FUNCTION st_distancespheroid(geom1 public.geometry, geom2 public.geometry, public.spheroid); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromgeojson(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_distancespheroid(geom1 public.geometry, geom2 public.geometry, public.spheroid) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromgeojson(text) FROM PUBLIC; +GRANT ALL ON FUNCTION public.st_geomfromgeojson(text) TO vibetype_anonymous; +GRANT ALL ON FUNCTION public.st_geomfromgeojson(text) TO vibetype_account; -- --- Name: FUNCTION st_dump(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromgml(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_dump(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromgml(text) FROM PUBLIC; -- --- Name: FUNCTION st_dumppoints(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromgml(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_dumppoints(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromgml(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_dumprings(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromkml(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_dumprings(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromkml(text) FROM PUBLIC; -- --- Name: FUNCTION st_dumpsegments(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfrommarc21(marc21xml text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_dumpsegments(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfrommarc21(marc21xml text) FROM PUBLIC; -- --- Name: FUNCTION st_dwithin(text, text, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_dwithin(text, text, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_dwithin(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_dwithin(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_dwithin(geog1 public.geography, geog2 public.geography, tolerance double precision, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromtwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_dwithin(geog1 public.geography, geog2 public.geography, tolerance double precision, use_spheroid boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromtwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_endpoint(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_endpoint(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_envelope(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_geomfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_envelope(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_geomfromwkb(bytea, integer) FROM PUBLIC; -- --- Name: FUNCTION st_equals(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_gmltosql(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_equals(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_gmltosql(text) FROM PUBLIC; -- --- Name: FUNCTION st_estimatedextent(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_gmltosql(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_estimatedextent(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_gmltosql(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_estimatedextent(text, text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_hasarc(geometry public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_estimatedextent(text, text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_hasarc(geometry public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_estimatedextent(text, text, text, boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_hasm(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_estimatedextent(text, text, text, boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_hasm(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_expand(public.box2d, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_hasz(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_expand(public.box2d, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_hasz(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_expand(public.box3d, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_hausdorffdistance(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_expand(public.box3d, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_hausdorffdistance(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_expand(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_hausdorffdistance(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_expand(public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_hausdorffdistance(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_expand(box public.box2d, dx double precision, dy double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_hexagon(size double precision, cell_i integer, cell_j integer, origin public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_expand(box public.box2d, dx double precision, dy double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_hexagon(size double precision, cell_i integer, cell_j integer, origin public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_expand(box public.box3d, dx double precision, dy double precision, dz double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_hexagongrid(size double precision, bounds public.geometry, OUT geom public.geometry, OUT i integer, OUT j integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_expand(box public.box3d, dx double precision, dy double precision, dz double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_hexagongrid(size double precision, bounds public.geometry, OUT geom public.geometry, OUT i integer, OUT j integer) FROM PUBLIC; -- --- Name: FUNCTION st_expand(geom public.geometry, dx double precision, dy double precision, dz double precision, dm double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_interiorringn(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_expand(geom public.geometry, dx double precision, dy double precision, dz double precision, dm double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_interiorringn(public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION st_exteriorring(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_interpolatepoint(line public.geometry, point public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_exteriorring(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_interpolatepoint(line public.geometry, point public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_filterbym(public.geometry, double precision, double precision, boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_intersection(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_filterbym(public.geometry, double precision, double precision, boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_intersection(text, text) FROM PUBLIC; -- --- Name: FUNCTION st_findextent(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_intersection(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_findextent(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_intersection(public.geography, public.geography) FROM PUBLIC; -- --- Name: FUNCTION st_findextent(text, text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_intersection(geom1 public.geometry, geom2 public.geometry, gridsize double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_findextent(text, text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_intersection(geom1 public.geometry, geom2 public.geometry, gridsize double precision) FROM PUBLIC; -- --- Name: FUNCTION st_flipcoordinates(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_intersects(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_flipcoordinates(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_intersects(text, text) FROM PUBLIC; -- --- Name: FUNCTION st_force2d(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_intersects(geog1 public.geography, geog2 public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_force2d(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_intersects(geog1 public.geography, geog2 public.geography) FROM PUBLIC; -- --- Name: FUNCTION st_force3d(geom public.geometry, zvalue double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_intersects(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_force3d(geom public.geometry, zvalue double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_intersects(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_force3dm(geom public.geometry, mvalue double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_inversetransformpipeline(geom public.geometry, pipeline text, to_srid integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_force3dm(geom public.geometry, mvalue double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_inversetransformpipeline(geom public.geometry, pipeline text, to_srid integer) FROM PUBLIC; -- --- Name: FUNCTION st_force3dz(geom public.geometry, zvalue double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_isclosed(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_force3dz(geom public.geometry, zvalue double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_isclosed(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_force4d(geom public.geometry, zvalue double precision, mvalue double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_iscollection(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_force4d(geom public.geometry, zvalue double precision, mvalue double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_iscollection(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_forcecollection(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_isempty(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_forcecollection(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_isempty(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_forcecurve(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_ispolygonccw(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_forcecurve(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_ispolygonccw(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_forcepolygonccw(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_ispolygoncw(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_forcepolygonccw(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_ispolygoncw(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_forcepolygoncw(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_isring(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_forcepolygoncw(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_isring(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_forcerhr(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_issimple(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_forcerhr(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_issimple(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_forcesfs(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_isvalid(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_forcesfs(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_isvalid(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_forcesfs(public.geometry, version text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_isvalid(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_forcesfs(public.geometry, version text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_isvalid(public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION st_frechetdistance(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_isvaliddetail(geom public.geometry, flags integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_frechetdistance(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_isvaliddetail(geom public.geometry, flags integer) FROM PUBLIC; -- --- Name: FUNCTION st_fromflatgeobuf(anyelement, bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_isvalidreason(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_fromflatgeobuf(anyelement, bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_isvalidreason(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_fromflatgeobuftotable(text, text, bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_isvalidreason(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_fromflatgeobuftotable(text, text, bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_isvalidreason(public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION st_generatepoints(area public.geometry, npoints integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_isvalidtrajectory(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_generatepoints(area public.geometry, npoints integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_isvalidtrajectory(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_generatepoints(area public.geometry, npoints integer, seed integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_largestemptycircle(geom public.geometry, tolerance double precision, boundary public.geometry, OUT center public.geometry, OUT nearest public.geometry, OUT radius double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_generatepoints(area public.geometry, npoints integer, seed integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_largestemptycircle(geom public.geometry, tolerance double precision, boundary public.geometry, OUT center public.geometry, OUT nearest public.geometry, OUT radius double precision) FROM PUBLIC; -- --- Name: FUNCTION st_geogfromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_length(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geogfromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_length(text) FROM PUBLIC; -- --- Name: FUNCTION st_geogfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_length(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geogfromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_length(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_geographyfromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_length(geog public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geographyfromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_length(geog public.geography, use_spheroid boolean) FROM PUBLIC; -- --- Name: FUNCTION st_geohash(geog public.geography, maxchars integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_length2d(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geohash(geog public.geography, maxchars integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_length2d(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_geohash(geom public.geometry, maxchars integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_length2dspheroid(public.geometry, public.spheroid); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geohash(geom public.geometry, maxchars integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_length2dspheroid(public.geometry, public.spheroid) FROM PUBLIC; -- --- Name: FUNCTION st_geomcollfromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_lengthspheroid(public.geometry, public.spheroid); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomcollfromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_lengthspheroid(public.geometry, public.spheroid) FROM PUBLIC; -- --- Name: FUNCTION st_geomcollfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_letters(letters text, font json); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomcollfromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_letters(letters text, font json) FROM PUBLIC; -- --- Name: FUNCTION st_geomcollfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linecrossingdirection(line1 public.geometry, line2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomcollfromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linecrossingdirection(line1 public.geometry, line2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_geomcollfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_lineextend(geom public.geometry, distance_forward double precision, distance_backward double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomcollfromwkb(bytea, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_lineextend(geom public.geometry, distance_forward double precision, distance_backward double precision) FROM PUBLIC; -- --- Name: FUNCTION st_geometricmedian(g public.geometry, tolerance double precision, max_iter integer, fail_if_not_converged boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linefromencodedpolyline(txtin text, nprecision integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geometricmedian(g public.geometry, tolerance double precision, max_iter integer, fail_if_not_converged boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linefromencodedpolyline(txtin text, nprecision integer) FROM PUBLIC; -- --- Name: FUNCTION st_geometryfromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linefrommultipoint(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geometryfromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linefrommultipoint(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_geometryfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linefromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geometryfromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linefromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_geometryn(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linefromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geometryn(public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linefromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_geometrytype(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linefromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geometrytype(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linefromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromewkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linefromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromewkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linefromwkb(bytea, integer) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromewkt(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_lineinterpolatepoint(text, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromewkt(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_lineinterpolatepoint(text, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromgeohash(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_lineinterpolatepoint(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromgeohash(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_lineinterpolatepoint(public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromgeojson(json); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_lineinterpolatepoint(public.geography, double precision, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromgeojson(json) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_lineinterpolatepoint(public.geography, double precision, use_spheroid boolean) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromgeojson(jsonb); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_lineinterpolatepoints(text, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromgeojson(jsonb) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_lineinterpolatepoints(text, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromgeojson(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_lineinterpolatepoints(public.geometry, double precision, repeat boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromgeojson(text) FROM PUBLIC; -GRANT ALL ON FUNCTION public.st_geomfromgeojson(text) TO maevsi_anonymous; -GRANT ALL ON FUNCTION public.st_geomfromgeojson(text) TO maevsi_account; +REVOKE ALL ON FUNCTION public.st_lineinterpolatepoints(public.geometry, double precision, repeat boolean) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromgml(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_lineinterpolatepoints(public.geography, double precision, use_spheroid boolean, repeat boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromgml(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_lineinterpolatepoints(public.geography, double precision, use_spheroid boolean, repeat boolean) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromgml(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linelocatepoint(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromgml(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linelocatepoint(text, text) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromkml(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linelocatepoint(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromkml(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linelocatepoint(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_geomfrommarc21(marc21xml text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linelocatepoint(public.geography, public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfrommarc21(marc21xml text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linelocatepoint(public.geography, public.geography, use_spheroid boolean) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linemerge(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linemerge(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linemerge(public.geometry, boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linemerge(public.geometry, boolean) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromtwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linestringfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromtwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linestringfromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linestringfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linestringfromwkb(bytea, integer) FROM PUBLIC; -- --- Name: FUNCTION st_geomfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linesubstring(text, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_geomfromwkb(bytea, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linesubstring(text, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_gmltosql(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linesubstring(public.geography, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_gmltosql(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linesubstring(public.geography, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_gmltosql(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linesubstring(public.geometry, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_gmltosql(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linesubstring(public.geometry, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_hasarc(geometry public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_linetocurve(geometry public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_hasarc(geometry public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_linetocurve(geometry public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_hasm(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_locatealong(geometry public.geometry, measure double precision, leftrightoffset double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_hasm(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_locatealong(geometry public.geometry, measure double precision, leftrightoffset double precision) FROM PUBLIC; -- --- Name: FUNCTION st_hasz(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_locatebetween(geometry public.geometry, frommeasure double precision, tomeasure double precision, leftrightoffset double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_hasz(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_locatebetween(geometry public.geometry, frommeasure double precision, tomeasure double precision, leftrightoffset double precision) FROM PUBLIC; -- --- Name: FUNCTION st_hausdorffdistance(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_locatebetweenelevations(geometry public.geometry, fromelevation double precision, toelevation double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_hausdorffdistance(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_locatebetweenelevations(geometry public.geometry, fromelevation double precision, toelevation double precision) FROM PUBLIC; -- --- Name: FUNCTION st_hausdorffdistance(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_longestline(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_hausdorffdistance(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_longestline(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_hexagon(size double precision, cell_i integer, cell_j integer, origin public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_m(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_hexagon(size double precision, cell_i integer, cell_j integer, origin public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_m(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_hexagongrid(size double precision, bounds public.geometry, OUT geom public.geometry, OUT i integer, OUT j integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_makebox2d(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_hexagongrid(size double precision, bounds public.geometry, OUT geom public.geometry, OUT i integer, OUT j integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_makebox2d(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_interiorringn(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_makeenvelope(double precision, double precision, double precision, double precision, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_interiorringn(public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_makeenvelope(double precision, double precision, double precision, double precision, integer) FROM PUBLIC; -- --- Name: FUNCTION st_interpolatepoint(line public.geometry, point public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_makeline(public.geometry[]); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_interpolatepoint(line public.geometry, point public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_makeline(public.geometry[]) FROM PUBLIC; -- --- Name: FUNCTION st_intersection(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_makeline(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_intersection(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_makeline(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_intersection(public.geography, public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_makepoint(double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_intersection(public.geography, public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_makepoint(double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_intersection(geom1 public.geometry, geom2 public.geometry, gridsize double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_makepoint(double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_intersection(geom1 public.geometry, geom2 public.geometry, gridsize double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_makepoint(double precision, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_intersects(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_makepoint(double precision, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_intersects(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_makepoint(double precision, double precision, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_intersects(geog1 public.geography, geog2 public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_makepointm(double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_intersects(geog1 public.geography, geog2 public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_makepointm(double precision, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_intersects(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_makepolygon(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_intersects(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_makepolygon(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_inversetransformpipeline(geom public.geometry, pipeline text, to_srid integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_makepolygon(public.geometry, public.geometry[]); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_inversetransformpipeline(geom public.geometry, pipeline text, to_srid integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_makepolygon(public.geometry, public.geometry[]) FROM PUBLIC; -- --- Name: FUNCTION st_isclosed(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_makevalid(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_isclosed(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_makevalid(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_iscollection(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_makevalid(geom public.geometry, params text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_iscollection(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_makevalid(geom public.geometry, params text) FROM PUBLIC; -- --- Name: FUNCTION st_isempty(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_maxdistance(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_isempty(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_maxdistance(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_ispolygonccw(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_maximuminscribedcircle(public.geometry, OUT center public.geometry, OUT nearest public.geometry, OUT radius double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_ispolygonccw(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_maximuminscribedcircle(public.geometry, OUT center public.geometry, OUT nearest public.geometry, OUT radius double precision) FROM PUBLIC; -- --- Name: FUNCTION st_ispolygoncw(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_memsize(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_ispolygoncw(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_memsize(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_isring(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_minimumboundingcircle(inputgeom public.geometry, segs_per_quarter integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_isring(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_minimumboundingcircle(inputgeom public.geometry, segs_per_quarter integer) FROM PUBLIC; -- --- Name: FUNCTION st_issimple(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_minimumboundingradius(public.geometry, OUT center public.geometry, OUT radius double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_issimple(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_minimumboundingradius(public.geometry, OUT center public.geometry, OUT radius double precision) FROM PUBLIC; -- --- Name: FUNCTION st_isvalid(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_minimumclearance(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_isvalid(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_minimumclearance(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_isvalid(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_minimumclearanceline(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_isvalid(public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_minimumclearanceline(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_isvaliddetail(geom public.geometry, flags integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_mlinefromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_isvaliddetail(geom public.geometry, flags integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_mlinefromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_isvalidreason(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_mlinefromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_isvalidreason(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_mlinefromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_isvalidreason(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_mlinefromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_isvalidreason(public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_mlinefromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_isvalidtrajectory(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_mlinefromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_isvalidtrajectory(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_mlinefromwkb(bytea, integer) FROM PUBLIC; -- --- Name: FUNCTION st_largestemptycircle(geom public.geometry, tolerance double precision, boundary public.geometry, OUT center public.geometry, OUT nearest public.geometry, OUT radius double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_mpointfromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_largestemptycircle(geom public.geometry, tolerance double precision, boundary public.geometry, OUT center public.geometry, OUT nearest public.geometry, OUT radius double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_mpointfromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_length(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_mpointfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_length(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_mpointfromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_length(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_mpointfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_length(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_mpointfromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_length(geog public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_mpointfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_length(geog public.geography, use_spheroid boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_mpointfromwkb(bytea, integer) FROM PUBLIC; -- --- Name: FUNCTION st_length2d(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_mpolyfromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_length2d(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_mpolyfromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_length2dspheroid(public.geometry, public.spheroid); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_mpolyfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_length2dspheroid(public.geometry, public.spheroid) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_mpolyfromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_lengthspheroid(public.geometry, public.spheroid); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_mpolyfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_lengthspheroid(public.geometry, public.spheroid) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_mpolyfromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_letters(letters text, font json); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_mpolyfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_letters(letters text, font json) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_mpolyfromwkb(bytea, integer) FROM PUBLIC; -- --- Name: FUNCTION st_linecrossingdirection(line1 public.geometry, line2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_multi(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linecrossingdirection(line1 public.geometry, line2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_multi(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_lineextend(geom public.geometry, distance_forward double precision, distance_backward double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_multilinefromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_lineextend(geom public.geometry, distance_forward double precision, distance_backward double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_multilinefromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_linefromencodedpolyline(txtin text, nprecision integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_multilinestringfromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linefromencodedpolyline(txtin text, nprecision integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_multilinestringfromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_linefrommultipoint(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_multilinestringfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linefrommultipoint(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_multilinestringfromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_linefromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_multipointfromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linefromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_multipointfromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_linefromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_multipointfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linefromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_multipointfromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_linefromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_multipointfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linefromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_multipointfromwkb(bytea, integer) FROM PUBLIC; -- --- Name: FUNCTION st_linefromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_multipolyfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linefromwkb(bytea, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_multipolyfromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_lineinterpolatepoint(text, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_multipolyfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_lineinterpolatepoint(text, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_multipolyfromwkb(bytea, integer) FROM PUBLIC; -- --- Name: FUNCTION st_lineinterpolatepoint(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_multipolygonfromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_lineinterpolatepoint(public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_multipolygonfromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_lineinterpolatepoint(public.geography, double precision, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_multipolygonfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_lineinterpolatepoint(public.geography, double precision, use_spheroid boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_multipolygonfromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_lineinterpolatepoints(text, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_ndims(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_lineinterpolatepoints(text, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_ndims(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_lineinterpolatepoints(public.geometry, double precision, repeat boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_node(g public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_lineinterpolatepoints(public.geometry, double precision, repeat boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_node(g public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_lineinterpolatepoints(public.geography, double precision, use_spheroid boolean, repeat boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_normalize(geom public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_lineinterpolatepoints(public.geography, double precision, use_spheroid boolean, repeat boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_normalize(geom public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_linelocatepoint(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_npoints(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linelocatepoint(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_npoints(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_linelocatepoint(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_nrings(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linelocatepoint(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_nrings(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_linelocatepoint(public.geography, public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_numcurves(geometry public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linelocatepoint(public.geography, public.geography, use_spheroid boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_numcurves(geometry public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_linemerge(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_numgeometries(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linemerge(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_numgeometries(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_linemerge(public.geometry, boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_numinteriorring(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linemerge(public.geometry, boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_numinteriorring(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_linestringfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_numinteriorrings(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linestringfromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_numinteriorrings(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_linestringfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_numpatches(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linestringfromwkb(bytea, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_numpatches(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_linesubstring(text, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_numpoints(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linesubstring(text, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_numpoints(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_linesubstring(public.geography, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_offsetcurve(line public.geometry, distance double precision, params text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linesubstring(public.geography, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_offsetcurve(line public.geometry, distance double precision, params text) FROM PUBLIC; -- --- Name: FUNCTION st_linesubstring(public.geometry, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_orderingequals(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linesubstring(public.geometry, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_orderingequals(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_linetocurve(geometry public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_orientedenvelope(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_linetocurve(geometry public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_orientedenvelope(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_locatealong(geometry public.geometry, measure double precision, leftrightoffset double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_overlaps(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_locatealong(geometry public.geometry, measure double precision, leftrightoffset double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_overlaps(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_locatebetween(geometry public.geometry, frommeasure double precision, tomeasure double precision, leftrightoffset double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_patchn(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_locatebetween(geometry public.geometry, frommeasure double precision, tomeasure double precision, leftrightoffset double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_patchn(public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION st_locatebetweenelevations(geometry public.geometry, fromelevation double precision, toelevation double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_perimeter(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_locatebetweenelevations(geometry public.geometry, fromelevation double precision, toelevation double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_perimeter(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_longestline(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_perimeter(geog public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_longestline(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_perimeter(geog public.geography, use_spheroid boolean) FROM PUBLIC; -- --- Name: FUNCTION st_m(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_perimeter2d(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_m(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_perimeter2d(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_makebox2d(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_point(double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_makebox2d(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_point(double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_makeenvelope(double precision, double precision, double precision, double precision, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_point(double precision, double precision, srid integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_makeenvelope(double precision, double precision, double precision, double precision, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_point(double precision, double precision, srid integer) FROM PUBLIC; -- --- Name: FUNCTION st_makeline(public.geometry[]); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_pointfromgeohash(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_makeline(public.geometry[]) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_pointfromgeohash(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_makeline(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_pointfromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_makeline(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_pointfromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_makepoint(double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_pointfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_makepoint(double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_pointfromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_makepoint(double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_pointfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_makepoint(double precision, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_pointfromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_makepoint(double precision, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_pointfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_makepoint(double precision, double precision, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_pointfromwkb(bytea, integer) FROM PUBLIC; -- --- Name: FUNCTION st_makepointm(double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_pointinsidecircle(public.geometry, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_makepointm(double precision, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_pointinsidecircle(public.geometry, double precision, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_makepolygon(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_pointm(xcoordinate double precision, ycoordinate double precision, mcoordinate double precision, srid integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_makepolygon(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_pointm(xcoordinate double precision, ycoordinate double precision, mcoordinate double precision, srid integer) FROM PUBLIC; -- --- Name: FUNCTION st_makepolygon(public.geometry, public.geometry[]); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_pointn(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_makepolygon(public.geometry, public.geometry[]) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_pointn(public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION st_makevalid(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_pointonsurface(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_makevalid(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_pointonsurface(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_makevalid(geom public.geometry, params text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_points(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_makevalid(geom public.geometry, params text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_points(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_maxdistance(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_pointz(xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, srid integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_maxdistance(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_pointz(xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, srid integer) FROM PUBLIC; -- --- Name: FUNCTION st_maximuminscribedcircle(public.geometry, OUT center public.geometry, OUT nearest public.geometry, OUT radius double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_pointzm(xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, mcoordinate double precision, srid integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_maximuminscribedcircle(public.geometry, OUT center public.geometry, OUT nearest public.geometry, OUT radius double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_pointzm(xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, mcoordinate double precision, srid integer) FROM PUBLIC; -- --- Name: FUNCTION st_memsize(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_polyfromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_memsize(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_polyfromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_minimumboundingcircle(inputgeom public.geometry, segs_per_quarter integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_polyfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_minimumboundingcircle(inputgeom public.geometry, segs_per_quarter integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_polyfromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_minimumboundingradius(public.geometry, OUT center public.geometry, OUT radius double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_polyfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_minimumboundingradius(public.geometry, OUT center public.geometry, OUT radius double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_polyfromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_minimumclearance(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_polyfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_minimumclearance(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_polyfromwkb(bytea, integer) FROM PUBLIC; -- --- Name: FUNCTION st_minimumclearanceline(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_polygon(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_minimumclearanceline(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_polygon(public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION st_mlinefromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_polygonfromtext(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_mlinefromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_polygonfromtext(text) FROM PUBLIC; -- --- Name: FUNCTION st_mlinefromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_polygonfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_mlinefromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_polygonfromtext(text, integer) FROM PUBLIC; -- --- Name: FUNCTION st_mlinefromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_polygonfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_mlinefromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_polygonfromwkb(bytea) FROM PUBLIC; -- --- Name: FUNCTION st_mlinefromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_polygonfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_mlinefromwkb(bytea, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_polygonfromwkb(bytea, integer) FROM PUBLIC; -- --- Name: FUNCTION st_mpointfromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_polygonize(public.geometry[]); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_mpointfromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_polygonize(public.geometry[]) FROM PUBLIC; -- --- Name: FUNCTION st_mpointfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_project(geog public.geography, distance double precision, azimuth double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_mpointfromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_project(geog public.geography, distance double precision, azimuth double precision) FROM PUBLIC; -- --- Name: FUNCTION st_mpointfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_project(geog_from public.geography, geog_to public.geography, distance double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_mpointfromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_project(geog_from public.geography, geog_to public.geography, distance double precision) FROM PUBLIC; -- --- Name: FUNCTION st_mpointfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_project(geom1 public.geometry, distance double precision, azimuth double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_mpointfromwkb(bytea, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_project(geom1 public.geometry, distance double precision, azimuth double precision) FROM PUBLIC; -- --- Name: FUNCTION st_mpolyfromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_project(geom1 public.geometry, geom2 public.geometry, distance double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_mpolyfromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_project(geom1 public.geometry, geom2 public.geometry, distance double precision) FROM PUBLIC; -- --- Name: FUNCTION st_mpolyfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_quantizecoordinates(g public.geometry, prec_x integer, prec_y integer, prec_z integer, prec_m integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_mpolyfromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_quantizecoordinates(g public.geometry, prec_x integer, prec_y integer, prec_z integer, prec_m integer) FROM PUBLIC; -- --- Name: FUNCTION st_mpolyfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_reduceprecision(geom public.geometry, gridsize double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_mpolyfromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_reduceprecision(geom public.geometry, gridsize double precision) FROM PUBLIC; -- --- Name: FUNCTION st_mpolyfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_relate(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_mpolyfromwkb(bytea, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_relate(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_multi(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_relate(geom1 public.geometry, geom2 public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_multi(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_relate(geom1 public.geometry, geom2 public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION st_multilinefromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_relate(geom1 public.geometry, geom2 public.geometry, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_multilinefromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_relate(geom1 public.geometry, geom2 public.geometry, text) FROM PUBLIC; -- --- Name: FUNCTION st_multilinestringfromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_relatematch(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_multilinestringfromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_relatematch(text, text) FROM PUBLIC; -- --- Name: FUNCTION st_multilinestringfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_removeirrelevantpointsforview(public.geometry, public.box2d, boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_multilinestringfromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_removeirrelevantpointsforview(public.geometry, public.box2d, boolean) FROM PUBLIC; -- --- Name: FUNCTION st_multipointfromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_removepoint(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_multipointfromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_removepoint(public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION st_multipointfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_removerepeatedpoints(geom public.geometry, tolerance double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_multipointfromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_removerepeatedpoints(geom public.geometry, tolerance double precision) FROM PUBLIC; -- --- Name: FUNCTION st_multipointfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_removesmallparts(public.geometry, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_multipointfromwkb(bytea, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_removesmallparts(public.geometry, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_multipolyfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_reverse(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_multipolyfromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_reverse(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_multipolyfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_rotate(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_multipolyfromwkb(bytea, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_rotate(public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_multipolygonfromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_rotate(public.geometry, double precision, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_multipolygonfromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_rotate(public.geometry, double precision, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_multipolygonfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_rotate(public.geometry, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_multipolygonfromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_rotate(public.geometry, double precision, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_ndims(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_rotatex(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_ndims(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_rotatex(public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_node(g public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_rotatey(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_node(g public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_rotatey(public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_normalize(geom public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_rotatez(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_normalize(geom public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_rotatez(public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_npoints(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_scale(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_npoints(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_scale(public.geometry, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_nrings(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_scale(public.geometry, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_nrings(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_scale(public.geometry, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_numcurves(geometry public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_scale(public.geometry, public.geometry, origin public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_numcurves(geometry public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_scale(public.geometry, public.geometry, origin public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_numgeometries(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_scale(public.geometry, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_numgeometries(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_scale(public.geometry, double precision, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_numinteriorring(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_scroll(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_numinteriorring(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_scroll(public.geometry, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_numinteriorrings(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_segmentize(geog public.geography, max_segment_length double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_numinteriorrings(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_segmentize(geog public.geography, max_segment_length double precision) FROM PUBLIC; -- --- Name: FUNCTION st_numpatches(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_segmentize(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_numpatches(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_segmentize(public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_numpoints(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_seteffectivearea(public.geometry, double precision, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_numpoints(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_seteffectivearea(public.geometry, double precision, integer) FROM PUBLIC; -- --- Name: FUNCTION st_offsetcurve(line public.geometry, distance double precision, params text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_setpoint(public.geometry, integer, public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_offsetcurve(line public.geometry, distance double precision, params text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_setpoint(public.geometry, integer, public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_orderingequals(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_setsrid(geog public.geography, srid integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_orderingequals(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_setsrid(geog public.geography, srid integer) FROM PUBLIC; -- --- Name: FUNCTION st_orientedenvelope(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_setsrid(geom public.geometry, srid integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_orientedenvelope(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_setsrid(geom public.geometry, srid integer) FROM PUBLIC; -- --- Name: FUNCTION st_overlaps(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_sharedpaths(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_overlaps(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_sharedpaths(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_patchn(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_shiftlongitude(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_patchn(public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_shiftlongitude(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_perimeter(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_shortestline(text, text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_perimeter(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_shortestline(text, text) FROM PUBLIC; -- --- Name: FUNCTION st_perimeter(geog public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_shortestline(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_perimeter(geog public.geography, use_spheroid boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_shortestline(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_perimeter2d(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_shortestline(public.geography, public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_perimeter2d(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_shortestline(public.geography, public.geography, use_spheroid boolean) FROM PUBLIC; -- --- Name: FUNCTION st_point(double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_simplify(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_point(double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_simplify(public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_point(double precision, double precision, srid integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_simplify(public.geometry, double precision, boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_point(double precision, double precision, srid integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_simplify(public.geometry, double precision, boolean) FROM PUBLIC; -- --- Name: FUNCTION st_pointfromgeohash(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_simplifypolygonhull(geom public.geometry, vertex_fraction double precision, is_outer boolean); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_pointfromgeohash(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_simplifypolygonhull(geom public.geometry, vertex_fraction double precision, is_outer boolean) FROM PUBLIC; -- --- Name: FUNCTION st_pointfromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_simplifypreservetopology(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_pointfromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_simplifypreservetopology(public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_pointfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_simplifyvw(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_pointfromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_simplifyvw(public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_pointfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_snap(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_pointfromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_snap(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_pointfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_snaptogrid(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_pointfromwkb(bytea, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_snaptogrid(public.geometry, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_pointinsidecircle(public.geometry, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_snaptogrid(public.geometry, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_pointinsidecircle(public.geometry, double precision, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_snaptogrid(public.geometry, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_pointm(xcoordinate double precision, ycoordinate double precision, mcoordinate double precision, srid integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_snaptogrid(public.geometry, double precision, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_pointm(xcoordinate double precision, ycoordinate double precision, mcoordinate double precision, srid integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_snaptogrid(public.geometry, double precision, double precision, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_pointn(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_snaptogrid(geom1 public.geometry, geom2 public.geometry, double precision, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_pointn(public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_snaptogrid(geom1 public.geometry, geom2 public.geometry, double precision, double precision, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_pointonsurface(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_split(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_pointonsurface(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_split(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_points(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_square(size double precision, cell_i integer, cell_j integer, origin public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_points(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_square(size double precision, cell_i integer, cell_j integer, origin public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_pointz(xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, srid integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_squaregrid(size double precision, bounds public.geometry, OUT geom public.geometry, OUT i integer, OUT j integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_pointz(xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, srid integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_squaregrid(size double precision, bounds public.geometry, OUT geom public.geometry, OUT i integer, OUT j integer) FROM PUBLIC; -- --- Name: FUNCTION st_pointzm(xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, mcoordinate double precision, srid integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_srid(geog public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_pointzm(xcoordinate double precision, ycoordinate double precision, zcoordinate double precision, mcoordinate double precision, srid integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_srid(geog public.geography) FROM PUBLIC; +GRANT ALL ON FUNCTION public.st_srid(geog public.geography) TO vibetype_anonymous; +GRANT ALL ON FUNCTION public.st_srid(geog public.geography) TO vibetype_account; -- --- Name: FUNCTION st_polyfromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_srid(geom public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_polyfromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_srid(geom public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_polyfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_startpoint(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_polyfromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_startpoint(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_polyfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_subdivide(geom public.geometry, maxvertices integer, gridsize double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_polyfromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_subdivide(geom public.geometry, maxvertices integer, gridsize double precision) FROM PUBLIC; -- --- Name: FUNCTION st_polyfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_summary(public.geography); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_polyfromwkb(bytea, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_summary(public.geography) FROM PUBLIC; -- --- Name: FUNCTION st_polygon(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_summary(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_polygon(public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_summary(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_polygonfromtext(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_swapordinates(geom public.geometry, ords cstring); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_polygonfromtext(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_swapordinates(geom public.geometry, ords cstring) FROM PUBLIC; -- --- Name: FUNCTION st_polygonfromtext(text, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_symdifference(geom1 public.geometry, geom2 public.geometry, gridsize double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_polygonfromtext(text, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_symdifference(geom1 public.geometry, geom2 public.geometry, gridsize double precision) FROM PUBLIC; -- --- Name: FUNCTION st_polygonfromwkb(bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_symmetricdifference(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_polygonfromwkb(bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_symmetricdifference(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_polygonfromwkb(bytea, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_tileenvelope(zoom integer, x integer, y integer, bounds public.geometry, margin double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_polygonfromwkb(bytea, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_tileenvelope(zoom integer, x integer, y integer, bounds public.geometry, margin double precision) FROM PUBLIC; -- --- Name: FUNCTION st_polygonize(public.geometry[]); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_touches(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_polygonize(public.geometry[]) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_touches(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_project(geog public.geography, distance double precision, azimuth double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_transform(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_project(geog public.geography, distance double precision, azimuth double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_transform(public.geometry, integer) FROM PUBLIC; -- --- Name: FUNCTION st_project(geog_from public.geography, geog_to public.geography, distance double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_transform(geom public.geometry, to_proj text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_project(geog_from public.geography, geog_to public.geography, distance double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_transform(geom public.geometry, to_proj text) FROM PUBLIC; -- --- Name: FUNCTION st_project(geom1 public.geometry, distance double precision, azimuth double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_transform(geom public.geometry, from_proj text, to_srid integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_project(geom1 public.geometry, distance double precision, azimuth double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_transform(geom public.geometry, from_proj text, to_srid integer) FROM PUBLIC; -- --- Name: FUNCTION st_project(geom1 public.geometry, geom2 public.geometry, distance double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_transform(geom public.geometry, from_proj text, to_proj text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_project(geom1 public.geometry, geom2 public.geometry, distance double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_transform(geom public.geometry, from_proj text, to_proj text) FROM PUBLIC; -- --- Name: FUNCTION st_quantizecoordinates(g public.geometry, prec_x integer, prec_y integer, prec_z integer, prec_m integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_transformpipeline(geom public.geometry, pipeline text, to_srid integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_quantizecoordinates(g public.geometry, prec_x integer, prec_y integer, prec_z integer, prec_m integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_transformpipeline(geom public.geometry, pipeline text, to_srid integer) FROM PUBLIC; -- --- Name: FUNCTION st_reduceprecision(geom public.geometry, gridsize double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_translate(public.geometry, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_reduceprecision(geom public.geometry, gridsize double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_translate(public.geometry, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_relate(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_translate(public.geometry, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_relate(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_translate(public.geometry, double precision, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_relate(geom1 public.geometry, geom2 public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_transscale(public.geometry, double precision, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_relate(geom1 public.geometry, geom2 public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_transscale(public.geometry, double precision, double precision, double precision, double precision) FROM PUBLIC; -- --- Name: FUNCTION st_relate(geom1 public.geometry, geom2 public.geometry, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_triangulatepolygon(g1 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_relate(geom1 public.geometry, geom2 public.geometry, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_triangulatepolygon(g1 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_relatematch(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_unaryunion(public.geometry, gridsize double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_relatematch(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_unaryunion(public.geometry, gridsize double precision) FROM PUBLIC; -- --- Name: FUNCTION st_removeirrelevantpointsforview(public.geometry, public.box2d, boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_union(public.geometry[]); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_removeirrelevantpointsforview(public.geometry, public.box2d, boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_union(public.geometry[]) FROM PUBLIC; -- --- Name: FUNCTION st_removepoint(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_union(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_removepoint(public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_union(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_removerepeatedpoints(geom public.geometry, tolerance double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_union(geom1 public.geometry, geom2 public.geometry, gridsize double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_removerepeatedpoints(geom public.geometry, tolerance double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_union(geom1 public.geometry, geom2 public.geometry, gridsize double precision) FROM PUBLIC; -- --- Name: FUNCTION st_removesmallparts(public.geometry, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_voronoilines(g1 public.geometry, tolerance double precision, extend_to public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_removesmallparts(public.geometry, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_voronoilines(g1 public.geometry, tolerance double precision, extend_to public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_reverse(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_voronoipolygons(g1 public.geometry, tolerance double precision, extend_to public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_reverse(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_voronoipolygons(g1 public.geometry, tolerance double precision, extend_to public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_rotate(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_within(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_rotate(public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_within(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_rotate(public.geometry, double precision, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_wkbtosql(wkb bytea); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_rotate(public.geometry, double precision, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_wkbtosql(wkb bytea) FROM PUBLIC; -- --- Name: FUNCTION st_rotate(public.geometry, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_wkttosql(text); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_rotate(public.geometry, double precision, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_wkttosql(text) FROM PUBLIC; -- --- Name: FUNCTION st_rotatex(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_wrapx(geom public.geometry, wrap double precision, move double precision); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_rotatex(public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_wrapx(geom public.geometry, wrap double precision, move double precision) FROM PUBLIC; -- --- Name: FUNCTION st_rotatey(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_x(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_rotatey(public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_x(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_rotatez(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_xmax(public.box3d); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_rotatez(public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_xmax(public.box3d) FROM PUBLIC; -- --- Name: FUNCTION st_scale(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_xmin(public.box3d); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_scale(public.geometry, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_xmin(public.box3d) FROM PUBLIC; -- --- Name: FUNCTION st_scale(public.geometry, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_y(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_scale(public.geometry, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_y(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_scale(public.geometry, public.geometry, origin public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_ymax(public.box3d); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_scale(public.geometry, public.geometry, origin public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_ymax(public.box3d) FROM PUBLIC; -- --- Name: FUNCTION st_scale(public.geometry, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_ymin(public.box3d); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_scale(public.geometry, double precision, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_ymin(public.box3d) FROM PUBLIC; -- --- Name: FUNCTION st_scroll(public.geometry, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_z(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_scroll(public.geometry, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_z(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_segmentize(geog public.geography, max_segment_length double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_zmax(public.box3d); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_segmentize(geog public.geography, max_segment_length double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_zmax(public.box3d) FROM PUBLIC; -- --- Name: FUNCTION st_segmentize(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_zmflag(public.geometry); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_segmentize(public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_zmflag(public.geometry) FROM PUBLIC; -- --- Name: FUNCTION st_seteffectivearea(public.geometry, double precision, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION st_zmin(public.box3d); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_seteffectivearea(public.geometry, double precision, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.st_zmin(public.box3d) FROM PUBLIC; -- --- Name: FUNCTION st_setpoint(public.geometry, integer, public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION updategeometrysrid(character varying, character varying, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_setpoint(public.geometry, integer, public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.updategeometrysrid(character varying, character varying, integer) FROM PUBLIC; -- --- Name: FUNCTION st_setsrid(geog public.geography, srid integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION updategeometrysrid(character varying, character varying, character varying, integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_setsrid(geog public.geography, srid integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.updategeometrysrid(character varying, character varying, character varying, integer) FROM PUBLIC; -- --- Name: FUNCTION st_setsrid(geom public.geometry, srid integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION updategeometrysrid(catalogn_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer); Type: ACL; Schema: public; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_setsrid(geom public.geometry, srid integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION public.updategeometrysrid(catalogn_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer) FROM PUBLIC; -- --- Name: FUNCTION st_sharedpaths(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_delete(password text); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_sharedpaths(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.account_delete(password text) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.account_delete(password text) TO vibetype_account; -- --- Name: FUNCTION st_shiftlongitude(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_email_address_verification(code uuid); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_shiftlongitude(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.account_email_address_verification(code uuid) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.account_email_address_verification(code uuid) TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.account_email_address_verification(code uuid) TO vibetype_anonymous; -- --- Name: FUNCTION st_shortestline(text, text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_password_change(password_current text, password_new text); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_shortestline(text, text) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.account_password_change(password_current text, password_new text) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.account_password_change(password_current text, password_new text) TO vibetype_account; -- --- Name: FUNCTION st_shortestline(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_password_reset(code uuid, password text); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_shortestline(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.account_password_reset(code uuid, password text) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.account_password_reset(code uuid, password text) TO vibetype_anonymous; +GRANT ALL ON FUNCTION vibetype.account_password_reset(code uuid, password text) TO vibetype_account; -- --- Name: FUNCTION st_shortestline(public.geography, public.geography, use_spheroid boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_password_reset_request(email_address text, language text); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_shortestline(public.geography, public.geography, use_spheroid boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.account_password_reset_request(email_address text, language text) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.account_password_reset_request(email_address text, language text) TO vibetype_anonymous; +GRANT ALL ON FUNCTION vibetype.account_password_reset_request(email_address text, language text) TO vibetype_account; -- --- Name: FUNCTION st_simplify(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_registration(username text, email_address text, password text, language text); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_simplify(public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.account_registration(username text, email_address text, password text, language text) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.account_registration(username text, email_address text, password text, language text) TO vibetype_anonymous; +GRANT ALL ON FUNCTION vibetype.account_registration(username text, email_address text, password text, language text) TO vibetype_account; -- --- Name: FUNCTION st_simplify(public.geometry, double precision, boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_registration_refresh(account_id uuid, language text); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_simplify(public.geometry, double precision, boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.account_registration_refresh(account_id uuid, language text) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.account_registration_refresh(account_id uuid, language text) TO vibetype_anonymous; -- --- Name: FUNCTION st_simplifypolygonhull(geom public.geometry, vertex_fraction double precision, is_outer boolean); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_upload_quota_bytes(); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_simplifypolygonhull(geom public.geometry, vertex_fraction double precision, is_outer boolean) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.account_upload_quota_bytes() FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.account_upload_quota_bytes() TO vibetype_account; -- --- Name: FUNCTION st_simplifypreservetopology(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION achievement_unlock(code uuid, alias text); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_simplifypreservetopology(public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.achievement_unlock(code uuid, alias text) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.achievement_unlock(code uuid, alias text) TO vibetype_account; -- --- Name: FUNCTION st_simplifyvw(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION authenticate(username text, password text); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_simplifyvw(public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.authenticate(username text, password text) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.authenticate(username text, password text) TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.authenticate(username text, password text) TO vibetype_anonymous; -- --- Name: FUNCTION st_snap(geom1 public.geometry, geom2 public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: TABLE event; Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_snap(geom1 public.geometry, geom2 public.geometry, double precision) FROM PUBLIC; +GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE vibetype.event TO vibetype_account; +GRANT SELECT ON TABLE vibetype.event TO vibetype_anonymous; -- --- Name: FUNCTION st_snaptogrid(public.geometry, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION event_delete(id uuid, password text); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_snaptogrid(public.geometry, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.event_delete(id uuid, password text) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.event_delete(id uuid, password text) TO vibetype_account; -- --- Name: FUNCTION st_snaptogrid(public.geometry, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION event_guest_count_maximum(event_id uuid); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_snaptogrid(public.geometry, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.event_guest_count_maximum(event_id uuid) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.event_guest_count_maximum(event_id uuid) TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.event_guest_count_maximum(event_id uuid) TO vibetype_anonymous; -- --- Name: FUNCTION st_snaptogrid(public.geometry, double precision, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION event_is_existing(created_by uuid, slug text); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_snaptogrid(public.geometry, double precision, double precision, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.event_is_existing(created_by uuid, slug text) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.event_is_existing(created_by uuid, slug text) TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.event_is_existing(created_by uuid, slug text) TO vibetype_anonymous; -- --- Name: FUNCTION st_snaptogrid(geom1 public.geometry, geom2 public.geometry, double precision, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION event_search(query text, language vibetype.language); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_snaptogrid(geom1 public.geometry, geom2 public.geometry, double precision, double precision, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.event_search(query text, language vibetype.language) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.event_search(query text, language vibetype.language) TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.event_search(query text, language vibetype.language) TO vibetype_anonymous; -- --- Name: FUNCTION st_split(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION event_unlock(guest_id uuid); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_split(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.event_unlock(guest_id uuid) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.event_unlock(guest_id uuid) TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.event_unlock(guest_id uuid) TO vibetype_anonymous; -- --- Name: FUNCTION st_square(size double precision, cell_i integer, cell_j integer, origin public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION events_organized(); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_square(size double precision, cell_i integer, cell_j integer, origin public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.events_organized() FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.events_organized() TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.events_organized() TO vibetype_anonymous; -- --- Name: FUNCTION st_squaregrid(size double precision, bounds public.geometry, OUT geom public.geometry, OUT i integer, OUT j integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION guest_claim_array(); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_squaregrid(size double precision, bounds public.geometry, OUT geom public.geometry, OUT i integer, OUT j integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.guest_claim_array() FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.guest_claim_array() TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.guest_claim_array() TO vibetype_anonymous; -- --- Name: FUNCTION st_srid(geog public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION guest_contact_ids(); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_srid(geog public.geography) FROM PUBLIC; -GRANT ALL ON FUNCTION public.st_srid(geog public.geography) TO maevsi_anonymous; -GRANT ALL ON FUNCTION public.st_srid(geog public.geography) TO maevsi_account; +REVOKE ALL ON FUNCTION vibetype.guest_contact_ids() FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.guest_contact_ids() TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.guest_contact_ids() TO vibetype_anonymous; -- --- Name: FUNCTION st_srid(geom public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION guest_count(event_id uuid); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_srid(geom public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.guest_count(event_id uuid) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.guest_count(event_id uuid) TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.guest_count(event_id uuid) TO vibetype_anonymous; -- --- Name: FUNCTION st_startpoint(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION invite(guest_id uuid, language text); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_startpoint(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.invite(guest_id uuid, language text) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.invite(guest_id uuid, language text) TO vibetype_account; -- --- Name: FUNCTION st_subdivide(geom public.geometry, maxvertices integer, gridsize double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION invoker_account_id(); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_subdivide(geom public.geometry, maxvertices integer, gridsize double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.invoker_account_id() FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.invoker_account_id() TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.invoker_account_id() TO vibetype_anonymous; +GRANT ALL ON FUNCTION vibetype.invoker_account_id() TO vibetype_tusd; -- --- Name: FUNCTION st_summary(public.geography); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION jwt_refresh(jwt_id uuid); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_summary(public.geography) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.jwt_refresh(jwt_id uuid) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.jwt_refresh(jwt_id uuid) TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.jwt_refresh(jwt_id uuid) TO vibetype_anonymous; -- --- Name: FUNCTION st_summary(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION language_iso_full_text_search(language vibetype.language); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_summary(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.language_iso_full_text_search(language vibetype.language) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.language_iso_full_text_search(language vibetype.language) TO vibetype_anonymous; +GRANT ALL ON FUNCTION vibetype.language_iso_full_text_search(language vibetype.language) TO vibetype_account; -- --- Name: FUNCTION st_swapordinates(geom public.geometry, ords cstring); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION legal_term_change(); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_swapordinates(geom public.geometry, ords cstring) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.legal_term_change() FROM PUBLIC; -- --- Name: FUNCTION st_symdifference(geom1 public.geometry, geom2 public.geometry, gridsize double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION notification_acknowledge(id uuid, is_acknowledged boolean); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_symdifference(geom1 public.geometry, geom2 public.geometry, gridsize double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.notification_acknowledge(id uuid, is_acknowledged boolean) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.notification_acknowledge(id uuid, is_acknowledged boolean) TO vibetype_anonymous; -- --- Name: FUNCTION st_symmetricdifference(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION profile_picture_set(upload_id uuid); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_symmetricdifference(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.profile_picture_set(upload_id uuid) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.profile_picture_set(upload_id uuid) TO vibetype_account; -- --- Name: FUNCTION st_tileenvelope(zoom integer, x integer, y integer, bounds public.geometry, margin double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION trigger_contact_update_account_id(); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_tileenvelope(zoom integer, x integer, y integer, bounds public.geometry, margin double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.trigger_contact_update_account_id() FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.trigger_contact_update_account_id() TO vibetype_account; -- --- Name: FUNCTION st_touches(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION trigger_event_search_vector(); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_touches(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.trigger_event_search_vector() FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.trigger_event_search_vector() TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.trigger_event_search_vector() TO vibetype_anonymous; -- --- Name: FUNCTION st_transform(public.geometry, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION trigger_guest_update(); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_transform(public.geometry, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.trigger_guest_update() FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.trigger_guest_update() TO vibetype_account; +GRANT ALL ON FUNCTION vibetype.trigger_guest_update() TO vibetype_anonymous; -- --- Name: FUNCTION st_transform(geom public.geometry, to_proj text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION trigger_metadata_update(); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_transform(geom public.geometry, to_proj text) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.trigger_metadata_update() FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.trigger_metadata_update() TO vibetype_account; -- --- Name: FUNCTION st_transform(geom public.geometry, from_proj text, to_srid integer); Type: ACL; Schema: public; Owner: postgres +-- Name: TABLE upload; Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_transform(geom public.geometry, from_proj text, to_srid integer) FROM PUBLIC; +GRANT SELECT ON TABLE vibetype.upload TO vibetype_account; +GRANT SELECT ON TABLE vibetype.upload TO vibetype_anonymous; +GRANT SELECT,DELETE,UPDATE ON TABLE vibetype.upload TO vibetype_tusd; -- --- Name: FUNCTION st_transform(geom public.geometry, from_proj text, to_proj text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION upload_create(size_byte bigint); Type: ACL; Schema: vibetype; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_transform(geom public.geometry, from_proj text, to_proj text) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype.upload_create(size_byte bigint) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype.upload_create(size_byte bigint) TO vibetype_account; -- --- Name: FUNCTION st_transformpipeline(geom public.geometry, pipeline text, to_srid integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_block_ids(); Type: ACL; Schema: vibetype_private; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_transformpipeline(geom public.geometry, pipeline text, to_srid integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_private.account_block_ids() FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype_private.account_block_ids() TO vibetype_account; +GRANT ALL ON FUNCTION vibetype_private.account_block_ids() TO vibetype_anonymous; -- --- Name: FUNCTION st_translate(public.geometry, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_email_address_verification_valid_until(); Type: ACL; Schema: vibetype_private; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_translate(public.geometry, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_private.account_email_address_verification_valid_until() FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype_private.account_email_address_verification_valid_until() TO vibetype_account; -- --- Name: FUNCTION st_translate(public.geometry, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_password_reset_verification_valid_until(); Type: ACL; Schema: vibetype_private; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_translate(public.geometry, double precision, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_private.account_password_reset_verification_valid_until() FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype_private.account_password_reset_verification_valid_until() TO vibetype_account; -- --- Name: FUNCTION st_transscale(public.geometry, double precision, double precision, double precision, double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION events_invited(); Type: ACL; Schema: vibetype_private; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_transscale(public.geometry, double precision, double precision, double precision, double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_private.events_invited() FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype_private.events_invited() TO vibetype_account; +GRANT ALL ON FUNCTION vibetype_private.events_invited() TO vibetype_anonymous; -- --- Name: FUNCTION st_triangulatepolygon(g1 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_block_create(_created_by uuid, _blocked_account_id uuid); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_triangulatepolygon(g1 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.account_block_create(_created_by uuid, _blocked_account_id uuid) FROM PUBLIC; -- --- Name: FUNCTION st_unaryunion(public.geometry, gridsize double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_block_remove(_created_by uuid, _blocked_account_id uuid); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_unaryunion(public.geometry, gridsize double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.account_block_remove(_created_by uuid, _blocked_account_id uuid) FROM PUBLIC; -- --- Name: FUNCTION st_union(public.geometry[]); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_create(_username text, _email text); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_union(public.geometry[]) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.account_create(_username text, _email text) FROM PUBLIC; -- --- Name: FUNCTION st_union(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_filter_radius_event(_event_id uuid, _distance_max double precision); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_union(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.account_filter_radius_event(_event_id uuid, _distance_max double precision) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype_test.account_filter_radius_event(_event_id uuid, _distance_max double precision) TO vibetype_account; -- --- Name: FUNCTION st_union(geom1 public.geometry, geom2 public.geometry, gridsize double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_location_coordinates(_account_id uuid); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_union(geom1 public.geometry, geom2 public.geometry, gridsize double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.account_location_coordinates(_account_id uuid) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype_test.account_location_coordinates(_account_id uuid) TO vibetype_account; -- --- Name: FUNCTION st_voronoilines(g1 public.geometry, tolerance double precision, extend_to public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_location_update(_account_id uuid, _latitude double precision, _longitude double precision); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_voronoilines(g1 public.geometry, tolerance double precision, extend_to public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.account_location_update(_account_id uuid, _latitude double precision, _longitude double precision) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype_test.account_location_update(_account_id uuid, _latitude double precision, _longitude double precision) TO vibetype_account; -- --- Name: FUNCTION st_voronoipolygons(g1 public.geometry, tolerance double precision, extend_to public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION account_remove(_username text); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_voronoipolygons(g1 public.geometry, tolerance double precision, extend_to public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.account_remove(_username text) FROM PUBLIC; -- --- Name: FUNCTION st_within(geom1 public.geometry, geom2 public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION contact_create(_created_by uuid, _email_address text); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_within(geom1 public.geometry, geom2 public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.contact_create(_created_by uuid, _email_address text) FROM PUBLIC; -- --- Name: FUNCTION st_wkbtosql(wkb bytea); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION contact_select_by_account_id(_account_id uuid); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_wkbtosql(wkb bytea) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.contact_select_by_account_id(_account_id uuid) FROM PUBLIC; -- --- Name: FUNCTION st_wkttosql(text); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION contact_test(_test_case text, _account_id uuid, _expected_result uuid[]); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_wkttosql(text) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.contact_test(_test_case text, _account_id uuid, _expected_result uuid[]) FROM PUBLIC; -- --- Name: FUNCTION st_wrapx(geom public.geometry, wrap double precision, move double precision); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION event_category_create(_category text); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_wrapx(geom public.geometry, wrap double precision, move double precision) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.event_category_create(_category text) FROM PUBLIC; -- --- Name: FUNCTION st_x(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION event_category_mapping_create(_created_by uuid, _event_id uuid, _category text); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_x(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.event_category_mapping_create(_created_by uuid, _event_id uuid, _category text) FROM PUBLIC; -- --- Name: FUNCTION st_xmax(public.box3d); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION event_category_mapping_test(_test_case text, _account_id uuid, _expected_result uuid[]); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_xmax(public.box3d) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.event_category_mapping_test(_test_case text, _account_id uuid, _expected_result uuid[]) FROM PUBLIC; -- --- Name: FUNCTION st_xmin(public.box3d); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION event_create(_created_by uuid, _name text, _slug text, _start text, _visibility text); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_xmin(public.box3d) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.event_create(_created_by uuid, _name text, _slug text, _start text, _visibility text) FROM PUBLIC; -- --- Name: FUNCTION st_y(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION event_filter_radius_account(_account_id uuid, _distance_max double precision); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_y(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.event_filter_radius_account(_account_id uuid, _distance_max double precision) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype_test.event_filter_radius_account(_account_id uuid, _distance_max double precision) TO vibetype_account; -- --- Name: FUNCTION st_ymax(public.box3d); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION event_location_coordinates(_event_id uuid); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_ymax(public.box3d) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.event_location_coordinates(_event_id uuid) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype_test.event_location_coordinates(_event_id uuid) TO vibetype_account; -- --- Name: FUNCTION st_ymin(public.box3d); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION event_location_update(_event_id uuid, _latitude double precision, _longitude double precision); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_ymin(public.box3d) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.event_location_update(_event_id uuid, _latitude double precision, _longitude double precision) FROM PUBLIC; +GRANT ALL ON FUNCTION vibetype_test.event_location_update(_event_id uuid, _latitude double precision, _longitude double precision) TO vibetype_account; -- --- Name: FUNCTION st_z(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION event_test(_test_case text, _account_id uuid, _expected_result uuid[]); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_z(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.event_test(_test_case text, _account_id uuid, _expected_result uuid[]) FROM PUBLIC; -- --- Name: FUNCTION st_zmax(public.box3d); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION guest_claim_from_account_guest(_account_id uuid); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_zmax(public.box3d) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.guest_claim_from_account_guest(_account_id uuid) FROM PUBLIC; -- --- Name: FUNCTION st_zmflag(public.geometry); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION guest_create(_created_by uuid, _event_id uuid, _contact_id uuid); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_zmflag(public.geometry) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.guest_create(_created_by uuid, _event_id uuid, _contact_id uuid) FROM PUBLIC; -- --- Name: FUNCTION st_zmin(public.box3d); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION guest_test(_test_case text, _account_id uuid, _expected_result uuid[]); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.st_zmin(public.box3d) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.guest_test(_test_case text, _account_id uuid, _expected_result uuid[]) FROM PUBLIC; -- --- Name: FUNCTION updategeometrysrid(character varying, character varying, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION invoker_set(_invoker_id uuid); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.updategeometrysrid(character varying, character varying, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.invoker_set(_invoker_id uuid) FROM PUBLIC; -- --- Name: FUNCTION updategeometrysrid(character varying, character varying, character varying, integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION invoker_unset(); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.updategeometrysrid(character varying, character varying, character varying, integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.invoker_unset() FROM PUBLIC; -- --- Name: FUNCTION updategeometrysrid(catalogn_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer); Type: ACL; Schema: public; Owner: postgres +-- Name: FUNCTION uuid_array_test(_test_case text, _array uuid[], _expected_array uuid[]); Type: ACL; Schema: vibetype_test; Owner: postgres -- -REVOKE ALL ON FUNCTION public.updategeometrysrid(catalogn_name character varying, schema_name character varying, table_name character varying, column_name character varying, new_srid_in integer) FROM PUBLIC; +REVOKE ALL ON FUNCTION vibetype_test.uuid_array_test(_test_case text, _array uuid[], _expected_array uuid[]) FROM PUBLIC; -- @@ -12410,180 +12410,180 @@ REVOKE ALL ON FUNCTION public.st_union(public.geometry, double precision) FROM P -- --- Name: TABLE account; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE account; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT ON TABLE maevsi.account TO maevsi_account; -GRANT SELECT ON TABLE maevsi.account TO maevsi_anonymous; +GRANT SELECT ON TABLE vibetype.account TO vibetype_account; +GRANT SELECT ON TABLE vibetype.account TO vibetype_anonymous; -- --- Name: TABLE account_block; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE account_block; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT ON TABLE maevsi.account_block TO maevsi_account; -GRANT SELECT ON TABLE maevsi.account_block TO maevsi_anonymous; +GRANT SELECT,INSERT ON TABLE vibetype.account_block TO vibetype_account; +GRANT SELECT ON TABLE vibetype.account_block TO vibetype_anonymous; -- --- Name: TABLE account_interest; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE account_interest; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT,DELETE ON TABLE maevsi.account_interest TO maevsi_account; +GRANT SELECT,INSERT,DELETE ON TABLE vibetype.account_interest TO vibetype_account; -- --- Name: TABLE account_preference_event_size; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE account_preference_event_size; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT,DELETE ON TABLE maevsi.account_preference_event_size TO maevsi_account; +GRANT SELECT,INSERT,DELETE ON TABLE vibetype.account_preference_event_size TO vibetype_account; -- --- Name: TABLE account_social_network; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE account_social_network; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT ON TABLE maevsi.account_social_network TO maevsi_anonymous; -GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE maevsi.account_social_network TO maevsi_account; +GRANT SELECT ON TABLE vibetype.account_social_network TO vibetype_anonymous; +GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE vibetype.account_social_network TO vibetype_account; -- --- Name: TABLE achievement; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE achievement; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT ON TABLE maevsi.achievement TO maevsi_account; -GRANT SELECT ON TABLE maevsi.achievement TO maevsi_anonymous; +GRANT SELECT ON TABLE vibetype.achievement TO vibetype_account; +GRANT SELECT ON TABLE vibetype.achievement TO vibetype_anonymous; -- --- Name: TABLE address; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE address; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE maevsi.address TO maevsi_account; -GRANT SELECT ON TABLE maevsi.address TO maevsi_anonymous; +GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE vibetype.address TO vibetype_account; +GRANT SELECT ON TABLE vibetype.address TO vibetype_anonymous; -- --- Name: TABLE contact; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE contact; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE maevsi.contact TO maevsi_account; -GRANT SELECT ON TABLE maevsi.contact TO maevsi_anonymous; +GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE vibetype.contact TO vibetype_account; +GRANT SELECT ON TABLE vibetype.contact TO vibetype_anonymous; -- --- Name: TABLE event_category; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE event_category; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT ON TABLE maevsi.event_category TO maevsi_anonymous; -GRANT SELECT ON TABLE maevsi.event_category TO maevsi_account; +GRANT SELECT ON TABLE vibetype.event_category TO vibetype_anonymous; +GRANT SELECT ON TABLE vibetype.event_category TO vibetype_account; -- --- Name: TABLE event_category_mapping; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE event_category_mapping; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT ON TABLE maevsi.event_category_mapping TO maevsi_anonymous; -GRANT SELECT,INSERT,DELETE ON TABLE maevsi.event_category_mapping TO maevsi_account; +GRANT SELECT ON TABLE vibetype.event_category_mapping TO vibetype_anonymous; +GRANT SELECT,INSERT,DELETE ON TABLE vibetype.event_category_mapping TO vibetype_account; -- --- Name: TABLE event_favorite; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE event_favorite; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT,DELETE ON TABLE maevsi.event_favorite TO maevsi_account; +GRANT SELECT,INSERT,DELETE ON TABLE vibetype.event_favorite TO vibetype_account; -- --- Name: TABLE event_group; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE event_group; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE maevsi.event_group TO maevsi_account; -GRANT SELECT ON TABLE maevsi.event_group TO maevsi_anonymous; +GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE vibetype.event_group TO vibetype_account; +GRANT SELECT ON TABLE vibetype.event_group TO vibetype_anonymous; -- --- Name: TABLE event_grouping; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE event_grouping; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE maevsi.event_grouping TO maevsi_account; -GRANT SELECT ON TABLE maevsi.event_grouping TO maevsi_anonymous; +GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE vibetype.event_grouping TO vibetype_account; +GRANT SELECT ON TABLE vibetype.event_grouping TO vibetype_anonymous; -- --- Name: TABLE event_recommendation; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE event_recommendation; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT,DELETE ON TABLE maevsi.event_recommendation TO maevsi_account; +GRANT SELECT,INSERT,DELETE ON TABLE vibetype.event_recommendation TO vibetype_account; -- --- Name: TABLE event_upload; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE event_upload; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT,DELETE ON TABLE maevsi.event_upload TO maevsi_account; -GRANT SELECT ON TABLE maevsi.event_upload TO maevsi_anonymous; +GRANT SELECT,INSERT,DELETE ON TABLE vibetype.event_upload TO vibetype_account; +GRANT SELECT ON TABLE vibetype.event_upload TO vibetype_anonymous; -- --- Name: TABLE guest; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE guest; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE maevsi.guest TO maevsi_account; -GRANT SELECT,UPDATE ON TABLE maevsi.guest TO maevsi_anonymous; +GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE vibetype.guest TO vibetype_account; +GRANT SELECT,UPDATE ON TABLE vibetype.guest TO vibetype_anonymous; -- --- Name: TABLE guest_flat; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE guest_flat; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT ON TABLE maevsi.guest_flat TO maevsi_account; -GRANT SELECT ON TABLE maevsi.guest_flat TO maevsi_anonymous; +GRANT SELECT ON TABLE vibetype.guest_flat TO vibetype_account; +GRANT SELECT ON TABLE vibetype.guest_flat TO vibetype_anonymous; -- --- Name: TABLE invitation; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE invitation; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT ON TABLE maevsi.invitation TO maevsi_account; +GRANT SELECT,INSERT ON TABLE vibetype.invitation TO vibetype_account; -- --- Name: TABLE legal_term; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE legal_term; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT ON TABLE maevsi.legal_term TO maevsi_account; -GRANT SELECT ON TABLE maevsi.legal_term TO maevsi_anonymous; +GRANT SELECT ON TABLE vibetype.legal_term TO vibetype_account; +GRANT SELECT ON TABLE vibetype.legal_term TO vibetype_anonymous; -- --- Name: TABLE legal_term_acceptance; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE legal_term_acceptance; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT ON TABLE maevsi.legal_term_acceptance TO maevsi_account; +GRANT SELECT,INSERT ON TABLE vibetype.legal_term_acceptance TO vibetype_account; -- --- Name: TABLE profile_picture; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE profile_picture; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE maevsi.profile_picture TO maevsi_account; -GRANT SELECT ON TABLE maevsi.profile_picture TO maevsi_anonymous; -GRANT SELECT,DELETE ON TABLE maevsi.profile_picture TO maevsi_tusd; +GRANT SELECT,INSERT,DELETE,UPDATE ON TABLE vibetype.profile_picture TO vibetype_account; +GRANT SELECT ON TABLE vibetype.profile_picture TO vibetype_anonymous; +GRANT SELECT,DELETE ON TABLE vibetype.profile_picture TO vibetype_tusd; -- --- Name: TABLE report; Type: ACL; Schema: maevsi; Owner: postgres +-- Name: TABLE report; Type: ACL; Schema: vibetype; Owner: postgres -- -GRANT SELECT,INSERT ON TABLE maevsi.report TO maevsi_account; +GRANT SELECT,INSERT ON TABLE vibetype.report TO vibetype_account; -- --- Name: TABLE achievement_code; Type: ACL; Schema: maevsi_private; Owner: postgres +-- Name: TABLE achievement_code; Type: ACL; Schema: vibetype_private; Owner: postgres -- -GRANT SELECT ON TABLE maevsi_private.achievement_code TO maevsi_tusd; +GRANT SELECT ON TABLE vibetype_private.achievement_code TO vibetype_tusd; -- From 54d6f5aff53ceba71383dbda0f1b8738e6c21b1a Mon Sep 17 00:00:00 2001 From: Sven Thelemann Date: Tue, 18 Mar 2025 23:21:18 +0100 Subject: [PATCH 5/5] fix(script order): change order in `sqitch.plan` New scripts files for invitation are added at the end of `sqitch.plan`. --- src/sqitch.plan | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sqitch.plan b/src/sqitch.plan index 1fed4301..ba555b8e 100644 --- a/src/sqitch.plan +++ b/src/sqitch.plan @@ -102,7 +102,7 @@ test_account_blocking [schema_test function_test_utilities] 1970-01-01T00:00:00Z function_event_search [privilege_execute_revoke schema_public enum_language schema_private function_language_iso_full_text_search table_event role_account role_anonymous] 1970-01-01T00:00:00Z Jonas Thelemann # Full-text search on events. index_account_private_location [schema_private table_account_private] 1970-01-01T00:00:00Z Sven Thelemann # Spacial index on location column in table maevsi_private.account. index_event_location [schema_public table_event] 1970-01-01T00:00:00Z Sven Thelemann # Spacial index on location_geography column in table maevsi.event. +test_location [schema_test schema_public schema_private extension_postgis table_account_private table_event role_anonymous role_account] 1970-01-01T00:00:00Z Sven Thelemann # A collection of location related test functions and tests. table_invitation [schema_public table_guest table_account_public] 1970-01-01T00:00:00Z Sven Thelemann # A table for tracking actions around invitations. table_invitation_policy [schema_public table_invitation role_account function_invoker_account_id table_guest table_event] 1970-01-01T00:00:00Z Sven Thelemann # Stores invitations and their statuses. -test_location [schema_test schema_public schema_private extension_postgis table_account_private table_event role_anonymous role_account] 1970-01-01T00:00:00Z Sven Thelemann # A collection of location related test functions and tests. test_invitation [schema_test function_test_utilities] 1970-01-01T00:00:00Z Sven Thelemann # Invitation related tests.