Skip to content

Commit

Permalink
Replace invoices with PostgreSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
theNatePi authored Dec 4, 2024
1 parent 57e48ec commit a0aa37b
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions server/db/schema/invoices.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
CREATE TABLE invoices (
id INT PRIMARY KEY UNIQUE NOT NULL DEFAULT nextval('invoice_id_seq'),
event_id INT NOT NULL REFERENCES events(id),
start_date DATE NOT NULL,
end_date DATE NOT NULL,
is_sent BOOL NOT NULL DEFAULT False,
payment_status payment NOT NULL DEFAULT 'none'

);
CREATE TABLE IF NOT EXISTS public.invoices
(
id integer NOT NULL GENERATED ALWAYS AS IDENTITY ( INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 2147483647 CACHE 1 ),
event_id integer NOT NULL,
start_date date NOT NULL,
end_date date NOT NULL,
is_sent boolean NOT NULL DEFAULT false,
payment_status payment NOT NULL DEFAULT 'none'::payment,
CONSTRAINT invoice_pkey PRIMARY KEY (id),
CONSTRAINT event_id FOREIGN KEY (event_id)
REFERENCES public.events (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
);

0 comments on commit a0aa37b

Please sign in to comment.