Skip to content

Commit b7fe48d

Browse files
committed
remove auth functions from migrations
1 parent 5eacb4d commit b7fe48d

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

‎lib/realtime/tenants/repo/migrations/20231204144024_create_rls_helper_functions.ex‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,5 @@ defmodule Realtime.Tenants.Migrations.CreateRlsHelperFunctions do
99
select nullif(current_setting('realtime.channel_name', true), '')::text;
1010
$$ language sql stable;
1111
""")
12-
13-
execute("create schema if not exists auth")
14-
15-
execute("""
16-
do $func_exists$
17-
begin if not exists(select * from pg_proc where proname = 'role')
18-
then
19-
create or replace function auth.uid() returns uuid as $function_def$
20-
select nullif(current_setting('request.jwt.claim.sub', true), '')::uuid;
21-
$function_def$ language sql stable;
22-
end if;
23-
end $func_exists$;
24-
""")
25-
26-
execute("""
27-
do $func_exists$
28-
begin if not exists(select * from pg_proc where proname = 'role')
29-
then
30-
create function auth.role() returns text as $function_def$
31-
select nullif(current_setting('request.jwt.claim.role', true), '')::text;
32-
$function_def$ language sql stable;
33-
end if;
34-
end $func_exists$;
35-
""")
3612
end
3713
end

0 commit comments

Comments
 (0)