UPDATE quota_reservations
SET status = 'refunded',
    refunded_amount = reserved_amount,
    updated_at = NOW()
WHERE status = 'reset';

ALTER TABLE quota_reservations
    DROP CONSTRAINT IF EXISTS chk_quota_reservation_status;

ALTER TABLE quota_reservations
    ADD CONSTRAINT chk_quota_reservation_status
        CHECK (status IN ('pending', 'confirmed', 'refunded'));
