Fuxi/supabase/migrations/20231210071647_profiles.sql

14 lines
525 B
MySQL
Raw Normal View History

2023-12-10 13:58:23 +00:00
create table public.profiles (
id uuid not null references auth.users on delete cascade,
username varchar(64),
nickname varchar(256),
2023-12-10 14:54:04 +00:00
school int8,
2023-12-10 13:58:23 +00:00
primary key (id)
);
alter table public.profiles enable row level security;
2023-12-10 14:54:04 +00:00
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);