Fuxi/supabase/migrations/20231210135930_challenges.sql

14 lines
722 B
MySQL
Raw Normal View History

2023-12-10 14:54:04 +00:00
create table public.challenges (
id bigint generated by default as identity,
answers jsonb not null,
details jsonb not null,
author uuid not null,
problem int8 not null,
status varchar(256) not null,
created_at timestamp with time zone null default now(),
constraint challenges_pkey primary key (id),
constraint challenges_author_fkey foreign key (author) references auth.users (id),
constraint challenges_problem_fkey foreign key (problem) references public.problems (id)
) tablespace pg_default;
alter table public.challenges enable row level security;
create policy "The challagers can see their challenges" on "public"."challenges" for select to public using (auth.uid() = author) with check (true)