Something went wrong. Try again.
プレイグラウンド、サンドボックス、使い捨てスクリプト置き場
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152-- (c) 2021 Supabase Inc.-- license: https://github.com/supabase/supabase/blob/master/LICENSE-- https://github.com/supabase/supabase/blob/30b9f748fe163420375244fa350e14bcfa235a3f/docker/volumes/db/init/00-initial-schema.sql
-- Set up reatime-- create publication supabase_realtime; -- defaults to empty publicationcreate publication supabase_realtime;
-- Supabase super admincreate user supabase_admin;alter user supabase_admin with superuser createdb createrole replication bypassrls;
-- Extension namespacingcreate SCHEMA IF NOT exists extensions;create extension if not exists "uuid-ossp" with schema extensions;create extension if not exists pgcrypto with schema extensions;create extension if not exists pgjwt with schema extensions;
-- Set up auth roles for the developercreate role anon nologin noinherit;create role authenticated nologin noinherit; -- "logged in" user: web_user, app_user, etccreate role service_role nologin noinherit bypassrls; -- allow developers to create JWT's that bypass their policies
create user authenticator noinherit;grant anon to authenticator;grant authenticated to authenticator;grant service_role to authenticator;grant supabase_admin to authenticator;
grant usage on schema public to postgres, anon, authenticated, service_role;alter default privileges in schema public grant all on tables to postgres, anon, authenticated, service_role;alter default privileges in schema public grant all on functions to postgres, anon, authenticated, service_role;alter default privileges in schema public grant all on sequences to postgres, anon, authenticated, service_role;
-- Allow Extensions to be used in the APIgrant usage on schema extensions to postgres, anon, authenticated, service_role;
-- Set up namespacingalter user supabase_admin SET search_path TO public, extensions; -- don't include the "auth" schema
-- These are required so that the users receive grants whenever "supabase_admin" creates tables/functionalter default privileges for user supabase_admin in schema public grant all on sequences to postgres, anon, authenticated, service_role;alter default privileges for user supabase_admin in schema public grant all on tables to postgres, anon, authenticated, service_role;alter default privileges for user supabase_admin in schema public grant all on functions to postgres, anon, authenticated, service_role;
-- Set short statement/query timeouts for API rolesalter role anon set statement_timeout = '3s';alter role authenticated set statement_timeout = '8s';