From 27384b1735cc558614ccfc3b9cac89bcd5869b4d Mon Sep 17 00:00:00 2001
From: Michael McVady <femtonaut@gmail.com>
Date: Mon, 7 Mar 2022 22:09:01 -0500
Subject: Use UUIDs ...

---
 db/db.sql | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'db/db.sql')

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(),
-- 
cgit v1.2.3

