mirror of
https://github.com/Since-3/since3-portal.git
synced 2026-10-12 20:51:17 +00:00
14 lines
No EOL
432 B
SQL
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); |