code: def downgrade():
      bind = op.get_bind()
      session = orm.Session(bind=bind)
  
      try:
          number_attrs = []
          trials = session.query(TrialModel).all()
          for trial in trials:
              number_attrs.append(
                  TrialSystemAttributeModel(
                      trial_id=trial.trial_id,
                      key="_number",
                      value_json=json.dumps(trial.number),
                  )
              )
          session.bulk_save_objects(number_attrs)
          session.commit()
      except SQLAlchemyError as e:
          session.rollback()
          raise e
      finally:
          session.close()
  
      with op.batch_alter_table("trials") as batch_op:
          batch_op.drop_column("number")
  
file_path: optuna/optuna/storages/_rdb/alembic/versions/v1.3.0.a.py
imports: import json
  from alembic import op
  import sqlalchemy
  from sqlalchemy.exc import SQLAlchemyError
  from sqlalchemy import orm
label_desc: Use image node_id 2 for calling a global function with example usage: downgrade() without return types