-
Notifications
You must be signed in to change notification settings - Fork 37
Description
old.sql:
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'app_user') THEN
CREATE ROLE app_user;
END IF;
END $$;
CREATE TYPE entity_kind AS ENUM ('person', 'company', 'organization');
CREATE FUNCTION create_entity(p_name text, p_kind entity_kind)
RETURNS uuid
LANGUAGE sql
AS $$ SELECT gen_random_uuid(); $$;new.sql:
DO $$
BEGIN
IF NOT EXISTS (SELECT 1 FROM pg_roles WHERE rolname = 'app_user') THEN
CREATE ROLE app_user;
END IF;
END $$;
CREATE TYPE entity_kind AS ENUM ('person', 'company', 'organization');
CREATE FUNCTION create_entity(p_name text, p_kind entity_kind)
RETURNS uuid
LANGUAGE sql
AS $$ SELECT gen_random_uuid(); $$;
REVOKE ALL ON FUNCTION create_entity(text, entity_kind) FROM PUBLIC;
GRANT EXECUTE ON FUNCTION create_entity(text, entity_kind) TO app_user;current plan.sql:
REVOKE EXECUTE ON FUNCTION create_entity(p_name text, p_kind pgschema_tmp_20260322_225736_e9508683.entity_kind) FROM PUBLIC;
GRANT EXECUTE ON FUNCTION create_entity(p_name text, p_kind pgschema_tmp_20260322_225736_e9508683.entity_kind) TO app_userNotice the enum is pgschema_tmp_20260322_225736_e9508683.entity_kind
expected plan.sql:
REVOKE EXECUTE ON FUNCTION create_entity(p_name text, p_kind entity_kind) FROM PUBLIC;
GRANT EXECUTE ON FUNCTION create_entity(p_name text, p_kind entity_kind) TO app_userReactions are currently unavailable