code: def upgrade():
      # ### commands auto generated by Alembic - please adjust! ###
      with op.batch_alter_table("predictor", schema=None) as batch_op:
          batch_op.add_column(
              sa.Column("label", sa.String(), nullable=True)
          )
          batch_op.add_column(
              sa.Column("version", sa.Integer(), nullable=True)
          )
  
      # update current predictor versions
      conn = op.get_bind()
      session = sa.orm.Session(bind=conn)
  
      key0 = (None, None, None)
      models = conn.execute(
          sa.text(
              """
          select company_id, project_id, name, id
          from predictor
          order by company_id, project_id, name, created_at
      """
          )
      ).fetchall()
      for model in models:
          key = (
              model["company_id"],
              model["project_id"],
              model["name"].lower(),
          )
  
          # it is different name or project or company
          if key != key0:
              version = 1
              key0 = key
  
          conn.execute(
              text(
                  """
                  update predictor
                  set version = :version
                  where id = :id
              """
              ),
              {"version": version, "id": model["id"]},
          )
          version += 1
  
      session.commit()
  
imports: from alembic import op
  import sqlalchemy
  from sqlalchemy.sql import text
label_desc: Use image node_id 1 for calling a global function with example usage: upgrade() without return types