Files
sorsfonalak/crates/db/migrations/0016_forecast_prompt.sql
T
fecoandClaude Opus 5.5 b0e35433ac
CI / test (push) Successful in 59s
CI / build (push) Successful in 5m29s
CI / deploy (push) Skipped
Admin: the yearly forecast prompt is editable and can be tried on own forecasts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
2026-11-18 11:10:40 +00:00

15 lines
880 B
SQL

-- 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)
);