Fuxi/supabase/migrations/20231210071647_profiles.sql
2023-12-11 23:12:51 +08:00

20 lines
563 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);