code: def downgrade():
      bind = op.get_bind()
      session = orm.Session(bind=bind)
  
      try:
          records = session.query(TrialValueModel).all()
          mapping = []
          for r in records:
              if r.value_type == TrialValueModel.TrialValueType.FINITE:
                  continue
  
              _value = r.value
              if r.value_type == TrialValueModel.TrialValueType.INF_POS:
                  _value = RDB_MAX_FLOAT
              else:
                  _value = RDB_MIN_FLOAT
  
              mapping.append(
                  {
                      "trial_value_id": r.trial_value_id,
                      "value": _value,
                  }
              )
          session.bulk_update_mappings(TrialValueModel, mapping)
          session.commit()
      except SQLAlchemyError as e:
          session.rollback()
          raise e
      finally:
          session.close()
  
      with op.batch_alter_table(
          "trial_values", schema=None
      ) as batch_op:
          batch_op.drop_column("value_type")
          batch_op.alter_column(
              "value",
              existing_type=sa.Float(precision=FLOAT_PRECISION),
              nullable=False,
          )
  
      sa.Enum(TrialValueModel.TrialValueType).drop(
          bind, checkfirst=True
      )
  
file_path: optuna/optuna/storages/_rdb/alembic/versions/v3.0.0.d.py
imports: import enum
  import numpy
  from alembic import op
  import sqlalchemy
  from sqlalchemy.exc import SQLAlchemyError
  from sqlalchemy import orm
  from typing import Optional
  from typing import Tuple
label_desc: Use image node_id 2 for calling a global function with example usage: downgrade() without return types