aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorMichael McVady <femtonaut@gmail.com>2022-03-07 22:09:01 -0500
committerMichael McVady <femtonaut@gmail.com>2022-03-07 22:13:09 -0500
commit27384b1735cc558614ccfc3b9cac89bcd5869b4d (patch)
tree2301703e338240166401833837e39f5316edb496 /db
parent3123f09ce08d3824671ca218bef66c28748bda07 (diff)
Use UUIDs ...
Diffstat (limited to 'db')
-rw-r--r--db/db.sql4
1 files changed, 3 insertions, 1 deletions
diff --git a/db/db.sql b/db/db.sql
index 921ce06..421176f 100644
--- a/db/db.sql
+++ b/db/db.sql
@@ -2,8 +2,10 @@ CREATE DATABASE clog;
\connect clog
+CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
+
CREATE TABLE posts (
- id BIGINT NOT NULL, -- PRIMARY KEY UUID
+ id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
title CHARACTER VARYING NOT NULL,
body CHARACTER VARYING NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),