github.com/supabase/cli@v1.168.1/internal/utils/templates/initial_schemas/13.sql (about)

     1  --
     2  -- PostgreSQL database dump
     3  --
     4  
     5  -- Dumped from database version 13.3 (Debian 13.3-1.pgdg100+1)
     6  -- Dumped by pg_dump version 15.3
     7  
     8  SET statement_timeout = 0;
     9  SET lock_timeout = 0;
    10  SET idle_in_transaction_session_timeout = 0;
    11  SET client_encoding = 'UTF8';
    12  SET standard_conforming_strings = on;
    13  SELECT pg_catalog.set_config('search_path', '', false);
    14  SET check_function_bodies = false;
    15  SET xmloption = content;
    16  SET client_min_messages = warning;
    17  SET row_security = off;
    18  
    19  --
    20  -- Name: _analytics; Type: SCHEMA; Schema: -; Owner: postgres
    21  --
    22  
    23  CREATE SCHEMA IF NOT EXISTS _analytics;
    24  
    25  
    26  ALTER SCHEMA _analytics OWNER TO postgres;
    27  
    28  --
    29  -- Name: _realtime; Type: SCHEMA; Schema: -; Owner: postgres
    30  --
    31  
    32  CREATE SCHEMA IF NOT EXISTS _realtime;
    33  
    34  
    35  ALTER SCHEMA _realtime OWNER TO postgres;
    36  
    37  --
    38  -- Name: auth; Type: SCHEMA; Schema: -; Owner: supabase_admin
    39  --
    40  
    41  CREATE SCHEMA IF NOT EXISTS auth;
    42  
    43  
    44  ALTER SCHEMA auth OWNER TO supabase_admin;
    45  
    46  --
    47  -- Name: extensions; Type: SCHEMA; Schema: -; Owner: postgres
    48  --
    49  
    50  CREATE SCHEMA IF NOT EXISTS extensions;
    51  
    52  
    53  ALTER SCHEMA extensions OWNER TO postgres;
    54  
    55  --
    56  -- Name: graphql_public; Type: SCHEMA; Schema: -; Owner: supabase_admin
    57  --
    58  
    59  CREATE SCHEMA IF NOT EXISTS graphql_public;
    60  
    61  
    62  ALTER SCHEMA graphql_public OWNER TO supabase_admin;
    63  
    64  --
    65  -- Name: public; Type: SCHEMA; Schema: -; Owner: postgres
    66  --
    67  
    68  -- *not* creating schema, since initdb creates it
    69  
    70  
    71  ALTER SCHEMA public OWNER TO postgres;
    72  
    73  --
    74  -- Name: realtime; Type: SCHEMA; Schema: -; Owner: supabase_admin
    75  --
    76  
    77  CREATE SCHEMA IF NOT EXISTS realtime;
    78  
    79  
    80  ALTER SCHEMA realtime OWNER TO supabase_admin;
    81  
    82  --
    83  -- Name: storage; Type: SCHEMA; Schema: -; Owner: supabase_admin
    84  --
    85  
    86  CREATE SCHEMA IF NOT EXISTS storage;
    87  
    88  
    89  ALTER SCHEMA storage OWNER TO supabase_admin;
    90  
    91  --
    92  -- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: -
    93  --
    94  
    95  CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA extensions;
    96  
    97  
    98  --
    99  -- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner: 
   100  --
   101  
   102  COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';
   103  
   104  
   105  --
   106  -- Name: pgjwt; Type: EXTENSION; Schema: -; Owner: -
   107  --
   108  
   109  CREATE EXTENSION IF NOT EXISTS pgjwt WITH SCHEMA extensions;
   110  
   111  
   112  --
   113  -- Name: EXTENSION pgjwt; Type: COMMENT; Schema: -; Owner: 
   114  --
   115  
   116  COMMENT ON EXTENSION pgjwt IS 'JSON Web Token API for Postgresql';
   117  
   118  
   119  --
   120  -- Name: uuid-ossp; Type: EXTENSION; Schema: -; Owner: -
   121  --
   122  
   123  CREATE EXTENSION IF NOT EXISTS "uuid-ossp" WITH SCHEMA extensions;
   124  
   125  
   126  --
   127  -- Name: EXTENSION "uuid-ossp"; Type: COMMENT; Schema: -; Owner: 
   128  --
   129  
   130  COMMENT ON EXTENSION "uuid-ossp" IS 'generate universally unique identifiers (UUIDs)';
   131  
   132  
   133  --
   134  -- Name: aal_level; Type: TYPE; Schema: auth; Owner: supabase_auth_admin
   135  --
   136  
   137  CREATE TYPE auth.aal_level AS ENUM (
   138      'aal1',
   139      'aal2',
   140      'aal3'
   141  );
   142  
   143  
   144  ALTER TYPE auth.aal_level OWNER TO supabase_auth_admin;
   145  
   146  --
   147  -- Name: code_challenge_method; Type: TYPE; Schema: auth; Owner: supabase_auth_admin
   148  --
   149  
   150  CREATE TYPE auth.code_challenge_method AS ENUM (
   151      's256',
   152      'plain'
   153  );
   154  
   155  
   156  ALTER TYPE auth.code_challenge_method OWNER TO supabase_auth_admin;
   157  
   158  --
   159  -- Name: factor_status; Type: TYPE; Schema: auth; Owner: supabase_auth_admin
   160  --
   161  
   162  CREATE TYPE auth.factor_status AS ENUM (
   163      'unverified',
   164      'verified'
   165  );
   166  
   167  
   168  ALTER TYPE auth.factor_status OWNER TO supabase_auth_admin;
   169  
   170  --
   171  -- Name: factor_type; Type: TYPE; Schema: auth; Owner: supabase_auth_admin
   172  --
   173  
   174  CREATE TYPE auth.factor_type AS ENUM (
   175      'totp',
   176      'webauthn'
   177  );
   178  
   179  
   180  ALTER TYPE auth.factor_type OWNER TO supabase_auth_admin;
   181  
   182  --
   183  -- Name: email(); Type: FUNCTION; Schema: auth; Owner: supabase_auth_admin
   184  --
   185  
   186  CREATE OR REPLACE FUNCTION auth.email() RETURNS text
   187      LANGUAGE sql STABLE
   188      AS $$
   189    select 
   190    	coalesce(
   191  		nullif(current_setting('request.jwt.claim.email', true), ''),
   192  		(nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'email')
   193  	)::text
   194  $$;
   195  
   196  
   197  ALTER FUNCTION auth.email() OWNER TO supabase_auth_admin;
   198  
   199  --
   200  -- Name: FUNCTION email(); Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
   201  --
   202  
   203  COMMENT ON FUNCTION auth.email() IS 'Deprecated. Use auth.jwt() -> ''email'' instead.';
   204  
   205  
   206  --
   207  -- Name: jwt(); Type: FUNCTION; Schema: auth; Owner: supabase_auth_admin
   208  --
   209  
   210  CREATE OR REPLACE FUNCTION auth.jwt() RETURNS jsonb
   211      LANGUAGE sql STABLE
   212      AS $$
   213    select 
   214      coalesce(
   215          nullif(current_setting('request.jwt.claim', true), ''),
   216          nullif(current_setting('request.jwt.claims', true), '')
   217      )::jsonb
   218  $$;
   219  
   220  
   221  ALTER FUNCTION auth.jwt() OWNER TO supabase_auth_admin;
   222  
   223  --
   224  -- Name: role(); Type: FUNCTION; Schema: auth; Owner: supabase_auth_admin
   225  --
   226  
   227  CREATE OR REPLACE FUNCTION auth.role() RETURNS text
   228      LANGUAGE sql STABLE
   229      AS $$
   230    select 
   231    	coalesce(
   232  		nullif(current_setting('request.jwt.claim.role', true), ''),
   233  		(nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'role')
   234  	)::text
   235  $$;
   236  
   237  
   238  ALTER FUNCTION auth.role() OWNER TO supabase_auth_admin;
   239  
   240  --
   241  -- Name: FUNCTION role(); Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
   242  --
   243  
   244  COMMENT ON FUNCTION auth.role() IS 'Deprecated. Use auth.jwt() -> ''role'' instead.';
   245  
   246  
   247  --
   248  -- Name: uid(); Type: FUNCTION; Schema: auth; Owner: supabase_auth_admin
   249  --
   250  
   251  CREATE OR REPLACE FUNCTION auth.uid() RETURNS uuid
   252      LANGUAGE sql STABLE
   253      AS $$
   254    select 
   255    	coalesce(
   256  		nullif(current_setting('request.jwt.claim.sub', true), ''),
   257  		(nullif(current_setting('request.jwt.claims', true), '')::jsonb ->> 'sub')
   258  	)::uuid
   259  $$;
   260  
   261  
   262  ALTER FUNCTION auth.uid() OWNER TO supabase_auth_admin;
   263  
   264  --
   265  -- Name: FUNCTION uid(); Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
   266  --
   267  
   268  COMMENT ON FUNCTION auth.uid() IS 'Deprecated. Use auth.jwt() -> ''sub'' instead.';
   269  
   270  
   271  --
   272  -- Name: grant_pg_cron_access(); Type: FUNCTION; Schema: extensions; Owner: postgres
   273  --
   274  
   275  CREATE OR REPLACE FUNCTION extensions.grant_pg_cron_access() RETURNS event_trigger
   276      LANGUAGE plpgsql
   277      AS $$
   278  DECLARE
   279    schema_is_cron bool;
   280  BEGIN
   281    schema_is_cron = (
   282      SELECT n.nspname = 'cron'
   283      FROM pg_event_trigger_ddl_commands() AS ev
   284      LEFT JOIN pg_catalog.pg_namespace AS n
   285        ON ev.objid = n.oid
   286    );
   287  
   288    IF schema_is_cron
   289    THEN
   290      grant usage on schema cron to postgres with grant option;
   291  
   292      alter default privileges in schema cron grant all on tables to postgres with grant option;
   293      alter default privileges in schema cron grant all on functions to postgres with grant option;
   294      alter default privileges in schema cron grant all on sequences to postgres with grant option;
   295  
   296      alter default privileges for user supabase_admin in schema cron grant all
   297          on sequences to postgres with grant option;
   298      alter default privileges for user supabase_admin in schema cron grant all
   299          on tables to postgres with grant option;
   300      alter default privileges for user supabase_admin in schema cron grant all
   301          on functions to postgres with grant option;
   302  
   303      grant all privileges on all tables in schema cron to postgres with grant option; 
   304  
   305    END IF;
   306  
   307  END;
   308  $$;
   309  
   310  
   311  ALTER FUNCTION extensions.grant_pg_cron_access() OWNER TO postgres;
   312  
   313  --
   314  -- Name: FUNCTION grant_pg_cron_access(); Type: COMMENT; Schema: extensions; Owner: postgres
   315  --
   316  
   317  COMMENT ON FUNCTION extensions.grant_pg_cron_access() IS 'Grants access to pg_cron';
   318  
   319  
   320  --
   321  -- Name: grant_pg_graphql_access(); Type: FUNCTION; Schema: extensions; Owner: supabase_admin
   322  --
   323  
   324  CREATE OR REPLACE FUNCTION extensions.grant_pg_graphql_access() RETURNS event_trigger
   325      LANGUAGE plpgsql
   326      AS $_$
   327  DECLARE
   328      func_is_graphql_resolve bool;
   329  BEGIN
   330      func_is_graphql_resolve = (
   331          SELECT n.proname = 'resolve'
   332          FROM pg_event_trigger_ddl_commands() AS ev
   333          LEFT JOIN pg_catalog.pg_proc AS n
   334          ON ev.objid = n.oid
   335      );
   336  
   337      IF func_is_graphql_resolve
   338      THEN
   339  
   340          -- Update public wrapper to pass all arguments through to the pg_graphql resolve func
   341          create or replace function graphql_public.graphql(
   342              "operationName" text default null,
   343              query text default null,
   344              variables jsonb default null,
   345              extensions jsonb default null
   346          )
   347              returns jsonb
   348              language sql
   349          as $$
   350              select graphql.resolve(
   351                  query := query,
   352                  variables := coalesce(variables, '{}'),
   353                  "operationName" := "operationName",
   354                  extensions := extensions
   355              );
   356          $$;
   357  
   358  		-- This hook executes when `graphql.resolve` is created. That is not necessarily the last
   359  		-- function in the extension so we need to grant permissions on existing entities AND
   360  		-- update default permissions to any others that are created after `graphql.resolve`
   361          grant usage on schema graphql to postgres, anon, authenticated, service_role;
   362          grant select on all tables in schema graphql to postgres, anon, authenticated, service_role;
   363          grant execute on all functions in schema graphql to postgres, anon, authenticated, service_role;
   364          grant all on all sequences in schema graphql to postgres, anon, authenticated, service_role;
   365  		alter default privileges in schema graphql grant all on tables to postgres, anon, authenticated, service_role;
   366          alter default privileges in schema graphql grant all on functions to postgres, anon, authenticated, service_role;
   367          alter default privileges in schema graphql grant all on sequences to postgres, anon, authenticated, service_role;
   368      END IF;
   369  
   370  END;
   371  $_$;
   372  
   373  
   374  ALTER FUNCTION extensions.grant_pg_graphql_access() OWNER TO supabase_admin;
   375  
   376  --
   377  -- Name: FUNCTION grant_pg_graphql_access(); Type: COMMENT; Schema: extensions; Owner: supabase_admin
   378  --
   379  
   380  COMMENT ON FUNCTION extensions.grant_pg_graphql_access() IS 'Grants access to pg_graphql';
   381  
   382  
   383  --
   384  -- Name: grant_pg_net_access(); Type: FUNCTION; Schema: extensions; Owner: postgres
   385  --
   386  
   387  CREATE OR REPLACE FUNCTION extensions.grant_pg_net_access() RETURNS event_trigger
   388      LANGUAGE plpgsql
   389      AS $$
   390  BEGIN
   391    IF EXISTS (
   392      SELECT 1
   393      FROM pg_event_trigger_ddl_commands() AS ev
   394      JOIN pg_extension AS ext
   395      ON ev.objid = ext.oid
   396      WHERE ext.extname = 'pg_net'
   397    )
   398    THEN
   399      IF NOT EXISTS (
   400        SELECT 1
   401        FROM pg_roles
   402        WHERE rolname = 'supabase_functions_admin'
   403      )
   404      THEN
   405        CREATE USER supabase_functions_admin NOINHERIT CREATEROLE LOGIN NOREPLICATION;
   406      END IF;
   407  
   408      GRANT USAGE ON SCHEMA net TO supabase_functions_admin, postgres, anon, authenticated, service_role;
   409  
   410      ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;
   411      ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;
   412      ALTER function net.http_collect_response(request_id bigint, async boolean) SECURITY DEFINER;
   413  
   414      ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;
   415      ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;
   416      ALTER function net.http_collect_response(request_id bigint, async boolean) SET search_path = net;
   417  
   418      REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;
   419      REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;
   420      REVOKE ALL ON FUNCTION net.http_collect_response(request_id bigint, async boolean) FROM PUBLIC;
   421  
   422      GRANT EXECUTE ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;
   423      GRANT EXECUTE ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) TO supabase_functions_admin, postgres, anon, authenticated, service_role;
   424      GRANT EXECUTE ON FUNCTION net.http_collect_response(request_id bigint, async boolean) TO supabase_functions_admin, postgres, anon, authenticated, service_role;
   425    END IF;
   426  END;
   427  $$;
   428  
   429  
   430  ALTER FUNCTION extensions.grant_pg_net_access() OWNER TO postgres;
   431  
   432  --
   433  -- Name: FUNCTION grant_pg_net_access(); Type: COMMENT; Schema: extensions; Owner: postgres
   434  --
   435  
   436  COMMENT ON FUNCTION extensions.grant_pg_net_access() IS 'Grants access to pg_net';
   437  
   438  
   439  --
   440  -- Name: pgrst_ddl_watch(); Type: FUNCTION; Schema: extensions; Owner: supabase_admin
   441  --
   442  
   443  CREATE OR REPLACE FUNCTION extensions.pgrst_ddl_watch() RETURNS event_trigger
   444      LANGUAGE plpgsql
   445      AS $$
   446  DECLARE
   447    cmd record;
   448  BEGIN
   449    FOR cmd IN SELECT * FROM pg_event_trigger_ddl_commands()
   450    LOOP
   451      IF cmd.command_tag IN (
   452        'CREATE SCHEMA', 'ALTER SCHEMA'
   453      , 'CREATE TABLE', 'CREATE TABLE AS', 'SELECT INTO', 'ALTER TABLE'
   454      , 'CREATE FOREIGN TABLE', 'ALTER FOREIGN TABLE'
   455      , 'CREATE VIEW', 'ALTER VIEW'
   456      , 'CREATE MATERIALIZED VIEW', 'ALTER MATERIALIZED VIEW'
   457      , 'CREATE FUNCTION', 'ALTER FUNCTION'
   458      , 'CREATE TRIGGER'
   459      , 'CREATE TYPE', 'ALTER TYPE'
   460      , 'CREATE RULE'
   461      , 'COMMENT'
   462      )
   463      -- don't notify in case of CREATE TEMP table or other objects created on pg_temp
   464      AND cmd.schema_name is distinct from 'pg_temp'
   465      THEN
   466        NOTIFY pgrst, 'reload schema';
   467      END IF;
   468    END LOOP;
   469  END; $$;
   470  
   471  
   472  ALTER FUNCTION extensions.pgrst_ddl_watch() OWNER TO supabase_admin;
   473  
   474  --
   475  -- Name: pgrst_drop_watch(); Type: FUNCTION; Schema: extensions; Owner: supabase_admin
   476  --
   477  
   478  CREATE OR REPLACE FUNCTION extensions.pgrst_drop_watch() RETURNS event_trigger
   479      LANGUAGE plpgsql
   480      AS $$
   481  DECLARE
   482    obj record;
   483  BEGIN
   484    FOR obj IN SELECT * FROM pg_event_trigger_dropped_objects()
   485    LOOP
   486      IF obj.object_type IN (
   487        'schema'
   488      , 'table'
   489      , 'foreign table'
   490      , 'view'
   491      , 'materialized view'
   492      , 'function'
   493      , 'trigger'
   494      , 'type'
   495      , 'rule'
   496      )
   497      AND obj.is_temporary IS false -- no pg_temp objects
   498      THEN
   499        NOTIFY pgrst, 'reload schema';
   500      END IF;
   501    END LOOP;
   502  END; $$;
   503  
   504  
   505  ALTER FUNCTION extensions.pgrst_drop_watch() OWNER TO supabase_admin;
   506  
   507  --
   508  -- Name: set_graphql_placeholder(); Type: FUNCTION; Schema: extensions; Owner: supabase_admin
   509  --
   510  
   511  CREATE OR REPLACE FUNCTION extensions.set_graphql_placeholder() RETURNS event_trigger
   512      LANGUAGE plpgsql
   513      AS $_$
   514      DECLARE
   515      graphql_is_dropped bool;
   516      BEGIN
   517      graphql_is_dropped = (
   518          SELECT ev.schema_name = 'graphql_public'
   519          FROM pg_event_trigger_dropped_objects() AS ev
   520          WHERE ev.schema_name = 'graphql_public'
   521      );
   522  
   523      IF graphql_is_dropped
   524      THEN
   525          create or replace function graphql_public.graphql(
   526              "operationName" text default null,
   527              query text default null,
   528              variables jsonb default null,
   529              extensions jsonb default null
   530          )
   531              returns jsonb
   532              language plpgsql
   533          as $$
   534              DECLARE
   535                  server_version float;
   536              BEGIN
   537                  server_version = (SELECT (SPLIT_PART((select version()), ' ', 2))::float);
   538  
   539                  IF server_version >= 14 THEN
   540                      RETURN jsonb_build_object(
   541                          'errors', jsonb_build_array(
   542                              jsonb_build_object(
   543                                  'message', 'pg_graphql extension is not enabled.'
   544                              )
   545                          )
   546                      );
   547                  ELSE
   548                      RETURN jsonb_build_object(
   549                          'errors', jsonb_build_array(
   550                              jsonb_build_object(
   551                                  'message', 'pg_graphql is only available on projects running Postgres 14 onwards.'
   552                              )
   553                          )
   554                      );
   555                  END IF;
   556              END;
   557          $$;
   558      END IF;
   559  
   560      END;
   561  $_$;
   562  
   563  
   564  ALTER FUNCTION extensions.set_graphql_placeholder() OWNER TO supabase_admin;
   565  
   566  --
   567  -- Name: FUNCTION set_graphql_placeholder(); Type: COMMENT; Schema: extensions; Owner: supabase_admin
   568  --
   569  
   570  COMMENT ON FUNCTION extensions.set_graphql_placeholder() IS 'Reintroduces placeholder function for graphql_public.graphql';
   571  
   572  
   573  --
   574  -- Name: graphql(text, text, jsonb, jsonb); Type: FUNCTION; Schema: graphql_public; Owner: supabase_admin
   575  --
   576  
   577  CREATE OR REPLACE FUNCTION graphql_public.graphql("operationName" text DEFAULT NULL::text, query text DEFAULT NULL::text, variables jsonb DEFAULT NULL::jsonb, extensions jsonb DEFAULT NULL::jsonb) RETURNS jsonb
   578      LANGUAGE plpgsql
   579      AS $$
   580      DECLARE
   581          server_version float;
   582      BEGIN
   583          server_version = (SELECT (SPLIT_PART((select version()), ' ', 2))::float);
   584  
   585          IF server_version >= 14 THEN
   586              RETURN jsonb_build_object(
   587                  'errors', jsonb_build_array(
   588                      jsonb_build_object(
   589                          'message', 'pg_graphql extension is not enabled.'
   590                      )
   591                  )
   592              );
   593          ELSE
   594     	        RETURN jsonb_build_object(
   595                  'errors', jsonb_build_array(
   596                      jsonb_build_object(
   597                          'message', 'pg_graphql is only available on projects running Postgres 14 onwards.'
   598                      )
   599                  )
   600              );
   601          END IF;
   602      END;
   603  $$;
   604  
   605  
   606  ALTER FUNCTION graphql_public.graphql("operationName" text, query text, variables jsonb, extensions jsonb) OWNER TO supabase_admin;
   607  
   608  --
   609  -- Name: can_insert_object(text, text, uuid, jsonb); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin
   610  --
   611  
   612  CREATE OR REPLACE FUNCTION storage.can_insert_object(bucketid text, name text, owner uuid, metadata jsonb) RETURNS void
   613      LANGUAGE plpgsql
   614      AS $$
   615  BEGIN
   616    INSERT INTO "storage"."objects" ("bucket_id", "name", "owner", "metadata") VALUES (bucketid, name, owner, metadata);
   617    -- hack to rollback the successful insert
   618    RAISE sqlstate 'PT200' using
   619    message = 'ROLLBACK',
   620    detail = 'rollback successful insert';
   621  END
   622  $$;
   623  
   624  
   625  ALTER FUNCTION storage.can_insert_object(bucketid text, name text, owner uuid, metadata jsonb) OWNER TO supabase_storage_admin;
   626  
   627  --
   628  -- Name: extension(text); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin
   629  --
   630  
   631  CREATE OR REPLACE FUNCTION storage.extension(name text) RETURNS text
   632      LANGUAGE plpgsql
   633      AS $$
   634  DECLARE
   635  _parts text[];
   636  _filename text;
   637  BEGIN
   638  	select string_to_array(name, '/') into _parts;
   639  	select _parts[array_length(_parts,1)] into _filename;
   640  	-- @todo return the last part instead of 2
   641  	return split_part(_filename, '.', 2);
   642  END
   643  $$;
   644  
   645  
   646  ALTER FUNCTION storage.extension(name text) OWNER TO supabase_storage_admin;
   647  
   648  --
   649  -- Name: filename(text); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin
   650  --
   651  
   652  CREATE OR REPLACE FUNCTION storage.filename(name text) RETURNS text
   653      LANGUAGE plpgsql
   654      AS $$
   655  DECLARE
   656  _parts text[];
   657  BEGIN
   658  	select string_to_array(name, '/') into _parts;
   659  	return _parts[array_length(_parts,1)];
   660  END
   661  $$;
   662  
   663  
   664  ALTER FUNCTION storage.filename(name text) OWNER TO supabase_storage_admin;
   665  
   666  --
   667  -- Name: foldername(text); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin
   668  --
   669  
   670  CREATE OR REPLACE FUNCTION storage.foldername(name text) RETURNS text[]
   671      LANGUAGE plpgsql
   672      AS $$
   673  DECLARE
   674  _parts text[];
   675  BEGIN
   676  	select string_to_array(name, '/') into _parts;
   677  	return _parts[1:array_length(_parts,1)-1];
   678  END
   679  $$;
   680  
   681  
   682  ALTER FUNCTION storage.foldername(name text) OWNER TO supabase_storage_admin;
   683  
   684  --
   685  -- Name: get_size_by_bucket(); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin
   686  --
   687  
   688  CREATE OR REPLACE FUNCTION storage.get_size_by_bucket() RETURNS TABLE(size bigint, bucket_id text)
   689      LANGUAGE plpgsql
   690      AS $$
   691  BEGIN
   692      return query
   693          select sum((metadata->>'size')::int) as size, obj.bucket_id
   694          from "storage".objects as obj
   695          group by obj.bucket_id;
   696  END
   697  $$;
   698  
   699  
   700  ALTER FUNCTION storage.get_size_by_bucket() OWNER TO supabase_storage_admin;
   701  
   702  --
   703  -- Name: search(text, text, integer, integer, integer, text, text, text); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin
   704  --
   705  
   706  CREATE OR REPLACE FUNCTION storage.search(prefix text, bucketname text, limits integer DEFAULT 100, levels integer DEFAULT 1, offsets integer DEFAULT 0, search text DEFAULT ''::text, sortcolumn text DEFAULT 'name'::text, sortorder text DEFAULT 'asc'::text) RETURNS TABLE(name text, id uuid, updated_at timestamp with time zone, created_at timestamp with time zone, last_accessed_at timestamp with time zone, metadata jsonb)
   707      LANGUAGE plpgsql STABLE
   708      AS $_$
   709  declare
   710    v_order_by text;
   711    v_sort_order text;
   712  begin
   713    case
   714      when sortcolumn = 'name' then
   715        v_order_by = 'name';
   716      when sortcolumn = 'updated_at' then
   717        v_order_by = 'updated_at';
   718      when sortcolumn = 'created_at' then
   719        v_order_by = 'created_at';
   720      when sortcolumn = 'last_accessed_at' then
   721        v_order_by = 'last_accessed_at';
   722      else
   723        v_order_by = 'name';
   724    end case;
   725  
   726    case
   727      when sortorder = 'asc' then
   728        v_sort_order = 'asc';
   729      when sortorder = 'desc' then
   730        v_sort_order = 'desc';
   731      else
   732        v_sort_order = 'asc';
   733    end case;
   734  
   735    v_order_by = v_order_by || ' ' || v_sort_order;
   736  
   737    return query execute
   738      'with folders as (
   739         select path_tokens[$1] as folder
   740         from storage.objects
   741           where objects.name ilike $2 || $3 || ''%''
   742             and bucket_id = $4
   743             and array_length(regexp_split_to_array(objects.name, ''/''), 1) <> $1
   744         group by folder
   745         order by folder ' || v_sort_order || '
   746       )
   747       (select folder as "name",
   748              null as id,
   749              null as updated_at,
   750              null as created_at,
   751              null as last_accessed_at,
   752              null as metadata from folders)
   753       union all
   754       (select path_tokens[$1] as "name",
   755              id,
   756              updated_at,
   757              created_at,
   758              last_accessed_at,
   759              metadata
   760       from storage.objects
   761       where objects.name ilike $2 || $3 || ''%''
   762         and bucket_id = $4
   763         and array_length(regexp_split_to_array(objects.name, ''/''), 1) = $1
   764       order by ' || v_order_by || ')
   765       limit $5
   766       offset $6' using levels, prefix, search, bucketname, limits, offsets;
   767  end;
   768  $_$;
   769  
   770  
   771  ALTER FUNCTION storage.search(prefix text, bucketname text, limits integer, levels integer, offsets integer, search text, sortcolumn text, sortorder text) OWNER TO supabase_storage_admin;
   772  
   773  --
   774  -- Name: update_updated_at_column(); Type: FUNCTION; Schema: storage; Owner: supabase_storage_admin
   775  --
   776  
   777  CREATE OR REPLACE FUNCTION storage.update_updated_at_column() RETURNS trigger
   778      LANGUAGE plpgsql
   779      AS $$
   780  BEGIN
   781      NEW.updated_at = now();
   782      RETURN NEW; 
   783  END;
   784  $$;
   785  
   786  
   787  ALTER FUNCTION storage.update_updated_at_column() OWNER TO supabase_storage_admin;
   788  
   789  SET default_tablespace = '';
   790  
   791  SET default_table_access_method = heap;
   792  
   793  --
   794  -- Name: extensions; Type: TABLE; Schema: _realtime; Owner: postgres
   795  --
   796  
   797  CREATE TABLE IF NOT EXISTS _realtime.extensions (
   798      id uuid NOT NULL,
   799      type text,
   800      settings jsonb,
   801      tenant_external_id text,
   802      inserted_at timestamp(0) without time zone NOT NULL,
   803      updated_at timestamp(0) without time zone NOT NULL
   804  );
   805  
   806  
   807  ALTER TABLE _realtime.extensions OWNER TO postgres;
   808  
   809  --
   810  -- Name: schema_migrations; Type: TABLE; Schema: _realtime; Owner: postgres
   811  --
   812  
   813  CREATE TABLE IF NOT EXISTS _realtime.schema_migrations (
   814      version bigint NOT NULL,
   815      inserted_at timestamp(0) without time zone
   816  );
   817  
   818  
   819  ALTER TABLE _realtime.schema_migrations OWNER TO postgres;
   820  
   821  --
   822  -- Name: tenants; Type: TABLE; Schema: _realtime; Owner: postgres
   823  --
   824  
   825  CREATE TABLE IF NOT EXISTS _realtime.tenants (
   826      id uuid NOT NULL,
   827      name text,
   828      external_id text,
   829      jwt_secret text,
   830      max_concurrent_users integer DEFAULT 200 NOT NULL,
   831      inserted_at timestamp(0) without time zone NOT NULL,
   832      updated_at timestamp(0) without time zone NOT NULL,
   833      max_events_per_second integer DEFAULT 100 NOT NULL,
   834      postgres_cdc_default text DEFAULT 'postgres_cdc_rls'::text,
   835      max_bytes_per_second integer DEFAULT 100000 NOT NULL,
   836      max_channels_per_client integer DEFAULT 100 NOT NULL,
   837      max_joins_per_second integer DEFAULT 500 NOT NULL,
   838      suspend boolean DEFAULT false
   839  );
   840  
   841  
   842  ALTER TABLE _realtime.tenants OWNER TO postgres;
   843  
   844  --
   845  -- Name: audit_log_entries; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
   846  --
   847  
   848  CREATE TABLE IF NOT EXISTS auth.audit_log_entries (
   849      instance_id uuid,
   850      id uuid NOT NULL,
   851      payload json,
   852      created_at timestamp with time zone,
   853      ip_address character varying(64) DEFAULT ''::character varying NOT NULL
   854  );
   855  
   856  
   857  ALTER TABLE auth.audit_log_entries OWNER TO supabase_auth_admin;
   858  
   859  --
   860  -- Name: TABLE audit_log_entries; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
   861  --
   862  
   863  COMMENT ON TABLE auth.audit_log_entries IS 'Auth: Audit trail for user actions.';
   864  
   865  
   866  --
   867  -- Name: flow_state; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
   868  --
   869  
   870  CREATE TABLE IF NOT EXISTS auth.flow_state (
   871      id uuid NOT NULL,
   872      user_id uuid,
   873      auth_code text NOT NULL,
   874      code_challenge_method auth.code_challenge_method NOT NULL,
   875      code_challenge text NOT NULL,
   876      provider_type text NOT NULL,
   877      provider_access_token text,
   878      provider_refresh_token text,
   879      created_at timestamp with time zone,
   880      updated_at timestamp with time zone,
   881      authentication_method text NOT NULL
   882  );
   883  
   884  
   885  ALTER TABLE auth.flow_state OWNER TO supabase_auth_admin;
   886  
   887  --
   888  -- Name: TABLE flow_state; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
   889  --
   890  
   891  COMMENT ON TABLE auth.flow_state IS 'stores metadata for pkce logins';
   892  
   893  
   894  --
   895  -- Name: identities; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
   896  --
   897  
   898  CREATE TABLE IF NOT EXISTS auth.identities (
   899      provider_id text NOT NULL,
   900      user_id uuid NOT NULL,
   901      identity_data jsonb NOT NULL,
   902      provider text NOT NULL,
   903      last_sign_in_at timestamp with time zone,
   904      created_at timestamp with time zone,
   905      updated_at timestamp with time zone,
   906      email text GENERATED ALWAYS AS (lower((identity_data ->> 'email'::text))) STORED,
   907      id uuid DEFAULT gen_random_uuid() NOT NULL
   908  );
   909  
   910  
   911  ALTER TABLE auth.identities OWNER TO supabase_auth_admin;
   912  
   913  --
   914  -- Name: TABLE identities; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
   915  --
   916  
   917  COMMENT ON TABLE auth.identities IS 'Auth: Stores identities associated to a user.';
   918  
   919  
   920  --
   921  -- Name: COLUMN identities.email; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
   922  --
   923  
   924  COMMENT ON COLUMN auth.identities.email IS 'Auth: Email is a generated column that references the optional email property in the identity_data';
   925  
   926  
   927  --
   928  -- Name: instances; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
   929  --
   930  
   931  CREATE TABLE IF NOT EXISTS auth.instances (
   932      id uuid NOT NULL,
   933      uuid uuid,
   934      raw_base_config text,
   935      created_at timestamp with time zone,
   936      updated_at timestamp with time zone
   937  );
   938  
   939  
   940  ALTER TABLE auth.instances OWNER TO supabase_auth_admin;
   941  
   942  --
   943  -- Name: TABLE instances; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
   944  --
   945  
   946  COMMENT ON TABLE auth.instances IS 'Auth: Manages users across multiple sites.';
   947  
   948  
   949  --
   950  -- Name: mfa_amr_claims; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
   951  --
   952  
   953  CREATE TABLE IF NOT EXISTS auth.mfa_amr_claims (
   954      session_id uuid NOT NULL,
   955      created_at timestamp with time zone NOT NULL,
   956      updated_at timestamp with time zone NOT NULL,
   957      authentication_method text NOT NULL,
   958      id uuid NOT NULL
   959  );
   960  
   961  
   962  ALTER TABLE auth.mfa_amr_claims OWNER TO supabase_auth_admin;
   963  
   964  --
   965  -- Name: TABLE mfa_amr_claims; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
   966  --
   967  
   968  COMMENT ON TABLE auth.mfa_amr_claims IS 'auth: stores authenticator method reference claims for multi factor authentication';
   969  
   970  
   971  --
   972  -- Name: mfa_challenges; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
   973  --
   974  
   975  CREATE TABLE IF NOT EXISTS auth.mfa_challenges (
   976      id uuid NOT NULL,
   977      factor_id uuid NOT NULL,
   978      created_at timestamp with time zone NOT NULL,
   979      verified_at timestamp with time zone,
   980      ip_address inet NOT NULL
   981  );
   982  
   983  
   984  ALTER TABLE auth.mfa_challenges OWNER TO supabase_auth_admin;
   985  
   986  --
   987  -- Name: TABLE mfa_challenges; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
   988  --
   989  
   990  COMMENT ON TABLE auth.mfa_challenges IS 'auth: stores metadata about challenge requests made';
   991  
   992  
   993  --
   994  -- Name: mfa_factors; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
   995  --
   996  
   997  CREATE TABLE IF NOT EXISTS auth.mfa_factors (
   998      id uuid NOT NULL,
   999      user_id uuid NOT NULL,
  1000      friendly_name text,
  1001      factor_type auth.factor_type NOT NULL,
  1002      status auth.factor_status NOT NULL,
  1003      created_at timestamp with time zone NOT NULL,
  1004      updated_at timestamp with time zone NOT NULL,
  1005      secret text
  1006  );
  1007  
  1008  
  1009  ALTER TABLE auth.mfa_factors OWNER TO supabase_auth_admin;
  1010  
  1011  --
  1012  -- Name: TABLE mfa_factors; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  1013  --
  1014  
  1015  COMMENT ON TABLE auth.mfa_factors IS 'auth: stores metadata about factors';
  1016  
  1017  
  1018  --
  1019  -- Name: refresh_tokens; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
  1020  --
  1021  
  1022  CREATE TABLE IF NOT EXISTS auth.refresh_tokens (
  1023      instance_id uuid,
  1024      id bigint NOT NULL,
  1025      token character varying(255),
  1026      user_id character varying(255),
  1027      revoked boolean,
  1028      created_at timestamp with time zone,
  1029      updated_at timestamp with time zone,
  1030      parent character varying(255),
  1031      session_id uuid
  1032  );
  1033  
  1034  
  1035  ALTER TABLE auth.refresh_tokens OWNER TO supabase_auth_admin;
  1036  
  1037  --
  1038  -- Name: TABLE refresh_tokens; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  1039  --
  1040  
  1041  COMMENT ON TABLE auth.refresh_tokens IS 'Auth: Store of tokens used to refresh JWT tokens once they expire.';
  1042  
  1043  
  1044  --
  1045  -- Name: refresh_tokens_id_seq; Type: SEQUENCE; Schema: auth; Owner: supabase_auth_admin
  1046  --
  1047  
  1048  CREATE SEQUENCE IF NOT EXISTS auth.refresh_tokens_id_seq
  1049      START WITH 1
  1050      INCREMENT BY 1
  1051      NO MINVALUE
  1052      NO MAXVALUE
  1053      CACHE 1;
  1054  
  1055  
  1056  ALTER TABLE auth.refresh_tokens_id_seq OWNER TO supabase_auth_admin;
  1057  
  1058  --
  1059  -- Name: refresh_tokens_id_seq; Type: SEQUENCE OWNED BY; Schema: auth; Owner: supabase_auth_admin
  1060  --
  1061  
  1062  ALTER SEQUENCE auth.refresh_tokens_id_seq OWNED BY auth.refresh_tokens.id;
  1063  
  1064  
  1065  --
  1066  -- Name: saml_providers; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
  1067  --
  1068  
  1069  CREATE TABLE IF NOT EXISTS auth.saml_providers (
  1070      id uuid NOT NULL,
  1071      sso_provider_id uuid NOT NULL,
  1072      entity_id text NOT NULL,
  1073      metadata_xml text NOT NULL,
  1074      metadata_url text,
  1075      attribute_mapping jsonb,
  1076      created_at timestamp with time zone,
  1077      updated_at timestamp with time zone,
  1078      CONSTRAINT "entity_id not empty" CHECK ((char_length(entity_id) > 0)),
  1079      CONSTRAINT "metadata_url not empty" CHECK (((metadata_url = NULL::text) OR (char_length(metadata_url) > 0))),
  1080      CONSTRAINT "metadata_xml not empty" CHECK ((char_length(metadata_xml) > 0))
  1081  );
  1082  
  1083  
  1084  ALTER TABLE auth.saml_providers OWNER TO supabase_auth_admin;
  1085  
  1086  --
  1087  -- Name: TABLE saml_providers; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  1088  --
  1089  
  1090  COMMENT ON TABLE auth.saml_providers IS 'Auth: Manages SAML Identity Provider connections.';
  1091  
  1092  
  1093  --
  1094  -- Name: saml_relay_states; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
  1095  --
  1096  
  1097  CREATE TABLE IF NOT EXISTS auth.saml_relay_states (
  1098      id uuid NOT NULL,
  1099      sso_provider_id uuid NOT NULL,
  1100      request_id text NOT NULL,
  1101      for_email text,
  1102      redirect_to text,
  1103      from_ip_address inet,
  1104      created_at timestamp with time zone,
  1105      updated_at timestamp with time zone,
  1106      flow_state_id uuid,
  1107      CONSTRAINT "request_id not empty" CHECK ((char_length(request_id) > 0))
  1108  );
  1109  
  1110  
  1111  ALTER TABLE auth.saml_relay_states OWNER TO supabase_auth_admin;
  1112  
  1113  --
  1114  -- Name: TABLE saml_relay_states; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  1115  --
  1116  
  1117  COMMENT ON TABLE auth.saml_relay_states IS 'Auth: Contains SAML Relay State information for each Service Provider initiated login.';
  1118  
  1119  
  1120  --
  1121  -- Name: schema_migrations; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
  1122  --
  1123  
  1124  CREATE TABLE IF NOT EXISTS auth.schema_migrations (
  1125      version character varying(255) NOT NULL
  1126  );
  1127  
  1128  
  1129  ALTER TABLE auth.schema_migrations OWNER TO supabase_auth_admin;
  1130  
  1131  --
  1132  -- Name: TABLE schema_migrations; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  1133  --
  1134  
  1135  COMMENT ON TABLE auth.schema_migrations IS 'Auth: Manages updates to the auth system.';
  1136  
  1137  
  1138  --
  1139  -- Name: sessions; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
  1140  --
  1141  
  1142  CREATE TABLE IF NOT EXISTS auth.sessions (
  1143      id uuid NOT NULL,
  1144      user_id uuid NOT NULL,
  1145      created_at timestamp with time zone,
  1146      updated_at timestamp with time zone,
  1147      factor_id uuid,
  1148      aal auth.aal_level,
  1149      not_after timestamp with time zone,
  1150      refreshed_at timestamp without time zone,
  1151      user_agent text,
  1152      ip inet,
  1153      tag text
  1154  );
  1155  
  1156  
  1157  ALTER TABLE auth.sessions OWNER TO supabase_auth_admin;
  1158  
  1159  --
  1160  -- Name: TABLE sessions; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  1161  --
  1162  
  1163  COMMENT ON TABLE auth.sessions IS 'Auth: Stores session data associated to a user.';
  1164  
  1165  
  1166  --
  1167  -- Name: COLUMN sessions.not_after; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  1168  --
  1169  
  1170  COMMENT ON COLUMN auth.sessions.not_after IS 'Auth: Not after is a nullable column that contains a timestamp after which the session should be regarded as expired.';
  1171  
  1172  
  1173  --
  1174  -- Name: sso_domains; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
  1175  --
  1176  
  1177  CREATE TABLE IF NOT EXISTS auth.sso_domains (
  1178      id uuid NOT NULL,
  1179      sso_provider_id uuid NOT NULL,
  1180      domain text NOT NULL,
  1181      created_at timestamp with time zone,
  1182      updated_at timestamp with time zone,
  1183      CONSTRAINT "domain not empty" CHECK ((char_length(domain) > 0))
  1184  );
  1185  
  1186  
  1187  ALTER TABLE auth.sso_domains OWNER TO supabase_auth_admin;
  1188  
  1189  --
  1190  -- Name: TABLE sso_domains; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  1191  --
  1192  
  1193  COMMENT ON TABLE auth.sso_domains IS 'Auth: Manages SSO email address domain mapping to an SSO Identity Provider.';
  1194  
  1195  
  1196  --
  1197  -- Name: sso_providers; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
  1198  --
  1199  
  1200  CREATE TABLE IF NOT EXISTS auth.sso_providers (
  1201      id uuid NOT NULL,
  1202      resource_id text,
  1203      created_at timestamp with time zone,
  1204      updated_at timestamp with time zone,
  1205      CONSTRAINT "resource_id not empty" CHECK (((resource_id = NULL::text) OR (char_length(resource_id) > 0)))
  1206  );
  1207  
  1208  
  1209  ALTER TABLE auth.sso_providers OWNER TO supabase_auth_admin;
  1210  
  1211  --
  1212  -- Name: TABLE sso_providers; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  1213  --
  1214  
  1215  COMMENT ON TABLE auth.sso_providers IS 'Auth: Manages SSO identity provider information; see saml_providers for SAML.';
  1216  
  1217  
  1218  --
  1219  -- Name: COLUMN sso_providers.resource_id; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  1220  --
  1221  
  1222  COMMENT ON COLUMN auth.sso_providers.resource_id IS 'Auth: Uniquely identifies a SSO provider according to a user-chosen resource ID (case insensitive), useful in infrastructure as code.';
  1223  
  1224  
  1225  --
  1226  -- Name: users; Type: TABLE; Schema: auth; Owner: supabase_auth_admin
  1227  --
  1228  
  1229  CREATE TABLE IF NOT EXISTS auth.users (
  1230      instance_id uuid,
  1231      id uuid NOT NULL,
  1232      aud character varying(255),
  1233      role character varying(255),
  1234      email character varying(255),
  1235      encrypted_password character varying(255),
  1236      email_confirmed_at timestamp with time zone,
  1237      invited_at timestamp with time zone,
  1238      confirmation_token character varying(255),
  1239      confirmation_sent_at timestamp with time zone,
  1240      recovery_token character varying(255),
  1241      recovery_sent_at timestamp with time zone,
  1242      email_change_token_new character varying(255),
  1243      email_change character varying(255),
  1244      email_change_sent_at timestamp with time zone,
  1245      last_sign_in_at timestamp with time zone,
  1246      raw_app_meta_data jsonb,
  1247      raw_user_meta_data jsonb,
  1248      is_super_admin boolean,
  1249      created_at timestamp with time zone,
  1250      updated_at timestamp with time zone,
  1251      phone text DEFAULT NULL::character varying,
  1252      phone_confirmed_at timestamp with time zone,
  1253      phone_change text DEFAULT ''::character varying,
  1254      phone_change_token character varying(255) DEFAULT ''::character varying,
  1255      phone_change_sent_at timestamp with time zone,
  1256      confirmed_at timestamp with time zone GENERATED ALWAYS AS (LEAST(email_confirmed_at, phone_confirmed_at)) STORED,
  1257      email_change_token_current character varying(255) DEFAULT ''::character varying,
  1258      email_change_confirm_status smallint DEFAULT 0,
  1259      banned_until timestamp with time zone,
  1260      reauthentication_token character varying(255) DEFAULT ''::character varying,
  1261      reauthentication_sent_at timestamp with time zone,
  1262      is_sso_user boolean DEFAULT false NOT NULL,
  1263      deleted_at timestamp with time zone,
  1264      CONSTRAINT users_email_change_confirm_status_check CHECK (((email_change_confirm_status >= 0) AND (email_change_confirm_status <= 2)))
  1265  );
  1266  
  1267  
  1268  ALTER TABLE auth.users OWNER TO supabase_auth_admin;
  1269  
  1270  --
  1271  -- Name: TABLE users; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  1272  --
  1273  
  1274  COMMENT ON TABLE auth.users IS 'Auth: Stores user login data within a secure schema.';
  1275  
  1276  
  1277  --
  1278  -- Name: COLUMN users.is_sso_user; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  1279  --
  1280  
  1281  COMMENT ON COLUMN auth.users.is_sso_user IS 'Auth: Set this column to true when the account comes from SSO. These accounts can have duplicate emails.';
  1282  
  1283  
  1284  --
  1285  -- Name: buckets; Type: TABLE; Schema: storage; Owner: supabase_storage_admin
  1286  --
  1287  
  1288  CREATE TABLE IF NOT EXISTS storage.buckets (
  1289      id text NOT NULL,
  1290      name text NOT NULL,
  1291      owner uuid,
  1292      created_at timestamp with time zone DEFAULT now(),
  1293      updated_at timestamp with time zone DEFAULT now(),
  1294      public boolean DEFAULT false,
  1295      avif_autodetection boolean DEFAULT false,
  1296      file_size_limit bigint,
  1297      allowed_mime_types text[],
  1298      owner_id text
  1299  );
  1300  
  1301  
  1302  ALTER TABLE storage.buckets OWNER TO supabase_storage_admin;
  1303  
  1304  --
  1305  -- Name: COLUMN buckets.owner; Type: COMMENT; Schema: storage; Owner: supabase_storage_admin
  1306  --
  1307  
  1308  COMMENT ON COLUMN storage.buckets.owner IS 'Field is deprecated, use owner_id instead';
  1309  
  1310  
  1311  --
  1312  -- Name: migrations; Type: TABLE; Schema: storage; Owner: supabase_storage_admin
  1313  --
  1314  
  1315  CREATE TABLE IF NOT EXISTS storage.migrations (
  1316      id integer NOT NULL,
  1317      name character varying(100) NOT NULL,
  1318      hash character varying(40) NOT NULL,
  1319      executed_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP
  1320  );
  1321  
  1322  
  1323  ALTER TABLE storage.migrations OWNER TO supabase_storage_admin;
  1324  
  1325  --
  1326  -- Name: objects; Type: TABLE; Schema: storage; Owner: supabase_storage_admin
  1327  --
  1328  
  1329  CREATE TABLE IF NOT EXISTS storage.objects (
  1330      id uuid DEFAULT extensions.uuid_generate_v4() NOT NULL,
  1331      bucket_id text,
  1332      name text,
  1333      owner uuid,
  1334      created_at timestamp with time zone DEFAULT now(),
  1335      updated_at timestamp with time zone DEFAULT now(),
  1336      last_accessed_at timestamp with time zone DEFAULT now(),
  1337      metadata jsonb,
  1338      path_tokens text[] GENERATED ALWAYS AS (string_to_array(name, '/'::text)) STORED,
  1339      version text,
  1340      owner_id text
  1341  );
  1342  
  1343  
  1344  ALTER TABLE storage.objects OWNER TO supabase_storage_admin;
  1345  
  1346  --
  1347  -- Name: COLUMN objects.owner; Type: COMMENT; Schema: storage; Owner: supabase_storage_admin
  1348  --
  1349  
  1350  COMMENT ON COLUMN storage.objects.owner IS 'Field is deprecated, use owner_id instead';
  1351  
  1352  
  1353  --
  1354  -- Name: refresh_tokens id; Type: DEFAULT; Schema: auth; Owner: supabase_auth_admin
  1355  --
  1356  
  1357  ALTER TABLE ONLY auth.refresh_tokens ALTER COLUMN id SET DEFAULT nextval('auth.refresh_tokens_id_seq'::regclass);
  1358  
  1359  
  1360  --
  1361  -- Data for Name: extensions; Type: TABLE DATA; Schema: _realtime; Owner: postgres
  1362  --
  1363  
  1364  INSERT INTO _realtime.extensions (id, type, settings, tenant_external_id, inserted_at, updated_at) VALUES ('5518e2da-548e-499c-ab1c-664fd6446714', 'postgres_cdc_rls', '{"region": "us-east-1", "db_host": "ABK7kBu27y/PVdL10i/b+A==", "db_name": "sWBpZNdjggEPTQVlI52Zfw==", "db_port": "+enMDFi1J/3IrrquHHwUmA==", "db_user": "uxbEq/zz8DXVD53TOI1zmw==", "slot_name": "supabase_realtime_replication_slot", "ip_version": 4, "db_password": "sWBpZNdjggEPTQVlI52Zfw==", "publication": "supabase_realtime", "ssl_enforced": false, "poll_interval_ms": 100, "poll_max_changes": 100, "poll_max_record_bytes": 1048576}', 'realtime-dev', '2023-12-12 15:25:21', '2023-12-12 15:25:21');
  1365  
  1366  
  1367  --
  1368  -- Data for Name: schema_migrations; Type: TABLE DATA; Schema: _realtime; Owner: postgres
  1369  --
  1370  
  1371  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20210706140551, '2023-01-09 07:15:13');
  1372  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220329161857, '2023-01-09 07:15:13');
  1373  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220410212326, '2023-01-09 07:15:13');
  1374  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220506102948, '2023-01-09 07:15:13');
  1375  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220527210857, '2023-01-09 07:15:13');
  1376  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220815211129, '2023-01-09 07:15:13');
  1377  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220815215024, '2023-01-09 07:15:13');
  1378  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220818141501, '2023-01-09 07:15:13');
  1379  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221018173709, '2023-01-09 07:15:13');
  1380  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221102172703, '2023-01-09 07:15:13');
  1381  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221223010058, '2023-01-09 07:15:13');
  1382  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20230110180046, '2023-04-06 09:25:28');
  1383  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20230810220907, '2023-12-12 15:25:19');
  1384  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20230810220924, '2023-12-12 15:25:19');
  1385  INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20231024094642, '2023-12-12 15:25:19');
  1386  
  1387  
  1388  --
  1389  -- Data for Name: tenants; Type: TABLE DATA; Schema: _realtime; Owner: postgres
  1390  --
  1391  
  1392  INSERT INTO _realtime.tenants (id, name, external_id, jwt_secret, max_concurrent_users, inserted_at, updated_at, max_events_per_second, postgres_cdc_default, max_bytes_per_second, max_channels_per_client, max_joins_per_second, suspend) VALUES ('e6edd492-6586-4c5d-9c2e-4e4de2e5c64d', 'realtime-dev', 'realtime-dev', 'iNjicxc4+llvc9wovDvqymwfnj9teWMlyOIbJ8Fh6j2WNU8CIJ2ZgjR6MUIKqSmeDmvpsKLsZ9jgXJmQPpwL8w==', 200, '2023-12-12 15:25:21', '2023-12-12 15:25:21', 100, 'postgres_cdc_rls', 100000, 100, 100, false);
  1393  
  1394  
  1395  --
  1396  -- Data for Name: audit_log_entries; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1397  --
  1398  
  1399  
  1400  
  1401  --
  1402  -- Data for Name: flow_state; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1403  --
  1404  
  1405  
  1406  
  1407  --
  1408  -- Data for Name: identities; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1409  --
  1410  
  1411  
  1412  
  1413  --
  1414  -- Data for Name: instances; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1415  --
  1416  
  1417  
  1418  
  1419  --
  1420  -- Data for Name: mfa_amr_claims; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1421  --
  1422  
  1423  
  1424  
  1425  --
  1426  -- Data for Name: mfa_challenges; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1427  --
  1428  
  1429  
  1430  
  1431  --
  1432  -- Data for Name: mfa_factors; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1433  --
  1434  
  1435  
  1436  
  1437  --
  1438  -- Data for Name: refresh_tokens; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1439  --
  1440  
  1441  
  1442  
  1443  --
  1444  -- Data for Name: saml_providers; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1445  --
  1446  
  1447  
  1448  
  1449  --
  1450  -- Data for Name: saml_relay_states; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1451  --
  1452  
  1453  
  1454  
  1455  --
  1456  -- Data for Name: schema_migrations; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1457  --
  1458  
  1459  INSERT INTO auth.schema_migrations (version) VALUES ('20171026211738');
  1460  INSERT INTO auth.schema_migrations (version) VALUES ('20171026211808');
  1461  INSERT INTO auth.schema_migrations (version) VALUES ('20171026211834');
  1462  INSERT INTO auth.schema_migrations (version) VALUES ('20180103212743');
  1463  INSERT INTO auth.schema_migrations (version) VALUES ('20180108183307');
  1464  INSERT INTO auth.schema_migrations (version) VALUES ('20180119214651');
  1465  INSERT INTO auth.schema_migrations (version) VALUES ('20180125194653');
  1466  INSERT INTO auth.schema_migrations (version) VALUES ('00');
  1467  INSERT INTO auth.schema_migrations (version) VALUES ('20210710035447');
  1468  INSERT INTO auth.schema_migrations (version) VALUES ('20210722035447');
  1469  INSERT INTO auth.schema_migrations (version) VALUES ('20210730183235');
  1470  INSERT INTO auth.schema_migrations (version) VALUES ('20210909172000');
  1471  INSERT INTO auth.schema_migrations (version) VALUES ('20210927181326');
  1472  INSERT INTO auth.schema_migrations (version) VALUES ('20211122151130');
  1473  INSERT INTO auth.schema_migrations (version) VALUES ('20211124214934');
  1474  INSERT INTO auth.schema_migrations (version) VALUES ('20211202183645');
  1475  INSERT INTO auth.schema_migrations (version) VALUES ('20220114185221');
  1476  INSERT INTO auth.schema_migrations (version) VALUES ('20220114185340');
  1477  INSERT INTO auth.schema_migrations (version) VALUES ('20220224000811');
  1478  INSERT INTO auth.schema_migrations (version) VALUES ('20220323170000');
  1479  INSERT INTO auth.schema_migrations (version) VALUES ('20220429102000');
  1480  INSERT INTO auth.schema_migrations (version) VALUES ('20220531120530');
  1481  INSERT INTO auth.schema_migrations (version) VALUES ('20220614074223');
  1482  INSERT INTO auth.schema_migrations (version) VALUES ('20220811173540');
  1483  INSERT INTO auth.schema_migrations (version) VALUES ('20221003041349');
  1484  INSERT INTO auth.schema_migrations (version) VALUES ('20221003041400');
  1485  INSERT INTO auth.schema_migrations (version) VALUES ('20221011041400');
  1486  INSERT INTO auth.schema_migrations (version) VALUES ('20221020193600');
  1487  INSERT INTO auth.schema_migrations (version) VALUES ('20221021073300');
  1488  INSERT INTO auth.schema_migrations (version) VALUES ('20221021082433');
  1489  INSERT INTO auth.schema_migrations (version) VALUES ('20221027105023');
  1490  INSERT INTO auth.schema_migrations (version) VALUES ('20221114143122');
  1491  INSERT INTO auth.schema_migrations (version) VALUES ('20221114143410');
  1492  INSERT INTO auth.schema_migrations (version) VALUES ('20221125140132');
  1493  INSERT INTO auth.schema_migrations (version) VALUES ('20221208132122');
  1494  INSERT INTO auth.schema_migrations (version) VALUES ('20221215195500');
  1495  INSERT INTO auth.schema_migrations (version) VALUES ('20221215195800');
  1496  INSERT INTO auth.schema_migrations (version) VALUES ('20221215195900');
  1497  INSERT INTO auth.schema_migrations (version) VALUES ('20230116124310');
  1498  INSERT INTO auth.schema_migrations (version) VALUES ('20230116124412');
  1499  INSERT INTO auth.schema_migrations (version) VALUES ('20230131181311');
  1500  INSERT INTO auth.schema_migrations (version) VALUES ('20230322519590');
  1501  INSERT INTO auth.schema_migrations (version) VALUES ('20230402418590');
  1502  INSERT INTO auth.schema_migrations (version) VALUES ('20230411005111');
  1503  INSERT INTO auth.schema_migrations (version) VALUES ('20230508135423');
  1504  INSERT INTO auth.schema_migrations (version) VALUES ('20230523124323');
  1505  INSERT INTO auth.schema_migrations (version) VALUES ('20230818113222');
  1506  INSERT INTO auth.schema_migrations (version) VALUES ('20230914180801');
  1507  INSERT INTO auth.schema_migrations (version) VALUES ('20231027141322');
  1508  INSERT INTO auth.schema_migrations (version) VALUES ('20231114161723');
  1509  INSERT INTO auth.schema_migrations (version) VALUES ('20231117164230');
  1510  
  1511  
  1512  --
  1513  -- Data for Name: sessions; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1514  --
  1515  
  1516  
  1517  
  1518  --
  1519  -- Data for Name: sso_domains; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1520  --
  1521  
  1522  
  1523  
  1524  --
  1525  -- Data for Name: sso_providers; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1526  --
  1527  
  1528  
  1529  
  1530  --
  1531  -- Data for Name: users; Type: TABLE DATA; Schema: auth; Owner: supabase_auth_admin
  1532  --
  1533  
  1534  
  1535  
  1536  --
  1537  -- Data for Name: buckets; Type: TABLE DATA; Schema: storage; Owner: supabase_storage_admin
  1538  --
  1539  
  1540  
  1541  
  1542  --
  1543  -- Data for Name: migrations; Type: TABLE DATA; Schema: storage; Owner: supabase_storage_admin
  1544  --
  1545  
  1546  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (0, 'create-migrations-table', 'e18db593bcde2aca2a408c4d1100f6abba2195df', '2022-04-14 09:52:39.214681');
  1547  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (1, 'initialmigration', '6ab16121fbaa08bbd11b712d05f358f9b555d777', '2022-04-14 09:52:39.255149');
  1548  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (2, 'pathtoken-column', '49756be03be4c17bb85fe70d4a861f27de7e49ad', '2022-04-14 09:52:39.276667');
  1549  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (3, 'add-migrations-rls', 'bb5d124c53d68635a883e399426c6a5a25fc893d', '2022-04-14 09:52:39.587158');
  1550  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (4, 'add-size-functions', '6d79007d04f5acd288c9c250c42d2d5fd286c54d', '2022-04-14 09:52:39.621747');
  1551  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (5, 'change-column-name-in-get-size', 'fd65688505d2ffa9fbdc58a944348dd8604d688c', '2022-04-14 09:52:39.658796');
  1552  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (6, 'add-rls-to-buckets', '63e2bab75a2040fee8e3fb3f15a0d26f3380e9b6', '2022-04-14 09:52:39.702011');
  1553  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (7, 'add-public-to-buckets', '82568934f8a4d9e0a85f126f6fb483ad8214c418', '2022-04-14 09:52:39.739731');
  1554  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (8, 'fix-search-function', '1a43a40eddb525f2e2f26efd709e6c06e58e059c', '2022-04-14 09:52:39.781062');
  1555  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (9, 'search-files-search-function', '34c096597eb8b9d077fdfdde9878c88501b2fafc', '2022-08-23 04:48:07.728336');
  1556  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (10, 'add-trigger-to-auto-update-updated_at-column', '37d6bb964a70a822e6d37f22f457b9bca7885928', '2022-08-23 04:48:07.736527');
  1557  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (11, 'add-automatic-avif-detection-flag', 'bd76c53a9c564c80d98d119c1b3a28e16c8152db', '2023-04-06 09:25:29.356743');
  1558  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (12, 'add-bucket-custom-limits', 'cbe0a4c32a0e891554a21020433b7a4423c07ee7', '2023-04-06 09:25:29.390303');
  1559  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (13, 'use-bytes-for-max-size', '7a158ebce8a0c2801c9c65b7e9b2f98f68b3874e', '2023-04-06 09:25:29.402124');
  1560  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (14, 'add-can-insert-object-function', '273193826bca7e0990b458d1ba72f8aa27c0d825', '2023-04-06 09:25:29.426206');
  1561  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (15, 'add-version', 'e821a779d26612899b8c2dfe20245f904a327c4f', '2023-04-06 09:25:29.439561');
  1562  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (16, 'drop-owner-foreign-key', '536b33f8878eed09d0144219777dcac96bdb25da', '2023-12-12 15:25:21.258059');
  1563  INSERT INTO storage.migrations (id, name, hash, executed_at) VALUES (17, 'add_owner_id_column_deprecate_owner', '7545f216a39358b5487df75d941d05dbcd75eb46', '2023-12-12 15:25:21.271667');
  1564  
  1565  
  1566  --
  1567  -- Data for Name: objects; Type: TABLE DATA; Schema: storage; Owner: supabase_storage_admin
  1568  --
  1569  
  1570  
  1571  
  1572  --
  1573  -- Name: refresh_tokens_id_seq; Type: SEQUENCE SET; Schema: auth; Owner: supabase_auth_admin
  1574  --
  1575  
  1576  SELECT pg_catalog.setval('auth.refresh_tokens_id_seq', 1, false);
  1577  
  1578  
  1579  --
  1580  -- Name: extensions extensions_pkey; Type: CONSTRAINT; Schema: _realtime; Owner: postgres
  1581  --
  1582  
  1583  ALTER TABLE ONLY _realtime.extensions
  1584      ADD CONSTRAINT extensions_pkey PRIMARY KEY (id);
  1585  
  1586  
  1587  --
  1588  -- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: _realtime; Owner: postgres
  1589  --
  1590  
  1591  ALTER TABLE ONLY _realtime.schema_migrations
  1592      ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
  1593  
  1594  
  1595  --
  1596  -- Name: tenants tenants_pkey; Type: CONSTRAINT; Schema: _realtime; Owner: postgres
  1597  --
  1598  
  1599  ALTER TABLE ONLY _realtime.tenants
  1600      ADD CONSTRAINT tenants_pkey PRIMARY KEY (id);
  1601  
  1602  
  1603  --
  1604  -- Name: mfa_amr_claims amr_id_pk; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1605  --
  1606  
  1607  ALTER TABLE ONLY auth.mfa_amr_claims
  1608      ADD CONSTRAINT amr_id_pk PRIMARY KEY (id);
  1609  
  1610  
  1611  --
  1612  -- Name: audit_log_entries audit_log_entries_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1613  --
  1614  
  1615  ALTER TABLE ONLY auth.audit_log_entries
  1616      ADD CONSTRAINT audit_log_entries_pkey PRIMARY KEY (id);
  1617  
  1618  
  1619  --
  1620  -- Name: flow_state flow_state_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1621  --
  1622  
  1623  ALTER TABLE ONLY auth.flow_state
  1624      ADD CONSTRAINT flow_state_pkey PRIMARY KEY (id);
  1625  
  1626  
  1627  --
  1628  -- Name: identities identities_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1629  --
  1630  
  1631  ALTER TABLE ONLY auth.identities
  1632      ADD CONSTRAINT identities_pkey PRIMARY KEY (id);
  1633  
  1634  
  1635  --
  1636  -- Name: identities identities_provider_id_provider_unique; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1637  --
  1638  
  1639  ALTER TABLE ONLY auth.identities
  1640      ADD CONSTRAINT identities_provider_id_provider_unique UNIQUE (provider_id, provider);
  1641  
  1642  
  1643  --
  1644  -- Name: instances instances_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1645  --
  1646  
  1647  ALTER TABLE ONLY auth.instances
  1648      ADD CONSTRAINT instances_pkey PRIMARY KEY (id);
  1649  
  1650  
  1651  --
  1652  -- Name: mfa_amr_claims mfa_amr_claims_session_id_authentication_method_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1653  --
  1654  
  1655  ALTER TABLE ONLY auth.mfa_amr_claims
  1656      ADD CONSTRAINT mfa_amr_claims_session_id_authentication_method_pkey UNIQUE (session_id, authentication_method);
  1657  
  1658  
  1659  --
  1660  -- Name: mfa_challenges mfa_challenges_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1661  --
  1662  
  1663  ALTER TABLE ONLY auth.mfa_challenges
  1664      ADD CONSTRAINT mfa_challenges_pkey PRIMARY KEY (id);
  1665  
  1666  
  1667  --
  1668  -- Name: mfa_factors mfa_factors_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1669  --
  1670  
  1671  ALTER TABLE ONLY auth.mfa_factors
  1672      ADD CONSTRAINT mfa_factors_pkey PRIMARY KEY (id);
  1673  
  1674  
  1675  --
  1676  -- Name: refresh_tokens refresh_tokens_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1677  --
  1678  
  1679  ALTER TABLE ONLY auth.refresh_tokens
  1680      ADD CONSTRAINT refresh_tokens_pkey PRIMARY KEY (id);
  1681  
  1682  
  1683  --
  1684  -- Name: refresh_tokens refresh_tokens_token_unique; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1685  --
  1686  
  1687  ALTER TABLE ONLY auth.refresh_tokens
  1688      ADD CONSTRAINT refresh_tokens_token_unique UNIQUE (token);
  1689  
  1690  
  1691  --
  1692  -- Name: saml_providers saml_providers_entity_id_key; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1693  --
  1694  
  1695  ALTER TABLE ONLY auth.saml_providers
  1696      ADD CONSTRAINT saml_providers_entity_id_key UNIQUE (entity_id);
  1697  
  1698  
  1699  --
  1700  -- Name: saml_providers saml_providers_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1701  --
  1702  
  1703  ALTER TABLE ONLY auth.saml_providers
  1704      ADD CONSTRAINT saml_providers_pkey PRIMARY KEY (id);
  1705  
  1706  
  1707  --
  1708  -- Name: saml_relay_states saml_relay_states_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1709  --
  1710  
  1711  ALTER TABLE ONLY auth.saml_relay_states
  1712      ADD CONSTRAINT saml_relay_states_pkey PRIMARY KEY (id);
  1713  
  1714  
  1715  --
  1716  -- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1717  --
  1718  
  1719  ALTER TABLE ONLY auth.schema_migrations
  1720      ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
  1721  
  1722  
  1723  --
  1724  -- Name: sessions sessions_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1725  --
  1726  
  1727  ALTER TABLE ONLY auth.sessions
  1728      ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);
  1729  
  1730  
  1731  --
  1732  -- Name: sso_domains sso_domains_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1733  --
  1734  
  1735  ALTER TABLE ONLY auth.sso_domains
  1736      ADD CONSTRAINT sso_domains_pkey PRIMARY KEY (id);
  1737  
  1738  
  1739  --
  1740  -- Name: sso_providers sso_providers_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1741  --
  1742  
  1743  ALTER TABLE ONLY auth.sso_providers
  1744      ADD CONSTRAINT sso_providers_pkey PRIMARY KEY (id);
  1745  
  1746  
  1747  --
  1748  -- Name: users users_phone_key; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1749  --
  1750  
  1751  ALTER TABLE ONLY auth.users
  1752      ADD CONSTRAINT users_phone_key UNIQUE (phone);
  1753  
  1754  
  1755  --
  1756  -- Name: users users_pkey; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  1757  --
  1758  
  1759  ALTER TABLE ONLY auth.users
  1760      ADD CONSTRAINT users_pkey PRIMARY KEY (id);
  1761  
  1762  
  1763  --
  1764  -- Name: buckets buckets_pkey; Type: CONSTRAINT; Schema: storage; Owner: supabase_storage_admin
  1765  --
  1766  
  1767  ALTER TABLE ONLY storage.buckets
  1768      ADD CONSTRAINT buckets_pkey PRIMARY KEY (id);
  1769  
  1770  
  1771  --
  1772  -- Name: migrations migrations_name_key; Type: CONSTRAINT; Schema: storage; Owner: supabase_storage_admin
  1773  --
  1774  
  1775  ALTER TABLE ONLY storage.migrations
  1776      ADD CONSTRAINT migrations_name_key UNIQUE (name);
  1777  
  1778  
  1779  --
  1780  -- Name: migrations migrations_pkey; Type: CONSTRAINT; Schema: storage; Owner: supabase_storage_admin
  1781  --
  1782  
  1783  ALTER TABLE ONLY storage.migrations
  1784      ADD CONSTRAINT migrations_pkey PRIMARY KEY (id);
  1785  
  1786  
  1787  --
  1788  -- Name: objects objects_pkey; Type: CONSTRAINT; Schema: storage; Owner: supabase_storage_admin
  1789  --
  1790  
  1791  ALTER TABLE ONLY storage.objects
  1792      ADD CONSTRAINT objects_pkey PRIMARY KEY (id);
  1793  
  1794  
  1795  --
  1796  -- Name: extensions_tenant_external_id_type_index; Type: INDEX; Schema: _realtime; Owner: postgres
  1797  --
  1798  
  1799  CREATE UNIQUE INDEX extensions_tenant_external_id_type_index ON _realtime.extensions USING btree (tenant_external_id, type);
  1800  
  1801  
  1802  --
  1803  -- Name: tenants_external_id_index; Type: INDEX; Schema: _realtime; Owner: postgres
  1804  --
  1805  
  1806  CREATE UNIQUE INDEX tenants_external_id_index ON _realtime.tenants USING btree (external_id);
  1807  
  1808  
  1809  --
  1810  -- Name: audit_logs_instance_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1811  --
  1812  
  1813  CREATE INDEX audit_logs_instance_id_idx ON auth.audit_log_entries USING btree (instance_id);
  1814  
  1815  
  1816  --
  1817  -- Name: confirmation_token_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1818  --
  1819  
  1820  CREATE UNIQUE INDEX confirmation_token_idx ON auth.users USING btree (confirmation_token) WHERE ((confirmation_token)::text !~ '^[0-9 ]*$'::text);
  1821  
  1822  
  1823  --
  1824  -- Name: email_change_token_current_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1825  --
  1826  
  1827  CREATE UNIQUE INDEX email_change_token_current_idx ON auth.users USING btree (email_change_token_current) WHERE ((email_change_token_current)::text !~ '^[0-9 ]*$'::text);
  1828  
  1829  
  1830  --
  1831  -- Name: email_change_token_new_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1832  --
  1833  
  1834  CREATE UNIQUE INDEX email_change_token_new_idx ON auth.users USING btree (email_change_token_new) WHERE ((email_change_token_new)::text !~ '^[0-9 ]*$'::text);
  1835  
  1836  
  1837  --
  1838  -- Name: factor_id_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1839  --
  1840  
  1841  CREATE INDEX factor_id_created_at_idx ON auth.mfa_factors USING btree (user_id, created_at);
  1842  
  1843  
  1844  --
  1845  -- Name: flow_state_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1846  --
  1847  
  1848  CREATE INDEX flow_state_created_at_idx ON auth.flow_state USING btree (created_at DESC);
  1849  
  1850  
  1851  --
  1852  -- Name: identities_email_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1853  --
  1854  
  1855  CREATE INDEX identities_email_idx ON auth.identities USING btree (email text_pattern_ops);
  1856  
  1857  
  1858  --
  1859  -- Name: INDEX identities_email_idx; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  1860  --
  1861  
  1862  COMMENT ON INDEX auth.identities_email_idx IS 'Auth: Ensures indexed queries on the email column';
  1863  
  1864  
  1865  --
  1866  -- Name: identities_user_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1867  --
  1868  
  1869  CREATE INDEX identities_user_id_idx ON auth.identities USING btree (user_id);
  1870  
  1871  
  1872  --
  1873  -- Name: idx_auth_code; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1874  --
  1875  
  1876  CREATE INDEX idx_auth_code ON auth.flow_state USING btree (auth_code);
  1877  
  1878  
  1879  --
  1880  -- Name: idx_user_id_auth_method; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1881  --
  1882  
  1883  CREATE INDEX idx_user_id_auth_method ON auth.flow_state USING btree (user_id, authentication_method);
  1884  
  1885  
  1886  --
  1887  -- Name: mfa_challenge_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1888  --
  1889  
  1890  CREATE INDEX mfa_challenge_created_at_idx ON auth.mfa_challenges USING btree (created_at DESC);
  1891  
  1892  
  1893  --
  1894  -- Name: mfa_factors_user_friendly_name_unique; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1895  --
  1896  
  1897  CREATE UNIQUE INDEX mfa_factors_user_friendly_name_unique ON auth.mfa_factors USING btree (friendly_name, user_id) WHERE (btrim(friendly_name) <> ''::text);
  1898  
  1899  
  1900  --
  1901  -- Name: mfa_factors_user_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1902  --
  1903  
  1904  CREATE INDEX mfa_factors_user_id_idx ON auth.mfa_factors USING btree (user_id);
  1905  
  1906  
  1907  --
  1908  -- Name: reauthentication_token_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1909  --
  1910  
  1911  CREATE UNIQUE INDEX reauthentication_token_idx ON auth.users USING btree (reauthentication_token) WHERE ((reauthentication_token)::text !~ '^[0-9 ]*$'::text);
  1912  
  1913  
  1914  --
  1915  -- Name: recovery_token_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1916  --
  1917  
  1918  CREATE UNIQUE INDEX recovery_token_idx ON auth.users USING btree (recovery_token) WHERE ((recovery_token)::text !~ '^[0-9 ]*$'::text);
  1919  
  1920  
  1921  --
  1922  -- Name: refresh_tokens_instance_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1923  --
  1924  
  1925  CREATE INDEX refresh_tokens_instance_id_idx ON auth.refresh_tokens USING btree (instance_id);
  1926  
  1927  
  1928  --
  1929  -- Name: refresh_tokens_instance_id_user_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1930  --
  1931  
  1932  CREATE INDEX refresh_tokens_instance_id_user_id_idx ON auth.refresh_tokens USING btree (instance_id, user_id);
  1933  
  1934  
  1935  --
  1936  -- Name: refresh_tokens_parent_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1937  --
  1938  
  1939  CREATE INDEX refresh_tokens_parent_idx ON auth.refresh_tokens USING btree (parent);
  1940  
  1941  
  1942  --
  1943  -- Name: refresh_tokens_session_id_revoked_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1944  --
  1945  
  1946  CREATE INDEX refresh_tokens_session_id_revoked_idx ON auth.refresh_tokens USING btree (session_id, revoked);
  1947  
  1948  
  1949  --
  1950  -- Name: refresh_tokens_updated_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1951  --
  1952  
  1953  CREATE INDEX refresh_tokens_updated_at_idx ON auth.refresh_tokens USING btree (updated_at DESC);
  1954  
  1955  
  1956  --
  1957  -- Name: saml_providers_sso_provider_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1958  --
  1959  
  1960  CREATE INDEX saml_providers_sso_provider_id_idx ON auth.saml_providers USING btree (sso_provider_id);
  1961  
  1962  
  1963  --
  1964  -- Name: saml_relay_states_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1965  --
  1966  
  1967  CREATE INDEX saml_relay_states_created_at_idx ON auth.saml_relay_states USING btree (created_at DESC);
  1968  
  1969  
  1970  --
  1971  -- Name: saml_relay_states_for_email_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1972  --
  1973  
  1974  CREATE INDEX saml_relay_states_for_email_idx ON auth.saml_relay_states USING btree (for_email);
  1975  
  1976  
  1977  --
  1978  -- Name: saml_relay_states_sso_provider_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1979  --
  1980  
  1981  CREATE INDEX saml_relay_states_sso_provider_id_idx ON auth.saml_relay_states USING btree (sso_provider_id);
  1982  
  1983  
  1984  --
  1985  -- Name: sessions_not_after_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1986  --
  1987  
  1988  CREATE INDEX sessions_not_after_idx ON auth.sessions USING btree (not_after DESC);
  1989  
  1990  
  1991  --
  1992  -- Name: sessions_user_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  1993  --
  1994  
  1995  CREATE INDEX sessions_user_id_idx ON auth.sessions USING btree (user_id);
  1996  
  1997  
  1998  --
  1999  -- Name: sso_domains_domain_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  2000  --
  2001  
  2002  CREATE UNIQUE INDEX sso_domains_domain_idx ON auth.sso_domains USING btree (lower(domain));
  2003  
  2004  
  2005  --
  2006  -- Name: sso_domains_sso_provider_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  2007  --
  2008  
  2009  CREATE INDEX sso_domains_sso_provider_id_idx ON auth.sso_domains USING btree (sso_provider_id);
  2010  
  2011  
  2012  --
  2013  -- Name: sso_providers_resource_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  2014  --
  2015  
  2016  CREATE UNIQUE INDEX sso_providers_resource_id_idx ON auth.sso_providers USING btree (lower(resource_id));
  2017  
  2018  
  2019  --
  2020  -- Name: user_id_created_at_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  2021  --
  2022  
  2023  CREATE INDEX user_id_created_at_idx ON auth.sessions USING btree (user_id, created_at);
  2024  
  2025  
  2026  --
  2027  -- Name: users_email_partial_key; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  2028  --
  2029  
  2030  CREATE UNIQUE INDEX users_email_partial_key ON auth.users USING btree (email) WHERE (is_sso_user = false);
  2031  
  2032  
  2033  --
  2034  -- Name: INDEX users_email_partial_key; Type: COMMENT; Schema: auth; Owner: supabase_auth_admin
  2035  --
  2036  
  2037  COMMENT ON INDEX auth.users_email_partial_key IS 'Auth: A partial unique index that applies only when is_sso_user is false';
  2038  
  2039  
  2040  --
  2041  -- Name: users_instance_id_email_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  2042  --
  2043  
  2044  CREATE INDEX users_instance_id_email_idx ON auth.users USING btree (instance_id, lower((email)::text));
  2045  
  2046  
  2047  --
  2048  -- Name: users_instance_id_idx; Type: INDEX; Schema: auth; Owner: supabase_auth_admin
  2049  --
  2050  
  2051  CREATE INDEX users_instance_id_idx ON auth.users USING btree (instance_id);
  2052  
  2053  
  2054  --
  2055  -- Name: bname; Type: INDEX; Schema: storage; Owner: supabase_storage_admin
  2056  --
  2057  
  2058  CREATE UNIQUE INDEX bname ON storage.buckets USING btree (name);
  2059  
  2060  
  2061  --
  2062  -- Name: bucketid_objname; Type: INDEX; Schema: storage; Owner: supabase_storage_admin
  2063  --
  2064  
  2065  CREATE UNIQUE INDEX bucketid_objname ON storage.objects USING btree (bucket_id, name);
  2066  
  2067  
  2068  --
  2069  -- Name: name_prefix_search; Type: INDEX; Schema: storage; Owner: supabase_storage_admin
  2070  --
  2071  
  2072  CREATE INDEX name_prefix_search ON storage.objects USING btree (name text_pattern_ops);
  2073  
  2074  
  2075  --
  2076  -- Name: objects update_objects_updated_at; Type: TRIGGER; Schema: storage; Owner: supabase_storage_admin
  2077  --
  2078  
  2079  CREATE TRIGGER update_objects_updated_at BEFORE UPDATE ON storage.objects FOR EACH ROW EXECUTE FUNCTION storage.update_updated_at_column();
  2080  
  2081  
  2082  --
  2083  -- Name: extensions extensions_tenant_external_id_fkey; Type: FK CONSTRAINT; Schema: _realtime; Owner: postgres
  2084  --
  2085  
  2086  ALTER TABLE ONLY _realtime.extensions
  2087      ADD CONSTRAINT extensions_tenant_external_id_fkey FOREIGN KEY (tenant_external_id) REFERENCES _realtime.tenants(external_id) ON DELETE CASCADE;
  2088  
  2089  
  2090  --
  2091  -- Name: identities identities_user_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  2092  --
  2093  
  2094  ALTER TABLE ONLY auth.identities
  2095      ADD CONSTRAINT identities_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE;
  2096  
  2097  
  2098  --
  2099  -- Name: mfa_amr_claims mfa_amr_claims_session_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  2100  --
  2101  
  2102  ALTER TABLE ONLY auth.mfa_amr_claims
  2103      ADD CONSTRAINT mfa_amr_claims_session_id_fkey FOREIGN KEY (session_id) REFERENCES auth.sessions(id) ON DELETE CASCADE;
  2104  
  2105  
  2106  --
  2107  -- Name: mfa_challenges mfa_challenges_auth_factor_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  2108  --
  2109  
  2110  ALTER TABLE ONLY auth.mfa_challenges
  2111      ADD CONSTRAINT mfa_challenges_auth_factor_id_fkey FOREIGN KEY (factor_id) REFERENCES auth.mfa_factors(id) ON DELETE CASCADE;
  2112  
  2113  
  2114  --
  2115  -- Name: mfa_factors mfa_factors_user_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  2116  --
  2117  
  2118  ALTER TABLE ONLY auth.mfa_factors
  2119      ADD CONSTRAINT mfa_factors_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE;
  2120  
  2121  
  2122  --
  2123  -- Name: refresh_tokens refresh_tokens_session_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  2124  --
  2125  
  2126  ALTER TABLE ONLY auth.refresh_tokens
  2127      ADD CONSTRAINT refresh_tokens_session_id_fkey FOREIGN KEY (session_id) REFERENCES auth.sessions(id) ON DELETE CASCADE;
  2128  
  2129  
  2130  --
  2131  -- Name: saml_providers saml_providers_sso_provider_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  2132  --
  2133  
  2134  ALTER TABLE ONLY auth.saml_providers
  2135      ADD CONSTRAINT saml_providers_sso_provider_id_fkey FOREIGN KEY (sso_provider_id) REFERENCES auth.sso_providers(id) ON DELETE CASCADE;
  2136  
  2137  
  2138  --
  2139  -- Name: saml_relay_states saml_relay_states_flow_state_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  2140  --
  2141  
  2142  ALTER TABLE ONLY auth.saml_relay_states
  2143      ADD CONSTRAINT saml_relay_states_flow_state_id_fkey FOREIGN KEY (flow_state_id) REFERENCES auth.flow_state(id) ON DELETE CASCADE;
  2144  
  2145  
  2146  --
  2147  -- Name: saml_relay_states saml_relay_states_sso_provider_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  2148  --
  2149  
  2150  ALTER TABLE ONLY auth.saml_relay_states
  2151      ADD CONSTRAINT saml_relay_states_sso_provider_id_fkey FOREIGN KEY (sso_provider_id) REFERENCES auth.sso_providers(id) ON DELETE CASCADE;
  2152  
  2153  
  2154  --
  2155  -- Name: sessions sessions_user_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  2156  --
  2157  
  2158  ALTER TABLE ONLY auth.sessions
  2159      ADD CONSTRAINT sessions_user_id_fkey FOREIGN KEY (user_id) REFERENCES auth.users(id) ON DELETE CASCADE;
  2160  
  2161  
  2162  --
  2163  -- Name: sso_domains sso_domains_sso_provider_id_fkey; Type: FK CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
  2164  --
  2165  
  2166  ALTER TABLE ONLY auth.sso_domains
  2167      ADD CONSTRAINT sso_domains_sso_provider_id_fkey FOREIGN KEY (sso_provider_id) REFERENCES auth.sso_providers(id) ON DELETE CASCADE;
  2168  
  2169  
  2170  --
  2171  -- Name: objects objects_bucketId_fkey; Type: FK CONSTRAINT; Schema: storage; Owner: supabase_storage_admin
  2172  --
  2173  
  2174  ALTER TABLE ONLY storage.objects
  2175      ADD CONSTRAINT "objects_bucketId_fkey" FOREIGN KEY (bucket_id) REFERENCES storage.buckets(id);
  2176  
  2177  
  2178  --
  2179  -- Name: buckets; Type: ROW SECURITY; Schema: storage; Owner: supabase_storage_admin
  2180  --
  2181  
  2182  ALTER TABLE storage.buckets ENABLE ROW LEVEL SECURITY;
  2183  
  2184  --
  2185  -- Name: migrations; Type: ROW SECURITY; Schema: storage; Owner: supabase_storage_admin
  2186  --
  2187  
  2188  ALTER TABLE storage.migrations ENABLE ROW LEVEL SECURITY;
  2189  
  2190  --
  2191  -- Name: objects; Type: ROW SECURITY; Schema: storage; Owner: supabase_storage_admin
  2192  --
  2193  
  2194  ALTER TABLE storage.objects ENABLE ROW LEVEL SECURITY;
  2195  
  2196  --
  2197  -- Name: supabase_realtime; Type: PUBLICATION; Schema: -; Owner: postgres
  2198  --
  2199  
  2200  CREATE PUBLICATION supabase_realtime WITH (publish = 'insert, update, delete, truncate');
  2201  
  2202  
  2203  ALTER PUBLICATION supabase_realtime OWNER TO postgres;
  2204  
  2205  --
  2206  -- Name: SCHEMA auth; Type: ACL; Schema: -; Owner: supabase_admin
  2207  --
  2208  
  2209  GRANT USAGE ON SCHEMA auth TO anon;
  2210  GRANT USAGE ON SCHEMA auth TO authenticated;
  2211  GRANT USAGE ON SCHEMA auth TO service_role;
  2212  GRANT ALL ON SCHEMA auth TO supabase_auth_admin;
  2213  GRANT ALL ON SCHEMA auth TO dashboard_user;
  2214  GRANT ALL ON SCHEMA auth TO postgres;
  2215  
  2216  
  2217  --
  2218  -- Name: SCHEMA extensions; Type: ACL; Schema: -; Owner: postgres
  2219  --
  2220  
  2221  GRANT USAGE ON SCHEMA extensions TO anon;
  2222  GRANT USAGE ON SCHEMA extensions TO authenticated;
  2223  GRANT USAGE ON SCHEMA extensions TO service_role;
  2224  GRANT ALL ON SCHEMA extensions TO dashboard_user;
  2225  
  2226  
  2227  --
  2228  -- Name: SCHEMA graphql_public; Type: ACL; Schema: -; Owner: supabase_admin
  2229  --
  2230  
  2231  GRANT USAGE ON SCHEMA graphql_public TO postgres;
  2232  GRANT USAGE ON SCHEMA graphql_public TO anon;
  2233  GRANT USAGE ON SCHEMA graphql_public TO authenticated;
  2234  GRANT USAGE ON SCHEMA graphql_public TO service_role;
  2235  
  2236  
  2237  --
  2238  -- Name: SCHEMA public; Type: ACL; Schema: -; Owner: postgres
  2239  --
  2240  
  2241  REVOKE USAGE ON SCHEMA public FROM PUBLIC;
  2242  GRANT ALL ON SCHEMA public TO PUBLIC;
  2243  GRANT USAGE ON SCHEMA public TO anon;
  2244  GRANT USAGE ON SCHEMA public TO authenticated;
  2245  GRANT USAGE ON SCHEMA public TO service_role;
  2246  
  2247  
  2248  --
  2249  -- Name: SCHEMA realtime; Type: ACL; Schema: -; Owner: supabase_admin
  2250  --
  2251  
  2252  GRANT USAGE ON SCHEMA realtime TO postgres;
  2253  
  2254  
  2255  --
  2256  -- Name: SCHEMA storage; Type: ACL; Schema: -; Owner: supabase_admin
  2257  --
  2258  
  2259  GRANT ALL ON SCHEMA storage TO postgres;
  2260  GRANT USAGE ON SCHEMA storage TO anon;
  2261  GRANT USAGE ON SCHEMA storage TO authenticated;
  2262  GRANT USAGE ON SCHEMA storage TO service_role;
  2263  GRANT ALL ON SCHEMA storage TO supabase_storage_admin;
  2264  GRANT ALL ON SCHEMA storage TO dashboard_user;
  2265  
  2266  
  2267  --
  2268  -- Name: FUNCTION email(); Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2269  --
  2270  
  2271  GRANT ALL ON FUNCTION auth.email() TO dashboard_user;
  2272  
  2273  
  2274  --
  2275  -- Name: FUNCTION jwt(); Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2276  --
  2277  
  2278  GRANT ALL ON FUNCTION auth.jwt() TO postgres;
  2279  GRANT ALL ON FUNCTION auth.jwt() TO dashboard_user;
  2280  
  2281  
  2282  --
  2283  -- Name: FUNCTION role(); Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2284  --
  2285  
  2286  GRANT ALL ON FUNCTION auth.role() TO dashboard_user;
  2287  
  2288  
  2289  --
  2290  -- Name: FUNCTION uid(); Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2291  --
  2292  
  2293  GRANT ALL ON FUNCTION auth.uid() TO dashboard_user;
  2294  
  2295  
  2296  --
  2297  -- Name: FUNCTION algorithm_sign(signables text, secret text, algorithm text); Type: ACL; Schema: extensions; Owner: postgres
  2298  --
  2299  
  2300  GRANT ALL ON FUNCTION extensions.algorithm_sign(signables text, secret text, algorithm text) TO dashboard_user;
  2301  
  2302  
  2303  --
  2304  -- Name: FUNCTION armor(bytea); Type: ACL; Schema: extensions; Owner: postgres
  2305  --
  2306  
  2307  GRANT ALL ON FUNCTION extensions.armor(bytea) TO dashboard_user;
  2308  
  2309  
  2310  --
  2311  -- Name: FUNCTION armor(bytea, text[], text[]); Type: ACL; Schema: extensions; Owner: postgres
  2312  --
  2313  
  2314  GRANT ALL ON FUNCTION extensions.armor(bytea, text[], text[]) TO dashboard_user;
  2315  
  2316  
  2317  --
  2318  -- Name: FUNCTION crypt(text, text); Type: ACL; Schema: extensions; Owner: postgres
  2319  --
  2320  
  2321  GRANT ALL ON FUNCTION extensions.crypt(text, text) TO dashboard_user;
  2322  
  2323  
  2324  --
  2325  -- Name: FUNCTION dearmor(text); Type: ACL; Schema: extensions; Owner: postgres
  2326  --
  2327  
  2328  GRANT ALL ON FUNCTION extensions.dearmor(text) TO dashboard_user;
  2329  
  2330  
  2331  --
  2332  -- Name: FUNCTION decrypt(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres
  2333  --
  2334  
  2335  GRANT ALL ON FUNCTION extensions.decrypt(bytea, bytea, text) TO dashboard_user;
  2336  
  2337  
  2338  --
  2339  -- Name: FUNCTION decrypt_iv(bytea, bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres
  2340  --
  2341  
  2342  GRANT ALL ON FUNCTION extensions.decrypt_iv(bytea, bytea, bytea, text) TO dashboard_user;
  2343  
  2344  
  2345  --
  2346  -- Name: FUNCTION digest(bytea, text); Type: ACL; Schema: extensions; Owner: postgres
  2347  --
  2348  
  2349  GRANT ALL ON FUNCTION extensions.digest(bytea, text) TO dashboard_user;
  2350  
  2351  
  2352  --
  2353  -- Name: FUNCTION digest(text, text); Type: ACL; Schema: extensions; Owner: postgres
  2354  --
  2355  
  2356  GRANT ALL ON FUNCTION extensions.digest(text, text) TO dashboard_user;
  2357  
  2358  
  2359  --
  2360  -- Name: FUNCTION encrypt(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres
  2361  --
  2362  
  2363  GRANT ALL ON FUNCTION extensions.encrypt(bytea, bytea, text) TO dashboard_user;
  2364  
  2365  
  2366  --
  2367  -- Name: FUNCTION encrypt_iv(bytea, bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres
  2368  --
  2369  
  2370  GRANT ALL ON FUNCTION extensions.encrypt_iv(bytea, bytea, bytea, text) TO dashboard_user;
  2371  
  2372  
  2373  --
  2374  -- Name: FUNCTION gen_random_bytes(integer); Type: ACL; Schema: extensions; Owner: postgres
  2375  --
  2376  
  2377  GRANT ALL ON FUNCTION extensions.gen_random_bytes(integer) TO dashboard_user;
  2378  
  2379  
  2380  --
  2381  -- Name: FUNCTION gen_random_uuid(); Type: ACL; Schema: extensions; Owner: postgres
  2382  --
  2383  
  2384  GRANT ALL ON FUNCTION extensions.gen_random_uuid() TO dashboard_user;
  2385  
  2386  
  2387  --
  2388  -- Name: FUNCTION gen_salt(text); Type: ACL; Schema: extensions; Owner: postgres
  2389  --
  2390  
  2391  GRANT ALL ON FUNCTION extensions.gen_salt(text) TO dashboard_user;
  2392  
  2393  
  2394  --
  2395  -- Name: FUNCTION gen_salt(text, integer); Type: ACL; Schema: extensions; Owner: postgres
  2396  --
  2397  
  2398  GRANT ALL ON FUNCTION extensions.gen_salt(text, integer) TO dashboard_user;
  2399  
  2400  
  2401  --
  2402  -- Name: FUNCTION grant_pg_cron_access(); Type: ACL; Schema: extensions; Owner: postgres
  2403  --
  2404  
  2405  GRANT ALL ON FUNCTION extensions.grant_pg_cron_access() TO dashboard_user;
  2406  
  2407  
  2408  --
  2409  -- Name: FUNCTION grant_pg_net_access(); Type: ACL; Schema: extensions; Owner: postgres
  2410  --
  2411  
  2412  GRANT ALL ON FUNCTION extensions.grant_pg_net_access() TO dashboard_user;
  2413  
  2414  
  2415  --
  2416  -- Name: FUNCTION hmac(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres
  2417  --
  2418  
  2419  GRANT ALL ON FUNCTION extensions.hmac(bytea, bytea, text) TO dashboard_user;
  2420  
  2421  
  2422  --
  2423  -- Name: FUNCTION hmac(text, text, text); Type: ACL; Schema: extensions; Owner: postgres
  2424  --
  2425  
  2426  GRANT ALL ON FUNCTION extensions.hmac(text, text, text) TO dashboard_user;
  2427  
  2428  
  2429  --
  2430  -- Name: FUNCTION pgp_armor_headers(text, OUT key text, OUT value text); Type: ACL; Schema: extensions; Owner: postgres
  2431  --
  2432  
  2433  GRANT ALL ON FUNCTION extensions.pgp_armor_headers(text, OUT key text, OUT value text) TO dashboard_user;
  2434  
  2435  
  2436  --
  2437  -- Name: FUNCTION pgp_key_id(bytea); Type: ACL; Schema: extensions; Owner: postgres
  2438  --
  2439  
  2440  GRANT ALL ON FUNCTION extensions.pgp_key_id(bytea) TO dashboard_user;
  2441  
  2442  
  2443  --
  2444  -- Name: FUNCTION pgp_pub_decrypt(bytea, bytea); Type: ACL; Schema: extensions; Owner: postgres
  2445  --
  2446  
  2447  GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea) TO dashboard_user;
  2448  
  2449  
  2450  --
  2451  -- Name: FUNCTION pgp_pub_decrypt(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres
  2452  --
  2453  
  2454  GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text) TO dashboard_user;
  2455  
  2456  
  2457  --
  2458  -- Name: FUNCTION pgp_pub_decrypt(bytea, bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres
  2459  --
  2460  
  2461  GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt(bytea, bytea, text, text) TO dashboard_user;
  2462  
  2463  
  2464  --
  2465  -- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea); Type: ACL; Schema: extensions; Owner: postgres
  2466  --
  2467  
  2468  GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea) TO dashboard_user;
  2469  
  2470  
  2471  --
  2472  -- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres
  2473  --
  2474  
  2475  GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text) TO dashboard_user;
  2476  
  2477  
  2478  --
  2479  -- Name: FUNCTION pgp_pub_decrypt_bytea(bytea, bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres
  2480  --
  2481  
  2482  GRANT ALL ON FUNCTION extensions.pgp_pub_decrypt_bytea(bytea, bytea, text, text) TO dashboard_user;
  2483  
  2484  
  2485  --
  2486  -- Name: FUNCTION pgp_pub_encrypt(text, bytea); Type: ACL; Schema: extensions; Owner: postgres
  2487  --
  2488  
  2489  GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea) TO dashboard_user;
  2490  
  2491  
  2492  --
  2493  -- Name: FUNCTION pgp_pub_encrypt(text, bytea, text); Type: ACL; Schema: extensions; Owner: postgres
  2494  --
  2495  
  2496  GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt(text, bytea, text) TO dashboard_user;
  2497  
  2498  
  2499  --
  2500  -- Name: FUNCTION pgp_pub_encrypt_bytea(bytea, bytea); Type: ACL; Schema: extensions; Owner: postgres
  2501  --
  2502  
  2503  GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea) TO dashboard_user;
  2504  
  2505  
  2506  --
  2507  -- Name: FUNCTION pgp_pub_encrypt_bytea(bytea, bytea, text); Type: ACL; Schema: extensions; Owner: postgres
  2508  --
  2509  
  2510  GRANT ALL ON FUNCTION extensions.pgp_pub_encrypt_bytea(bytea, bytea, text) TO dashboard_user;
  2511  
  2512  
  2513  --
  2514  -- Name: FUNCTION pgp_sym_decrypt(bytea, text); Type: ACL; Schema: extensions; Owner: postgres
  2515  --
  2516  
  2517  GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text) TO dashboard_user;
  2518  
  2519  
  2520  --
  2521  -- Name: FUNCTION pgp_sym_decrypt(bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres
  2522  --
  2523  
  2524  GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt(bytea, text, text) TO dashboard_user;
  2525  
  2526  
  2527  --
  2528  -- Name: FUNCTION pgp_sym_decrypt_bytea(bytea, text); Type: ACL; Schema: extensions; Owner: postgres
  2529  --
  2530  
  2531  GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text) TO dashboard_user;
  2532  
  2533  
  2534  --
  2535  -- Name: FUNCTION pgp_sym_decrypt_bytea(bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres
  2536  --
  2537  
  2538  GRANT ALL ON FUNCTION extensions.pgp_sym_decrypt_bytea(bytea, text, text) TO dashboard_user;
  2539  
  2540  
  2541  --
  2542  -- Name: FUNCTION pgp_sym_encrypt(text, text); Type: ACL; Schema: extensions; Owner: postgres
  2543  --
  2544  
  2545  GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text) TO dashboard_user;
  2546  
  2547  
  2548  --
  2549  -- Name: FUNCTION pgp_sym_encrypt(text, text, text); Type: ACL; Schema: extensions; Owner: postgres
  2550  --
  2551  
  2552  GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt(text, text, text) TO dashboard_user;
  2553  
  2554  
  2555  --
  2556  -- Name: FUNCTION pgp_sym_encrypt_bytea(bytea, text); Type: ACL; Schema: extensions; Owner: postgres
  2557  --
  2558  
  2559  GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text) TO dashboard_user;
  2560  
  2561  
  2562  --
  2563  -- Name: FUNCTION pgp_sym_encrypt_bytea(bytea, text, text); Type: ACL; Schema: extensions; Owner: postgres
  2564  --
  2565  
  2566  GRANT ALL ON FUNCTION extensions.pgp_sym_encrypt_bytea(bytea, text, text) TO dashboard_user;
  2567  
  2568  
  2569  --
  2570  -- Name: FUNCTION sign(payload json, secret text, algorithm text); Type: ACL; Schema: extensions; Owner: postgres
  2571  --
  2572  
  2573  GRANT ALL ON FUNCTION extensions.sign(payload json, secret text, algorithm text) TO dashboard_user;
  2574  
  2575  
  2576  --
  2577  -- Name: FUNCTION url_decode(data text); Type: ACL; Schema: extensions; Owner: postgres
  2578  --
  2579  
  2580  GRANT ALL ON FUNCTION extensions.url_decode(data text) TO dashboard_user;
  2581  
  2582  
  2583  --
  2584  -- Name: FUNCTION url_encode(data bytea); Type: ACL; Schema: extensions; Owner: postgres
  2585  --
  2586  
  2587  GRANT ALL ON FUNCTION extensions.url_encode(data bytea) TO dashboard_user;
  2588  
  2589  
  2590  --
  2591  -- Name: FUNCTION uuid_generate_v1(); Type: ACL; Schema: extensions; Owner: postgres
  2592  --
  2593  
  2594  GRANT ALL ON FUNCTION extensions.uuid_generate_v1() TO dashboard_user;
  2595  
  2596  
  2597  --
  2598  -- Name: FUNCTION uuid_generate_v1mc(); Type: ACL; Schema: extensions; Owner: postgres
  2599  --
  2600  
  2601  GRANT ALL ON FUNCTION extensions.uuid_generate_v1mc() TO dashboard_user;
  2602  
  2603  
  2604  --
  2605  -- Name: FUNCTION uuid_generate_v3(namespace uuid, name text); Type: ACL; Schema: extensions; Owner: postgres
  2606  --
  2607  
  2608  GRANT ALL ON FUNCTION extensions.uuid_generate_v3(namespace uuid, name text) TO dashboard_user;
  2609  
  2610  
  2611  --
  2612  -- Name: FUNCTION uuid_generate_v4(); Type: ACL; Schema: extensions; Owner: postgres
  2613  --
  2614  
  2615  GRANT ALL ON FUNCTION extensions.uuid_generate_v4() TO dashboard_user;
  2616  
  2617  
  2618  --
  2619  -- Name: FUNCTION uuid_generate_v5(namespace uuid, name text); Type: ACL; Schema: extensions; Owner: postgres
  2620  --
  2621  
  2622  GRANT ALL ON FUNCTION extensions.uuid_generate_v5(namespace uuid, name text) TO dashboard_user;
  2623  
  2624  
  2625  --
  2626  -- Name: FUNCTION uuid_nil(); Type: ACL; Schema: extensions; Owner: postgres
  2627  --
  2628  
  2629  GRANT ALL ON FUNCTION extensions.uuid_nil() TO dashboard_user;
  2630  
  2631  
  2632  --
  2633  -- Name: FUNCTION uuid_ns_dns(); Type: ACL; Schema: extensions; Owner: postgres
  2634  --
  2635  
  2636  GRANT ALL ON FUNCTION extensions.uuid_ns_dns() TO dashboard_user;
  2637  
  2638  
  2639  --
  2640  -- Name: FUNCTION uuid_ns_oid(); Type: ACL; Schema: extensions; Owner: postgres
  2641  --
  2642  
  2643  GRANT ALL ON FUNCTION extensions.uuid_ns_oid() TO dashboard_user;
  2644  
  2645  
  2646  --
  2647  -- Name: FUNCTION uuid_ns_url(); Type: ACL; Schema: extensions; Owner: postgres
  2648  --
  2649  
  2650  GRANT ALL ON FUNCTION extensions.uuid_ns_url() TO dashboard_user;
  2651  
  2652  
  2653  --
  2654  -- Name: FUNCTION uuid_ns_x500(); Type: ACL; Schema: extensions; Owner: postgres
  2655  --
  2656  
  2657  GRANT ALL ON FUNCTION extensions.uuid_ns_x500() TO dashboard_user;
  2658  
  2659  
  2660  --
  2661  -- Name: FUNCTION verify(token text, secret text, algorithm text); Type: ACL; Schema: extensions; Owner: postgres
  2662  --
  2663  
  2664  GRANT ALL ON FUNCTION extensions.verify(token text, secret text, algorithm text) TO dashboard_user;
  2665  
  2666  
  2667  --
  2668  -- Name: FUNCTION extension(name text); Type: ACL; Schema: storage; Owner: supabase_storage_admin
  2669  --
  2670  
  2671  GRANT ALL ON FUNCTION storage.extension(name text) TO anon;
  2672  GRANT ALL ON FUNCTION storage.extension(name text) TO authenticated;
  2673  GRANT ALL ON FUNCTION storage.extension(name text) TO service_role;
  2674  GRANT ALL ON FUNCTION storage.extension(name text) TO dashboard_user;
  2675  GRANT ALL ON FUNCTION storage.extension(name text) TO postgres;
  2676  
  2677  
  2678  --
  2679  -- Name: FUNCTION filename(name text); Type: ACL; Schema: storage; Owner: supabase_storage_admin
  2680  --
  2681  
  2682  GRANT ALL ON FUNCTION storage.filename(name text) TO anon;
  2683  GRANT ALL ON FUNCTION storage.filename(name text) TO authenticated;
  2684  GRANT ALL ON FUNCTION storage.filename(name text) TO service_role;
  2685  GRANT ALL ON FUNCTION storage.filename(name text) TO dashboard_user;
  2686  GRANT ALL ON FUNCTION storage.filename(name text) TO postgres;
  2687  
  2688  
  2689  --
  2690  -- Name: FUNCTION foldername(name text); Type: ACL; Schema: storage; Owner: supabase_storage_admin
  2691  --
  2692  
  2693  GRANT ALL ON FUNCTION storage.foldername(name text) TO anon;
  2694  GRANT ALL ON FUNCTION storage.foldername(name text) TO authenticated;
  2695  GRANT ALL ON FUNCTION storage.foldername(name text) TO service_role;
  2696  GRANT ALL ON FUNCTION storage.foldername(name text) TO dashboard_user;
  2697  GRANT ALL ON FUNCTION storage.foldername(name text) TO postgres;
  2698  
  2699  
  2700  --
  2701  -- Name: TABLE audit_log_entries; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2702  --
  2703  
  2704  GRANT ALL ON TABLE auth.audit_log_entries TO dashboard_user;
  2705  GRANT ALL ON TABLE auth.audit_log_entries TO postgres;
  2706  
  2707  
  2708  --
  2709  -- Name: TABLE flow_state; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2710  --
  2711  
  2712  GRANT ALL ON TABLE auth.flow_state TO postgres;
  2713  GRANT ALL ON TABLE auth.flow_state TO dashboard_user;
  2714  
  2715  
  2716  --
  2717  -- Name: TABLE identities; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2718  --
  2719  
  2720  GRANT ALL ON TABLE auth.identities TO postgres;
  2721  GRANT ALL ON TABLE auth.identities TO dashboard_user;
  2722  
  2723  
  2724  --
  2725  -- Name: TABLE instances; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2726  --
  2727  
  2728  GRANT ALL ON TABLE auth.instances TO dashboard_user;
  2729  GRANT ALL ON TABLE auth.instances TO postgres;
  2730  
  2731  
  2732  --
  2733  -- Name: TABLE mfa_amr_claims; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2734  --
  2735  
  2736  GRANT ALL ON TABLE auth.mfa_amr_claims TO postgres;
  2737  GRANT ALL ON TABLE auth.mfa_amr_claims TO dashboard_user;
  2738  
  2739  
  2740  --
  2741  -- Name: TABLE mfa_challenges; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2742  --
  2743  
  2744  GRANT ALL ON TABLE auth.mfa_challenges TO postgres;
  2745  GRANT ALL ON TABLE auth.mfa_challenges TO dashboard_user;
  2746  
  2747  
  2748  --
  2749  -- Name: TABLE mfa_factors; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2750  --
  2751  
  2752  GRANT ALL ON TABLE auth.mfa_factors TO postgres;
  2753  GRANT ALL ON TABLE auth.mfa_factors TO dashboard_user;
  2754  
  2755  
  2756  --
  2757  -- Name: TABLE refresh_tokens; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2758  --
  2759  
  2760  GRANT ALL ON TABLE auth.refresh_tokens TO dashboard_user;
  2761  GRANT ALL ON TABLE auth.refresh_tokens TO postgres;
  2762  
  2763  
  2764  --
  2765  -- Name: SEQUENCE refresh_tokens_id_seq; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2766  --
  2767  
  2768  GRANT ALL ON SEQUENCE auth.refresh_tokens_id_seq TO dashboard_user;
  2769  GRANT ALL ON SEQUENCE auth.refresh_tokens_id_seq TO postgres;
  2770  
  2771  
  2772  --
  2773  -- Name: TABLE saml_providers; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2774  --
  2775  
  2776  GRANT ALL ON TABLE auth.saml_providers TO postgres;
  2777  GRANT ALL ON TABLE auth.saml_providers TO dashboard_user;
  2778  
  2779  
  2780  --
  2781  -- Name: TABLE saml_relay_states; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2782  --
  2783  
  2784  GRANT ALL ON TABLE auth.saml_relay_states TO postgres;
  2785  GRANT ALL ON TABLE auth.saml_relay_states TO dashboard_user;
  2786  
  2787  
  2788  --
  2789  -- Name: TABLE schema_migrations; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2790  --
  2791  
  2792  GRANT ALL ON TABLE auth.schema_migrations TO dashboard_user;
  2793  GRANT ALL ON TABLE auth.schema_migrations TO postgres;
  2794  
  2795  
  2796  --
  2797  -- Name: TABLE sessions; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2798  --
  2799  
  2800  GRANT ALL ON TABLE auth.sessions TO postgres;
  2801  GRANT ALL ON TABLE auth.sessions TO dashboard_user;
  2802  
  2803  
  2804  --
  2805  -- Name: TABLE sso_domains; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2806  --
  2807  
  2808  GRANT ALL ON TABLE auth.sso_domains TO postgres;
  2809  GRANT ALL ON TABLE auth.sso_domains TO dashboard_user;
  2810  
  2811  
  2812  --
  2813  -- Name: TABLE sso_providers; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2814  --
  2815  
  2816  GRANT ALL ON TABLE auth.sso_providers TO postgres;
  2817  GRANT ALL ON TABLE auth.sso_providers TO dashboard_user;
  2818  
  2819  
  2820  --
  2821  -- Name: TABLE users; Type: ACL; Schema: auth; Owner: supabase_auth_admin
  2822  --
  2823  
  2824  GRANT ALL ON TABLE auth.users TO dashboard_user;
  2825  GRANT ALL ON TABLE auth.users TO postgres;
  2826  
  2827  
  2828  --
  2829  -- Name: TABLE buckets; Type: ACL; Schema: storage; Owner: supabase_storage_admin
  2830  --
  2831  
  2832  GRANT ALL ON TABLE storage.buckets TO anon;
  2833  GRANT ALL ON TABLE storage.buckets TO authenticated;
  2834  GRANT ALL ON TABLE storage.buckets TO service_role;
  2835  GRANT ALL ON TABLE storage.buckets TO postgres;
  2836  
  2837  
  2838  --
  2839  -- Name: TABLE migrations; Type: ACL; Schema: storage; Owner: supabase_storage_admin
  2840  --
  2841  
  2842  GRANT ALL ON TABLE storage.migrations TO anon;
  2843  GRANT ALL ON TABLE storage.migrations TO authenticated;
  2844  GRANT ALL ON TABLE storage.migrations TO service_role;
  2845  GRANT ALL ON TABLE storage.migrations TO postgres;
  2846  
  2847  
  2848  --
  2849  -- Name: TABLE objects; Type: ACL; Schema: storage; Owner: supabase_storage_admin
  2850  --
  2851  
  2852  GRANT ALL ON TABLE storage.objects TO anon;
  2853  GRANT ALL ON TABLE storage.objects TO authenticated;
  2854  GRANT ALL ON TABLE storage.objects TO service_role;
  2855  GRANT ALL ON TABLE storage.objects TO postgres;
  2856  
  2857  
  2858  --
  2859  -- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: auth; Owner: supabase_auth_admin
  2860  --
  2861  
  2862  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON SEQUENCES  TO postgres;
  2863  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON SEQUENCES  TO dashboard_user;
  2864  
  2865  
  2866  --
  2867  -- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: auth; Owner: supabase_auth_admin
  2868  --
  2869  
  2870  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON FUNCTIONS  TO postgres;
  2871  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON FUNCTIONS  TO dashboard_user;
  2872  
  2873  
  2874  --
  2875  -- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: auth; Owner: supabase_auth_admin
  2876  --
  2877  
  2878  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON TABLES  TO postgres;
  2879  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_auth_admin IN SCHEMA auth GRANT ALL ON TABLES  TO dashboard_user;
  2880  
  2881  
  2882  --
  2883  -- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: graphql_public; Owner: supabase_admin
  2884  --
  2885  
  2886  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON SEQUENCES  TO postgres;
  2887  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON SEQUENCES  TO anon;
  2888  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON SEQUENCES  TO authenticated;
  2889  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON SEQUENCES  TO service_role;
  2890  
  2891  
  2892  --
  2893  -- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: graphql_public; Owner: supabase_admin
  2894  --
  2895  
  2896  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON FUNCTIONS  TO postgres;
  2897  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON FUNCTIONS  TO anon;
  2898  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON FUNCTIONS  TO authenticated;
  2899  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON FUNCTIONS  TO service_role;
  2900  
  2901  
  2902  --
  2903  -- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: graphql_public; Owner: supabase_admin
  2904  --
  2905  
  2906  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON TABLES  TO postgres;
  2907  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON TABLES  TO anon;
  2908  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON TABLES  TO authenticated;
  2909  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA graphql_public GRANT ALL ON TABLES  TO service_role;
  2910  
  2911  
  2912  --
  2913  -- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: public; Owner: postgres
  2914  --
  2915  
  2916  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES  TO postgres;
  2917  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES  TO anon;
  2918  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES  TO authenticated;
  2919  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON SEQUENCES  TO service_role;
  2920  
  2921  
  2922  --
  2923  -- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: public; Owner: supabase_admin
  2924  --
  2925  
  2926  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES  TO postgres;
  2927  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES  TO anon;
  2928  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES  TO authenticated;
  2929  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON SEQUENCES  TO service_role;
  2930  
  2931  
  2932  --
  2933  -- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: public; Owner: postgres
  2934  --
  2935  
  2936  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS  TO postgres;
  2937  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS  TO anon;
  2938  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS  TO authenticated;
  2939  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON FUNCTIONS  TO service_role;
  2940  
  2941  
  2942  --
  2943  -- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: public; Owner: supabase_admin
  2944  --
  2945  
  2946  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS  TO postgres;
  2947  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS  TO anon;
  2948  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS  TO authenticated;
  2949  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON FUNCTIONS  TO service_role;
  2950  
  2951  
  2952  --
  2953  -- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: public; Owner: postgres
  2954  --
  2955  
  2956  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES  TO postgres;
  2957  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES  TO anon;
  2958  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES  TO authenticated;
  2959  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA public GRANT ALL ON TABLES  TO service_role;
  2960  
  2961  
  2962  --
  2963  -- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: public; Owner: supabase_admin
  2964  --
  2965  
  2966  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES  TO postgres;
  2967  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES  TO anon;
  2968  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES  TO authenticated;
  2969  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA public GRANT ALL ON TABLES  TO service_role;
  2970  
  2971  
  2972  --
  2973  -- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: realtime; Owner: supabase_admin
  2974  --
  2975  
  2976  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON SEQUENCES  TO postgres;
  2977  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON SEQUENCES  TO dashboard_user;
  2978  
  2979  
  2980  --
  2981  -- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: realtime; Owner: supabase_admin
  2982  --
  2983  
  2984  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON FUNCTIONS  TO postgres;
  2985  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON FUNCTIONS  TO dashboard_user;
  2986  
  2987  
  2988  --
  2989  -- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: realtime; Owner: supabase_admin
  2990  --
  2991  
  2992  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON TABLES  TO postgres;
  2993  ALTER DEFAULT PRIVILEGES FOR ROLE supabase_admin IN SCHEMA realtime GRANT ALL ON TABLES  TO dashboard_user;
  2994  
  2995  
  2996  --
  2997  -- Name: DEFAULT PRIVILEGES FOR SEQUENCES; Type: DEFAULT ACL; Schema: storage; Owner: postgres
  2998  --
  2999  
  3000  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON SEQUENCES  TO postgres;
  3001  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON SEQUENCES  TO anon;
  3002  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON SEQUENCES  TO authenticated;
  3003  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON SEQUENCES  TO service_role;
  3004  
  3005  
  3006  --
  3007  -- Name: DEFAULT PRIVILEGES FOR FUNCTIONS; Type: DEFAULT ACL; Schema: storage; Owner: postgres
  3008  --
  3009  
  3010  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON FUNCTIONS  TO postgres;
  3011  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON FUNCTIONS  TO anon;
  3012  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON FUNCTIONS  TO authenticated;
  3013  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON FUNCTIONS  TO service_role;
  3014  
  3015  
  3016  --
  3017  -- Name: DEFAULT PRIVILEGES FOR TABLES; Type: DEFAULT ACL; Schema: storage; Owner: postgres
  3018  --
  3019  
  3020  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON TABLES  TO postgres;
  3021  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON TABLES  TO anon;
  3022  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON TABLES  TO authenticated;
  3023  ALTER DEFAULT PRIVILEGES FOR ROLE postgres IN SCHEMA storage GRANT ALL ON TABLES  TO service_role;
  3024  
  3025  
  3026  --
  3027  -- Name: issue_graphql_placeholder; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin
  3028  --
  3029  
  3030  CREATE EVENT TRIGGER issue_graphql_placeholder ON sql_drop
  3031           WHEN TAG IN ('DROP EXTENSION')
  3032     EXECUTE FUNCTION extensions.set_graphql_placeholder();
  3033  
  3034  
  3035  ALTER EVENT TRIGGER issue_graphql_placeholder OWNER TO supabase_admin;
  3036  
  3037  --
  3038  -- Name: issue_pg_cron_access; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin
  3039  --
  3040  
  3041  CREATE EVENT TRIGGER issue_pg_cron_access ON ddl_command_end
  3042           WHEN TAG IN ('CREATE SCHEMA')
  3043     EXECUTE FUNCTION extensions.grant_pg_cron_access();
  3044  
  3045  
  3046  ALTER EVENT TRIGGER issue_pg_cron_access OWNER TO supabase_admin;
  3047  
  3048  --
  3049  -- Name: issue_pg_graphql_access; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin
  3050  --
  3051  
  3052  CREATE EVENT TRIGGER issue_pg_graphql_access ON ddl_command_end
  3053           WHEN TAG IN ('CREATE FUNCTION')
  3054     EXECUTE FUNCTION extensions.grant_pg_graphql_access();
  3055  
  3056  
  3057  ALTER EVENT TRIGGER issue_pg_graphql_access OWNER TO supabase_admin;
  3058  
  3059  --
  3060  -- Name: issue_pg_net_access; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin
  3061  --
  3062  
  3063  CREATE EVENT TRIGGER issue_pg_net_access ON ddl_command_end
  3064           WHEN TAG IN ('CREATE EXTENSION')
  3065     EXECUTE FUNCTION extensions.grant_pg_net_access();
  3066  
  3067  
  3068  ALTER EVENT TRIGGER issue_pg_net_access OWNER TO supabase_admin;
  3069  
  3070  --
  3071  -- Name: pgrst_ddl_watch; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin
  3072  --
  3073  
  3074  CREATE EVENT TRIGGER pgrst_ddl_watch ON ddl_command_end
  3075     EXECUTE FUNCTION extensions.pgrst_ddl_watch();
  3076  
  3077  
  3078  ALTER EVENT TRIGGER pgrst_ddl_watch OWNER TO supabase_admin;
  3079  
  3080  --
  3081  -- Name: pgrst_drop_watch; Type: EVENT TRIGGER; Schema: -; Owner: supabase_admin
  3082  --
  3083  
  3084  CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
  3085     EXECUTE FUNCTION extensions.pgrst_drop_watch();
  3086  
  3087  
  3088  ALTER EVENT TRIGGER pgrst_drop_watch OWNER TO supabase_admin;
  3089  
  3090  --
  3091  -- PostgreSQL database dump complete
  3092  --
  3093  
  3094  RESET ALL;