Run this SQL in SQL Editor
Sidebar → SQL Editor → New query → paste → Run
create table profiles (
id uuid references auth.users primary key,
name text, role text default 'user'
);
create table projects (
id uuid primary key default gen_random_uuid(),
user_id uuid references auth.users not null,
name text not null, date text,
created_at timestamptz default now()
);
create table branches (
id uuid primary key default gen_random_uuid(),
project_id uuid references projects on delete cascade,
name text not null, status text default 'open',
date text, description text
);
alter table profiles enable row level security;
alter table projects enable row level security;
alter table branches enable row level security;
create policy "own profile" on profiles for all using (auth.uid()=id);
create policy "own projects" on projects for all using (auth.uid()=user_id);
create policy "own branches" on branches for all using (
project_id in (select id from projects where user_id=auth.uid())
);
You should see "Success. No rows returned".