code: def downgrade():
      conn = op.get_bind()
      session = sa.orm.Session(bind=conn)
  
      integrations = conn.execute(
          sa.text(
              """
          select id, name, type, data from integration
      """
          )
      ).fetchall()
  
      for row in integrations:
          try:
              data = json.loads(row["data"])
          except Exception:
              data = {}
          if row["engine"] is not None:
              data["type"] = row["engine"]
  
          conn.execute(
              text(
                  """
                  update integration
                  set data = :integration_data
                  where id = :integration_id
              """
              ),
              {
                  "integration_data": json.dumps(data),
                  "integration_id": row["id"],
              },
          )
  
      with op.batch_alter_table("integration", schema=None) as batch_op:
          batch_op.drop_column("engine")
  
      session.commit()
  
imports: import json
  from alembic import op
  import sqlalchemy
  from sqlalchemy.sql import text
  import mindsdb.interfaces.storage.db
label_desc: Use image node_id 2 for calling a global function with example usage: downgrade() without return types