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/003_create_posts_table.sql | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'migrations/003_create_posts_table.sql')

diff --git a/migrations/003_create_posts_table.sql b/migrations/003_create_posts_table.sql
index 584b7b4..b8324d3 100644
--- a/migrations/003_create_posts_table.sql
+++ b/migrations/003_create_posts_table.sql
@@ -1,9 +1,12 @@
+CREATE TYPE postable_state AS ENUM ('hidden', 'visible');
+
 CREATE TABLE posts(
     id SERIAL NOT NULL PRIMARY KEY,
-    title VARCHAR(100) NOT NULL,
+    title VARCHAR(80) NOT NULL,
     description TEXT,
     url VARCHAR(255) UNIQUE,
     user_id INT NOT NULL REFERENCES users(id),
+    state postable_state DEFAULT 'visible',
     created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
     updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
 );
@@ -16,3 +19,4 @@ EXECUTE PROCEDURE trigger_set_timestamp();
 ---- create above / drop below ----
 
 DROP TABLE posts;
+DROP TYPE postable_state;
-- 
cgit v1.2.3

