From 3eb6746ac07735f5b9c3bf707fc9244038ae005f Mon Sep 17 00:00:00 2001 From: Zion Mateo Date: Fri, 29 Nov 2024 19:41:08 -0800 Subject: [PATCH] #7 fixed - created comments table --- server/db/schema/comments.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 server/db/schema/comments.sql diff --git a/server/db/schema/comments.sql b/server/db/schema/comments.sql new file mode 100644 index 0000000..f482f06 --- /dev/null +++ b/server/db/schema/comments.sql @@ -0,0 +1,11 @@ +CREATE TYPE adjustment AS ENUM ('none', 'total', 'rate_flat', 'rate_percent', 'paid'); + +CREATE TABLE comments ( + id INT PRIMARY KEY UNIQUE NOT NULL DEFAULT nextval('comment_id_seq'), + user_id INT REFERENCES users(id) NOT NULL, + invoice_id INT REFERENCES invoices(id) NOT NULL, + datetime TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP, + comment TEXT NOT NULL, + adjustment_type adjustment DEFAULT 'none', + adjustment_value NUMERIC DEFAULT 0 +); \ No newline at end of file