BEGIN;

-- fcr_value and cum_depletion_rate were created as NUMERIC(7,3) (max integer part: 9999).
-- Early-laying flocks produce very few eggs relative to total feed consumed, so
-- FCR = usageInGrams / totalEggWeightGrams can legitimately exceed 9999 (e.g. ~31 740).
-- Widening to NUMERIC(15,3) keeps the same 3-decimal-place scale and is
-- fully backward-compatible: no existing value will be truncated or altered.

ALTER TABLE recordings
    ALTER COLUMN fcr_value          TYPE NUMERIC(15,3) USING fcr_value::NUMERIC(15,3),
    ALTER COLUMN cum_depletion_rate TYPE NUMERIC(15,3) USING cum_depletion_rate::NUMERIC(15,3);

COMMIT;
