Added basic models and schemas.

Signed-off-by: Louis Hollingworth <louis@hollingworth.nl>
This commit is contained in:
Louis Hollingworth 2023-10-15 21:33:14 +01:00
parent ab60127530
commit b330bea46d
Signed by: lucxjo
GPG key ID: A11415CB3DC7809B
18 changed files with 250 additions and 1 deletions

View file

@ -0,0 +1,6 @@
-- SPDX-FileCopyrightText: 2023 Louis Hollingworth <louis@hollingworth.nl>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later
-- This file should undo anything in `up.sql`
DROP TABLE blogs;

View file

@ -0,0 +1,18 @@
-- SPDX-FileCopyrightText: 2023 Louis Hollingworth <louis@hollingworth.nl>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later
-- Your SQL goes here
CREATE TABLE blogs (
id SERIAL PRIMARY KEY,
slug VARCHAR NOT NULL,
name VARCHAR NOT NULL,
description TEXT NOT NULL,
url TEXT NOT NULL,
owner INTEGER NOT NULL REFERENCES users(id),
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
updated_at TIMESTAMP NOT NULL DEFAULT NOW()
);
SELECT diesel_manage_updated_at('blogs');