From b38af4a5fc8cd21eedda58e68a2d5ad04ab2cc8a Mon Sep 17 00:00:00 2001 From: George Moon Date: Fri, 19 Apr 2024 22:55:59 +0200 Subject: [PATCH] fix: typo in auth-sql-rules-examples.js (#22831) * fix: typo in auth-sql-rules-examples.js * fix: get code sample running --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- .../products/auth/auth-sql-rules-examples.js | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/apps/www/data/products/auth/auth-sql-rules-examples.js b/apps/www/data/products/auth/auth-sql-rules-examples.js index 546ed424715..1e1b897bd67 100644 --- a/apps/www/data/products/auth/auth-sql-rules-examples.js +++ b/apps/www/data/products/auth/auth-sql-rules-examples.js @@ -59,26 +59,25 @@ using ( (select auth.uid()) = id ); url: '/docs/guides/auth#policies-with-joins', code: ` create table teams ( - id serial primary key, + id bigint primary key generated always as identity, name text ); create table members ( - team_id references team.id, - user_id referenced auth.users.id + team_id bigint references teams, + user_id uuid references auth.users ); alter table teams enable row level security; --- Create Advanced Policies -create policy "Team members can update team details" -on teams -for update using ( - (select auth.uid()) in ( - select user_id from members - where team_id = id - ) -); +create policy "Team members can update team details if they belong to the team" + on teams + for update using ( + (select auth.uid()) in ( + select user_id from members + where team_id = id + ) + ); `.trim(), }, ]