aboutsummaryrefslogtreecommitdiffstats
path: root/internal/db/migrations/blog/00014_drop_page_kind.sql
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/migrations/blog/00014_drop_page_kind.sql')
-rw-r--r--internal/db/migrations/blog/00014_drop_page_kind.sql15
1 files changed, 15 insertions, 0 deletions
diff --git a/internal/db/migrations/blog/00014_drop_page_kind.sql b/internal/db/migrations/blog/00014_drop_page_kind.sql
new file mode 100644
index 0000000..1bbf493
--- /dev/null
+++ b/internal/db/migrations/blog/00014_drop_page_kind.sql
@@ -0,0 +1,15 @@
+-- +goose Up
+-- Special pages (00013) were dropped before release: the kind column and the
+-- hidden-files table go, the migration stays so databases that ran it still
+-- match the chain.
+DROP TABLE page_hidden_files;
+ALTER TABLE pages DROP COLUMN kind;
+
+-- +goose Down
+ALTER TABLE pages ADD COLUMN kind text NOT NULL DEFAULT 'posts'
+ CHECK (kind IN ('posts', 'gallery'));
+CREATE TABLE page_hidden_files (
+ page_id bigint NOT NULL REFERENCES pages(id) ON DELETE CASCADE,
+ file_id uuid NOT NULL REFERENCES files(id) ON DELETE CASCADE,
+ PRIMARY KEY (page_id, file_id)
+);