Fuxi/supabase/migrations/20231210071647_profiles.sql
2023-12-10 21:58:23 +08:00

19 lines
539 B
SQL

create table public.profiles (
id uuid not null references auth.users on delete cascade,
username varchar(64),
nickname varchar(256),
school_id 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);