From 60eb2e7fe5ed3627ad4bd40286df1741529da75b Mon Sep 17 00:00:00 2001
From: Alexander Kavon <me+git@alexkavon.com>
Date: Thu, 25 Jan 2024 02:47:26 -0500
Subject: update hooks to more identifiable names, update migrations to work
 with votes, use a common enum state type

---
 migrations/005_create_comments_tables.sql | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

(limited to 'migrations/005_create_comments_tables.sql')

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;
-- 
cgit v1.2.3

