This commit is contained in:
Dominic Grimm 2023-02-08 22:13:11 +01:00
parent 94fb270008
commit 584c07ff23
No known key found for this signature in database
GPG key ID: 6F294212DEAAC530
22 changed files with 539 additions and 187 deletions

View file

@ -1,7 +1,3 @@
DROP TABLE posts;
DROP TABLE tags;
DROP INDEX configs_active;
DROP TABLE configs;
DROP TABLE tags;

View file

@ -1,37 +1,3 @@
CREATE TABLE configs(
id SERIAL PRIMARY KEY,
active BOOLEAN NOT NULL,
name TEXT NOT NULL,
description TEXT NOT NULL,
copyright TEXT NOT NULL,
owner_name TEXT NOT NULL,
owner_email TEXT NOT NULL,
owner_website TEXT
);
CREATE UNIQUE INDEX configs_active ON configs(active)
WHERE
active;
INSERT INTO
configs(
active,
name,
description,
copyright,
owner_name,
owner_email
)
VALUES
(
TRUE,
'generic blog',
'just a generic blog',
'(C) just a generic blog',
'generic blog owner',
'blog@example.com'
);
CREATE TABLE tags(
id SERIAL PRIMARY KEY,
name TEXT UNIQUE NOT NULL
@ -46,4 +12,4 @@ CREATE TABLE posts(
published_at DATE NOT NULL,
edited_at DATE,
active BOOLEAN NOT NULL
);
);