aboutsummaryrefslogtreecommitdiffstats
path: root/internal/db/migrations/blog/00006_format.sql
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/migrations/blog/00006_format.sql')
-rw-r--r--internal/db/migrations/blog/00006_format.sql11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/db/migrations/blog/00006_format.sql b/internal/db/migrations/blog/00006_format.sql
new file mode 100644
index 0000000..865e4d8
--- /dev/null
+++ b/internal/db/migrations/blog/00006_format.sql
@@ -0,0 +1,11 @@
+-- +goose Up
+-- Posts, page intros and announcements can be written as raw HTML instead of
+-- Markdown; the *_md column holds the source either way, format says which.
+ALTER TABLE posts ADD COLUMN format text NOT NULL DEFAULT 'markdown' CHECK (format IN ('markdown', 'html'));
+ALTER TABLE pages ADD COLUMN format text NOT NULL DEFAULT 'markdown' CHECK (format IN ('markdown', 'html'));
+ALTER TABLE sections ADD COLUMN format text NOT NULL DEFAULT 'markdown' CHECK (format IN ('markdown', 'html'));
+
+-- +goose Down
+ALTER TABLE posts DROP COLUMN format;
+ALTER TABLE pages DROP COLUMN format;
+ALTER TABLE sections DROP COLUMN format;