Fuxi/supabase/migrations/20231210071647_profiles.sql
2023-12-10 22:57:46 +08:00

14 lines
525 B
SQL

create table public.profiles (
id uuid not null references auth.users on delete cascade,
username varchar(64),
nickname varchar(256),
school int8,
primary key (id)
);
alter table public.profiles enable row level security;
create policy "Public profiles are viewable by everyone." on profiles for
select using (true);
create policy "Users can insert their own profile." on profiles for
insert with check (auth.uid() = id);
create policy "Users can update own profile." on profiles for
update using (auth.uid() = id);