Files
probably-rendering-one-more…/apps/waterfall-wiki/db/011_post_archiving.sql
T
codex-bot e57f7b7518
waterfall-wiki CI and deployment / verify-and-deploy (push) Successful in 18m21s
Add reversible post archiving across Wiki discovery and feeds
2026-10-27 21:09:57 +08:00

7 lines
362 B
PL/PgSQL

BEGIN;
ALTER TABLE posts ADD COLUMN IF NOT EXISTS archived boolean NOT NULL DEFAULT false;
ALTER TABLE posts ADD COLUMN IF NOT EXISTS archived_at timestamptz;
CREATE INDEX IF NOT EXISTS posts_active_timeline ON posts(created_at DESC,id DESC) WHERE NOT archived;
INSERT INTO schema_migrations(version) VALUES('011_post_archiving') ON CONFLICT DO NOTHING;
COMMIT;