aboutsummaryrefslogtreecommitdiff
path: root/migrations/005_create_comments_tables.sql
diff options
context:
space:
mode:
authorAlexander Kavon <me+git@alexkavon.com>2024-01-25 02:47:26 -0500
committerAlexander Kavon <me+git@alexkavon.com>2024-01-25 02:47:26 -0500
commit60eb2e7fe5ed3627ad4bd40286df1741529da75b (patch)
treef18d8bbbc3590183333778a4e96bebff187366b2 /migrations/005_create_comments_tables.sql
parent60fd8a68ed87cd7352b490e88ceff3ec21855937 (diff)
update hooks to more identifiable names, update migrations to work with votes, use a common enum state typeHEADtrunk
Diffstat (limited to 'migrations/005_create_comments_tables.sql')
-rw-r--r--migrations/005_create_comments_tables.sql5
1 files changed, 1 insertions, 4 deletions
diff --git a/migrations/005_create_comments_tables.sql b/migrations/005_create_comments_tables.sql
index 3717c0c..8abf274 100644
--- a/migrations/005_create_comments_tables.sql
+++ b/migrations/005_create_comments_tables.sql
@@ -1,12 +1,10 @@
-CREATE TYPE comment_state AS ENUM ('hidden', 'visible');
-
CREATE TABLE comments(
id SERIAL NOT NULL PRIMARY KEY,
comment TEXT NOT NULL,
user_id INT NOT NULL REFERENCES users(id),
post_id INT NOT NULL REFERENCES posts(id) ON DELETE CASCADE,
reply_id INT REFERENCES comments(id) ON DELETE CASCADE,
- state comment_state DEFAULT 'visible',
+ state postable_state DEFAULT 'visible',
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
@@ -19,4 +17,3 @@ EXECUTE PROCEDURE trigger_set_timestamp();
---- create above / drop below ----
DROP TABLE comments;
-DROP TYPE comment_state;