since3-portal/lib/supabase/migrations/20260927100000_create_profiles_table.sql
2026-09-27 01:36:02 +02:00

14 lines
No EOL
432 B
SQL

create type user_role as enum ('admin', 'client');
create table profiles (
id uuid primary key references auth.users(id) on delete cascade,
email text not null,
name text not null,
role user_role not null default 'client',
created_at timestamptz not null default now()
);
alter table profiles enable row level security;
create policy "Users can read their own profile"
on profiles for select
using (auth.uid() = id);