Something went wrong. Try again.
プレイグラウンド、サンドボックス、使い捨てスクリプト置き場
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273-- (c) 2021 Supabase Inc.-- license: https://github.com/supabase/supabase/blob/master/LICENSE-- https://github.com/supabase/supabase/blob/30b9f748fe163420375244fa350e14bcfa235a3f/docker/volumes/db/init/03-post-setup.sql
ALTER ROLE postgres SET search_path TO "\$user",public,extensions;CREATE OR REPLACE FUNCTION extensions.notify_api_restart()RETURNS event_triggerLANGUAGE plpgsqlAS $$BEGIN NOTIFY ddl_command_end;END;$$;CREATE EVENT TRIGGER api_restart ON ddl_command_endEXECUTE PROCEDURE extensions.notify_api_restart();COMMENT ON FUNCTION extensions.notify_api_restart IS 'Sends a notification to the API to restart. If your database schema has changed, this is required so that Supabase can rebuild the relationships.';
-- Trigger for pg_cronCREATE OR REPLACE FUNCTION extensions.grant_pg_cron_access()RETURNS event_triggerLANGUAGE plpgsqlAS $$DECLARE schema_is_cron bool;BEGIN schema_is_cron = ( SELECT n.nspname = 'cron' FROM pg_event_trigger_ddl_commands() AS ev LEFT JOIN pg_catalog.pg_namespace AS n ON ev.objid = n.oid );
IF schema_is_cron THEN grant usage on schema cron to postgres with grant option;
alter default privileges in schema cron grant all on tables to postgres with grant option; alter default privileges in schema cron grant all on functions to postgres with grant option; alter default privileges in schema cron grant all on sequences to postgres with grant option;
alter default privileges for user supabase_admin in schema cron grant all on sequences to postgres with grant option; alter default privileges for user supabase_admin in schema cron grant all on tables to postgres with grant option; alter default privileges for user supabase_admin in schema cron grant all on functions to postgres with grant option;
grant all privileges on all tables in schema cron to postgres with grant option;
END IF;
END;$$;CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end WHEN TAG in ('CREATE SCHEMA')EXECUTE PROCEDURE extensions.grant_pg_cron_access();COMMENT ON FUNCTION extensions.grant_pg_cron_access IS 'Grants access to pg_cron';
-- Supabase dashboard userCREATE ROLE dashboard_user NOSUPERUSER CREATEDB CREATEROLE REPLICATION;GRANT ALL ON DATABASE postgres TO dashboard_user;GRANT ALL ON SCHEMA auth TO dashboard_user;GRANT ALL ON SCHEMA extensions TO dashboard_user;GRANT ALL ON SCHEMA storage TO dashboard_user;GRANT ALL ON ALL TABLES IN SCHEMA auth TO dashboard_user;GRANT ALL ON ALL TABLES IN SCHEMA extensions TO dashboard_user;-- GRANT ALL ON ALL TABLES IN SCHEMA storage TO dashboard_user;GRANT ALL ON ALL SEQUENCES IN SCHEMA auth TO dashboard_user;GRANT ALL ON ALL SEQUENCES IN SCHEMA storage TO dashboard_user;GRANT ALL ON ALL SEQUENCES IN SCHEMA extensions TO dashboard_user;GRANT ALL ON ALL ROUTINES IN SCHEMA auth TO dashboard_user;GRANT ALL ON ALL ROUTINES IN SCHEMA storage TO dashboard_user;GRANT ALL ON ALL ROUTINES IN SCHEMA extensions TO dashboard_user;