aboutsummaryrefslogtreecommitdiff
path: root/db/db.sql
diff options
context:
space:
mode:
authorMichael McVady <femtonaut@gmail.com>2024-01-12 16:02:15 -0600
committerMichael McVady <femtonaut@gmail.com>2024-01-12 16:02:15 -0600
commit660d6e73218229c6ac08ac2b7a19819169529fc8 (patch)
tree7fb2471c2f1161643b9083a9ca0b900834507ecc /db/db.sql
parentd7f423861facdbf3745988a20f576bbf50d6d381 (diff)
Start implementing search
Diffstat (limited to 'db/db.sql')
-rw-r--r--db/db.sql9
1 files changed, 6 insertions, 3 deletions
diff --git a/db/db.sql b/db/db.sql
index ab0e7fd..5866021 100644
--- a/db/db.sql
+++ b/db/db.sql
@@ -1,14 +1,17 @@
-CREATE DATABASE clog;
+CREATE DATABASE IF NOT EXISTS clog;
\connect clog
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-CREATE TABLE posts (
+CREATE TABLE IF NOT EXISTS entries (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
-- draft BOOLEAN NOT NULL DEFAULT TRUE,
title CHARACTER VARYING NOT NULL,
body CHARACTER VARYING NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
- updated_at TIMESTAMP NOT NULL DEFAULT NOW()
+ updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
+ search_vector TSVECTOR DEFAULT NULL
);
+
+CREATE INDEX entries_search_vector_idx ON entries USING gin(search_vector); \ No newline at end of file