From 9bd6fe0e5f690970c49ee993e5012bef5868d9ab Mon Sep 17 00:00:00 2001 From: Michael McVady Date: Thu, 18 Nov 2021 14:45:16 -0500 Subject: Add `created_at` field to DB --- db/db.sql | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'db/db.sql') 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**' ); -- cgit v1.2.3