Have got publishing to Netlify

This commit is contained in:
Leon Mika 2025-01-27 15:45:53 +11:00
parent 8e0ffb6c24
commit 7ef6725bdb
23 changed files with 667 additions and 109 deletions

View file

@ -3,6 +3,14 @@ CREATE TYPE post_state AS ENUM (
'published'
);
CREATE TYPE target_role AS ENUM (
'production'
);
CREATE TYPE target_type AS ENUM (
'netlify'
);
CREATE TABLE site (
id BIGSERIAL NOT NULL PRIMARY KEY,
name TEXT NOT NULL UNIQUE,
@ -22,5 +30,16 @@ CREATE TABLE post (
post_date TIMESTAMP WITH TIME ZONE,
created_at TIMESTAMP NOT NULL,
FOREIGN KEY (site_id) REFERENCES site(id)
FOREIGN KEY (site_id) REFERENCES site (id)
);
CREATE TABLE publish_target (
id BIGSERIAL NOT NULL PRIMARY KEY,
site_id BIGINT NOT NULL,
role target_role NOT NULL,
target_type target_type NOT NULL,
url TEXT NOT NULL,
target_ref TEXT NOT NULL,
FOREIGN KEY (site_id) REFERENCES site (id)
);