From 0cdc7a2e84ac5c460569a26a1dd8e3070cea487e Mon Sep 17 00:00:00 2001
From: Alexander Kavon <me+git@alexkavon.com>
Date: Mon, 22 Jan 2024 21:30:19 -0500
Subject: add posts table migration, add sqlboiler post model, post routes:
 create, store, get, post create ui template, remove email from user create
 route

---
 migrations/003_create_posts_table.sql.sql | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 migrations/003_create_posts_table.sql.sql

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

diff --git a/migrations/003_create_posts_table.sql.sql b/migrations/003_create_posts_table.sql.sql
new file mode 100644
index 0000000..81dab8f
--- /dev/null
+++ b/migrations/003_create_posts_table.sql.sql
@@ -0,0 +1,17 @@
+CREATE TABLE posts(
+    id SERIAL NOT NULL PRIMARY KEY,
+    title VARCHAR(100) NOT NULL,
+    description TEXT NOT NULL,
+    url VARCHAR(255) UNIQUE,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+    updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
+);
+
+CREATE TRIGGER set_timestamp
+BEFORE UPDATE ON posts
+FOR EACH ROW
+EXECUTE PROCEDURE trigger_set_timestamp();
+
+---- create above / drop below ----
+
+DROP TABLE posts;
-- 
cgit v1.2.3

