aboutsummaryrefslogtreecommitdiff
path: root/db/db.sql
blob: 421176f0a55fe500c45fc6390ec2f976ddb0b342 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
CREATE DATABASE clog;

\connect clog

CREATE EXTENSION IF NOT EXISTS "uuid-ossp";

CREATE TABLE posts (
    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(),
    updated_at TIMESTAMP NOT NULL DEFAULT NOW()
);