🎉 Initial Commit

This commit is contained in:
2023-12-10 21:58:23 +08:00
parent 7dba4810ef
commit 16aed743d9
24 changed files with 265 additions and 5502 deletions

View File

@ -0,0 +1,19 @@
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);

View File

@ -0,0 +1,19 @@
create table
public.problems (
id bigint generated by default as identity,
title text not null,
description text not null,
type character varying not null,
tags character varying[] null,
author uuid null,
is_draft boolean null default true,
is_hidden boolean null default false,
created_at timestamp with time zone null default now(),
constraint problems_pkey primary key (id),
constraint problems_author_fkey foreign key (author) references auth.users (id)
) tablespace pg_default;
alter table public.problems enable row level security;
create policy "Public problems are viewable by everyone." on problems
for select using (true);