Skip to content

Commit

Permalink
Replace users with PostgreSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
theNatePi authored Dec 4, 2024
1 parent ba15095 commit 927f958
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions server/db/schema/users.sql
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
-- Table: public.users

-- DROP TABLE IF EXISTS public.users;

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(256) COLLATE pg_catalog."default" NOT NULL,
last_name character varying(256) COLLATE pg_catalog."default" NOT NULL,
edit_perms boolean NOT NULL DEFAULT false,
CONSTRAINT user_pkey PRIMARY KEY (id),
CONSTRAINT email UNIQUE (email),
CONSTRAINT firebase_uid UNIQUE (firebase_uid),
CONSTRAINT role_check CHECK (role::text = ANY (ARRAY['user'::character varying, 'admin'::character varying]::text[]))
CONSTRAINT firebase_uid UNIQUE (firebase_uid)
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public.users
OWNER to postgres;

0 comments on commit 927f958

Please sign in to comment.