Skip to content

Commit

Permalink
Update users.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
h0ethan04 authored Dec 7, 2024
1 parent 148320d commit d35ec80
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server/db/schema/users.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@

-- DROP TABLE IF EXISTS public.users;

CREATE TYPE USER_ROLE AS ENUM('student', 'teacher', 'admin');

CREATE TABLE IF NOT EXISTS public.users
(
id integer NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
email character varying(256) COLLATE pg_catalog."default" NOT NULL,
firebase_uid character varying(128) COLLATE pg_catalog."default" NOT NULL,
role character varying(16) COLLATE pg_catalog."default" NOT NULL DEFAULT 'user'::character varying,
first_name character varying(128) NOT NULL,
last_name character varying(128) NOT NULL,
user_role USER_ROLE NOT NULL,
CONSTRAINT user_pkey PRIMARY KEY (id),
CONSTRAINT email UNIQUE (email),
CONSTRAINT firebase_uid UNIQUE (firebase_uid),
Expand All @@ -16,5 +21,5 @@ CREATE TABLE IF NOT EXISTS public.users

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public.users
OWNER to postgres;
-- ALTER TABLE IF EXISTS public.users
-- OWNER to postgres;

0 comments on commit d35ec80

Please sign in to comment.