Skip to content

Commit efc1465

Browse files
committed
chore: update initial schema for pg15
1 parent 06d2316 commit efc1465

File tree

1 file changed

+35
-25
lines changed
  • internal/utils/templates/initial_schemas

1 file changed

+35
-25
lines changed

internal/utils/templates/initial_schemas/15.sql

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -448,19 +448,15 @@ BEGIN
448448

449449
ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;
450450
ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SECURITY DEFINER;
451-
ALTER function net.http_collect_response(request_id bigint, async boolean) SECURITY DEFINER;
452451

453452
ALTER function net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;
454453
ALTER function net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) SET search_path = net;
455-
ALTER function net.http_collect_response(request_id bigint, async boolean) SET search_path = net;
456454

457455
REVOKE ALL ON FUNCTION net.http_get(url text, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;
458456
REVOKE ALL ON FUNCTION net.http_post(url text, body jsonb, params jsonb, headers jsonb, timeout_milliseconds integer) FROM PUBLIC;
459-
REVOKE ALL ON FUNCTION net.http_collect_response(request_id bigint, async boolean) FROM PUBLIC;
460457

461458
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;
462459
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;
463-
GRANT EXECUTE ON FUNCTION net.http_collect_response(request_id bigint, async boolean) TO supabase_functions_admin, postgres, anon, authenticated, service_role;
464460
END IF;
465461
END;
466462
$$;
@@ -639,10 +635,10 @@ DECLARE
639635
_parts text[];
640636
_filename text;
641637
BEGIN
642-
select string_to_array(name, '/') into _parts;
643-
select _parts[array_length(_parts,1)] into _filename;
644-
-- @todo return the last part instead of 2
645-
return split_part(_filename, '.', 2);
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);
646642
END
647643
$$;
648644

@@ -659,8 +655,8 @@ CREATE OR REPLACE FUNCTION storage.filename(name text) RETURNS text
659655
DECLARE
660656
_parts text[];
661657
BEGIN
662-
select string_to_array(name, '/') into _parts;
663-
return _parts[array_length(_parts,1)];
658+
select string_to_array(name, '/') into _parts;
659+
return _parts[array_length(_parts,1)];
664660
END
665661
$$;
666662

@@ -677,8 +673,8 @@ CREATE OR REPLACE FUNCTION storage.foldername(name text) RETURNS text[]
677673
DECLARE
678674
_parts text[];
679675
BEGIN
680-
select string_to_array(name, '/') into _parts;
681-
return _parts[1:array_length(_parts,1)-1];
676+
select string_to_array(name, '/') into _parts;
677+
return _parts[1:array_length(_parts,1)-1];
682678
END
683679
$$;
684680

@@ -835,7 +831,10 @@ CREATE TABLE IF NOT EXISTS _realtime.tenants (
835831
inserted_at timestamp(0) without time zone NOT NULL,
836832
updated_at timestamp(0) without time zone NOT NULL,
837833
max_events_per_second integer DEFAULT 100 NOT NULL,
838-
postgres_cdc_default character varying(255) DEFAULT 'postgres_cdc_rls'::character varying
834+
postgres_cdc_default character varying(255) DEFAULT 'postgres_cdc_rls'::character varying,
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
839838
);
840839

841840

@@ -1313,24 +1312,25 @@ INSERT INTO _realtime.extensions (id, type, settings, tenant_external_id, insert
13131312
-- Data for Name: schema_migrations; Type: TABLE DATA; Schema: _realtime; Owner: postgres
13141313
--
13151314

1316-
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20210706140551, '2023-01-06 05:02:45');
1317-
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220329161857, '2023-01-06 05:02:45');
1318-
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220410212326, '2023-01-06 05:02:45');
1319-
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220506102948, '2023-01-06 05:02:45');
1320-
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220527210857, '2023-01-06 05:02:45');
1321-
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220815211129, '2023-01-06 05:02:45');
1322-
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220815215024, '2023-01-06 05:02:45');
1323-
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220818141501, '2023-01-06 05:02:45');
1324-
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221018173709, '2023-01-06 05:02:45');
1325-
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221102172703, '2023-01-06 05:02:45');
1326-
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221223010058, '2023-01-06 05:02:45');
1315+
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20210706140551, '2023-01-30 04:09:10');
1316+
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220329161857, '2023-01-30 04:09:10');
1317+
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220410212326, '2023-01-30 04:09:10');
1318+
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220506102948, '2023-01-30 04:09:10');
1319+
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220527210857, '2023-01-30 04:09:10');
1320+
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220815211129, '2023-01-30 04:09:10');
1321+
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220815215024, '2023-01-30 04:09:10');
1322+
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220818141501, '2023-01-30 04:09:10');
1323+
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221018173709, '2023-01-30 04:09:10');
1324+
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221102172703, '2023-01-30 04:09:10');
1325+
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221223010058, '2023-01-30 04:09:10');
1326+
INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20230110180046, '2023-01-30 04:09:10');
13271327

13281328

13291329
--
13301330
-- Data for Name: tenants; Type: TABLE DATA; Schema: _realtime; Owner: postgres
13311331
--
13321332

1333-
INSERT INTO _realtime.tenants (id, name, external_id, jwt_secret, max_concurrent_users, inserted_at, updated_at, max_events_per_second, postgres_cdc_default) VALUES ('1b4a2e9b-e69c-40dc-ba5b-337c0eed2c88', 'realtime-dev', 'realtime-dev', 'cor19x6wYudqK/HY8tKJOBoA0KD/zxM/SxxkI1zPOvSCs67x4q75+0yV07SWdm0T', 200, '2023-01-05 05:01:34', '2023-01-05 05:01:34', 100, 'postgres_cdc_rls');
1333+
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) VALUES ('bb4a1909-7f48-42b5-9814-68ebb2d065b9', 'realtime-dev', 'realtime-dev', 'iNjicxc4+llvc9wovDvqymwfnj9teWMlyOIbJ8Fh6j2WNU8CIJ2ZgjR6MUIKqSmeDmvpsKLsZ9jgXJmQPpwL8w==', 200, '2023-01-30 04:09:12', '2023-01-30 04:09:12', 100, 'postgres_cdc_rls', 100000, 100, 500);
13341334

13351335

13361336
--
@@ -2589,6 +2589,16 @@ GRANT ALL ON FUNCTION graphql.increment_schema_version() TO authenticated;
25892589
GRANT ALL ON FUNCTION graphql.increment_schema_version() TO service_role;
25902590

25912591

2592+
--
2593+
-- Name: FUNCTION graphql("operationName" text, query text, variables jsonb, extensions jsonb); Type: ACL; Schema: graphql_public; Owner: supabase_admin
2594+
--
2595+
2596+
-- GRANT ALL ON FUNCTION graphql_public.graphql("operationName" text, query text, variables jsonb, extensions jsonb) TO postgres;
2597+
-- GRANT ALL ON FUNCTION graphql_public.graphql("operationName" text, query text, variables jsonb, extensions jsonb) TO anon;
2598+
-- GRANT ALL ON FUNCTION graphql_public.graphql("operationName" text, query text, variables jsonb, extensions jsonb) TO authenticated;
2599+
-- GRANT ALL ON FUNCTION graphql_public.graphql("operationName" text, query text, variables jsonb, extensions jsonb) TO service_role;
2600+
2601+
25922602
--
25932603
-- Name: FUNCTION get_auth(p_usename text); Type: ACL; Schema: pgbouncer; Owner: postgres
25942604
--

0 commit comments

Comments
 (0)