14 lines
722 B
MySQL
14 lines
722 B
MySQL
|
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)
|