fediblog/migrations/2023-10-15-172149_create_posts/up.sql
Louis Hollingworth cf80d4b70d
(feat) Server is now running
Added DB schemas that are needed for the basics.

Signed-off-by: Louis Hollingworth <louis@hollingworth.nl>
2023-10-17 18:20:02 +01:00

18 lines
511 B
SQL

-- SPDX-FileCopyrightText: 2023 Louis Hollingworth <louis@hollingworth.nl>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later
-- Your SQL goes here
CREATE TABLE posts (
id SERIAL PRIMARY KEY,
slug VARCHAR NOT NULL,
title VARCHAR NOT NULL,
body TEXT NOT NULL,
published BOOLEAN NOT NULL DEFAULT FALSE,
user_id UUID NOT NULL REFERENCES users(id),
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW()
);
SELECT diesel_manage_updated_at('posts');