aboutsummaryrefslogtreecommitdiff
path: root/migrations/003_create_posts_table.sql.sql
diff options
context:
space:
mode:
authorAlexander Kavon <me+git@alexkavon.com>2024-01-23 01:40:39 -0500
committerAlexander Kavon <me+git@alexkavon.com>2024-01-23 01:40:39 -0500
commit8510c36ded85740885e67b59ee2ec2360986c0a9 (patch)
treec8c4c70458bb65b0ee134f80cb364db851e9c7a2 /migrations/003_create_posts_table.sql.sql
parentf329e7f2095a57967bfe86563401236d53a15924 (diff)
new tables: tags, post_tags, generated sqlboiler tags model, updated posts/get template, updated posts table to take nullable description and user_id foreign key
Diffstat (limited to 'migrations/003_create_posts_table.sql.sql')
-rw-r--r--migrations/003_create_posts_table.sql.sql3
1 files changed, 2 insertions, 1 deletions
diff --git a/migrations/003_create_posts_table.sql.sql b/migrations/003_create_posts_table.sql.sql
index 81dab8f..584b7b4 100644
--- a/migrations/003_create_posts_table.sql.sql
+++ b/migrations/003_create_posts_table.sql.sql
@@ -1,8 +1,9 @@
CREATE TABLE posts(
id SERIAL NOT NULL PRIMARY KEY,
title VARCHAR(100) NOT NULL,
- description TEXT NOT NULL,
+ description TEXT,
url VARCHAR(255) UNIQUE,
+ user_id INT NOT NULL REFERENCES users(id),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);