diff options
author | Michael McVady <femtonaut@gmail.com> | 2021-11-18 14:45:16 -0500 |
---|---|---|
committer | Michael McVady <femtonaut@gmail.com> | 2021-11-18 14:45:16 -0500 |
commit | 9bd6fe0e5f690970c49ee993e5012bef5868d9ab (patch) | |
tree | 880bab31ea18cb48946b3c5fe3c91337e1cffe5b /db | |
parent | ef14cbf2f0c4431ce6ad618e93316ab7c6d42ff6 (diff) |
Add `created_at` field to DB
Diffstat (limited to 'db')
-rw-r--r-- | db/db.sql | 26 |
1 files changed, 16 insertions, 10 deletions
@@ -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**' ); |