BEGIN;

-- Revert fcr_value and cum_depletion_rate back to NUMERIC(7,3).
-- WARNING: any value with an integer part > 9999 (e.g. high-FCR early-laying recordings)
-- will fail the cast and must be cleared first, or this rollback will error.

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

COMMIT;
