Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
15 lines
880 B
SQL
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)
|
|
);
|