aboutsummaryrefslogtreecommitdiff
path: root/db/db.sql
diff options
context:
space:
mode:
Diffstat (limited to 'db/db.sql')
-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(),