-- CostusWorx © 2026 — retireuk.costusworx.co.za
-- Persist the run-time deferral on each saved simulation run. Lets CSV/PDF exports
-- reflect the accumulation period AS IT WAS WHEN THE RUN WAS SAVED, rather than
-- recomputing months-to-retirement from "today" (which shrinks over time and would
-- drift from the stored projection path). NULL on old rows → exports fall back to
-- recomputing from the scenario.
SET NAMES utf8mb4;

ALTER TABLE simulation_runs
    ADD COLUMN IF NOT EXISTS accumulation_months INT DEFAULT NULL
        COMMENT 'Months to retirement captured at run time (deferral); NULL = legacy run';
