SupabaseS
Supabase4y ago
\n

Failing to insert due to policy?

-- create teams table
create table teams (
  id bigint generated by default as identity primary key,
  creator uuid references users not null default auth.uid(),
  title text default 'Untitled',
  created_at timestamp with time zone default timezone('utc'::text, now()) not null
);

-- teams row level security
alter table teams enable row level security;

-- policies
create policy "Users can create teams" on teams for 
  insert to authenticated with check (true);


  const createTeam = (title: string) =>
    supabase
      .from('teams')
      .insert({ title });


Is returning
code: "42501"
details: null
hint: null
message: "new row violates row-level security policy for table \"teams\""
Was this page helpful?