-- Increase probability column precision from numeric(5,2) to numeric(6,4)
-- numeric(5,2) only stores 2 decimal places (e.g. 0.05), causing EV sums to drift
-- from the expected 340 due to rounding. numeric(6,4) stores 4 decimal places
-- (e.g. 0.0457), sufficient for 10,000-simulation output (min step = 0.0001).

ALTER TABLE "participant_expected_values"
  ALTER COLUMN "prob_first"   TYPE numeric(6,4) USING prob_first::numeric(6,4),
  ALTER COLUMN "prob_second"  TYPE numeric(6,4) USING prob_second::numeric(6,4),
  ALTER COLUMN "prob_third"   TYPE numeric(6,4) USING prob_third::numeric(6,4),
  ALTER COLUMN "prob_fourth"  TYPE numeric(6,4) USING prob_fourth::numeric(6,4),
  ALTER COLUMN "prob_fifth"   TYPE numeric(6,4) USING prob_fifth::numeric(6,4),
  ALTER COLUMN "prob_sixth"   TYPE numeric(6,4) USING prob_sixth::numeric(6,4),
  ALTER COLUMN "prob_seventh" TYPE numeric(6,4) USING prob_seventh::numeric(6,4),
  ALTER COLUMN "prob_eighth"  TYPE numeric(6,4) USING prob_eighth::numeric(6,4);

ALTER TABLE "participant_ev_snapshots"
  ALTER COLUMN "prob_first"   TYPE numeric(6,4) USING prob_first::numeric(6,4),
  ALTER COLUMN "prob_second"  TYPE numeric(6,4) USING prob_second::numeric(6,4),
  ALTER COLUMN "prob_third"   TYPE numeric(6,4) USING prob_third::numeric(6,4),
  ALTER COLUMN "prob_fourth"  TYPE numeric(6,4) USING prob_fourth::numeric(6,4),
  ALTER COLUMN "prob_fifth"   TYPE numeric(6,4) USING prob_fifth::numeric(6,4),
  ALTER COLUMN "prob_sixth"   TYPE numeric(6,4) USING prob_sixth::numeric(6,4),
  ALTER COLUMN "prob_seventh" TYPE numeric(6,4) USING prob_seventh::numeric(6,4),
  ALTER COLUMN "prob_eighth"  TYPE numeric(6,4) USING prob_eighth::numeric(6,4);
