aboutsummaryrefslogtreecommitdiff
path: root/db/db.sql
diff options
context:
space:
mode:
authorMichael McVady <femtonaut@gmail.com>2021-11-18 14:45:16 -0500
committerMichael McVady <femtonaut@gmail.com>2021-11-18 14:45:16 -0500
commit9bd6fe0e5f690970c49ee993e5012bef5868d9ab (patch)
tree880bab31ea18cb48946b3c5fe3c91337e1cffe5b /db/db.sql
parentef14cbf2f0c4431ce6ad618e93316ab7c6d42ff6 (diff)
Add `created_at` field to DB
Diffstat (limited to 'db/db.sql')
-rw-r--r--db/db.sql26
1 files changed, 16 insertions, 10 deletions
diff --git a/db/db.sql b/db/db.sql
index 4df3345..69c9fcc 100644
--- a/db/db.sql
+++ b/db/db.sql
@@ -2,15 +2,15 @@ CREATE DATABASE clog;
\connect clog
-CREATE TABLE entries (
+CREATE TABLE posts (
id BIGINT NOT NULL, -- PRIMARY KEY UUID
title CHARACTER VARYING NOT NULL,
- body CHARACTER VARYING NOT NULL
- -- created_at TIMESTAMP NOT NULL,
- -- updated_at TIMESTAMP NOT NULL
+ body CHARACTER VARYING NOT NULL,
+ created_at TIMESTAMP NOT NULL DEFAULT NOW(),
+ updated_at TIMESTAMP NOT NULL DEFAULT NOW()
);
-INSERT INTO entries (
+INSERT INTO posts (
id,
title,
body
@@ -18,17 +18,23 @@ INSERT INTO entries (
VALUES
(
1,
- 'foo',
- 'bar'
+ 'First Post',
+ '# Heading
+
+Content
+
+## Sub heading
+
+More content ...'
),
(
2,
- 'baz',
- 'zoo'
+ 'Second Post',
+ 'Testing [a link](https://bunkergate.org)'
),
(
3,
'xxx',
- '**bold**'
+ '**testing bold**'
);