Admin: the yearly forecast prompt is editable and can be tried on own forecasts
CI / test (push) Successful in 59s
CI / build (push) Successful in 5m29s
CI / deploy (push) Skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-18 11:10:40 +00:00
co-authored by Claude Opus 5.5
parent f1bd34c394
commit b0e35433ac
7 changed files with 168 additions and 32 deletions
@@ -0,0 +1,14 @@
-- The yearly forecast prompt is editable on the admin page too, and can be
-- tried on one of the admin's own forecasts.
ALTER TABLE prompt_revisions DROP CONSTRAINT prompt_revisions_kind_check;
ALTER TABLE prompt_revisions ADD CONSTRAINT prompt_revisions_kind_check
CHECK (kind IN ('summary', 'natal', 'synastry', 'forecast'));
ALTER TABLE prompt_previews DROP CONSTRAINT prompt_previews_target;
ALTER TABLE prompt_previews
ADD COLUMN forecast_id uuid REFERENCES forecasts ON DELETE CASCADE,
ADD CONSTRAINT prompt_previews_target CHECK (
(kind IN ('summary', 'natal') AND chart_id IS NOT NULL AND synastry_id IS NULL AND forecast_id IS NULL)
OR (kind = 'synastry' AND synastry_id IS NOT NULL AND chart_id IS NULL AND forecast_id IS NULL)
OR (kind = 'forecast' AND forecast_id IS NOT NULL AND chart_id IS NULL AND synastry_id IS NULL)
);