code: def upgrade():
      op.create_table(
          "project",
          sa.Column("id", sa.Integer(), nullable=False),
          sa.Column("created_at", sa.DateTime(), nullable=True),
          sa.Column("updated_at", sa.DateTime(), nullable=True),
          sa.Column("deleted_at", sa.DateTime(), nullable=True),
          sa.Column("name", sa.String(), nullable=False),
          sa.Column("company_id", sa.Integer(), nullable=True),
          sa.PrimaryKeyConstraint("id"),
          sa.UniqueConstraint(
              "name",
              "company_id",
              name="unique_project_name_company_id",
          ),
      )
  
      conn = op.get_bind()
      session = sa.orm.Session(bind=conn)
  
      project_record = db.Project(name="mindsdb")
      session.add(project_record)
      session.commit()
  
      with op.batch_alter_table("predictor", schema=None) as batch_op:
          batch_op.add_column(sa.Column("project_id", sa.Integer()))
          batch_op.create_foreign_key(
              "fk_project_id", "project", ["project_id"], ["id"]
          )
  
      conn.execute(
          sa.sql.text(
              """
          update predictor set project_id = :project_id
      """
          ),
          {"project_id": project_record.id},
      )
  
      with op.batch_alter_table("predictor", schema=None) as batch_op:
          batch_op.alter_column(
              "project_id", existing_type=sa.INTEGER(), nullable=False
          )
  
      with op.batch_alter_table("view", schema=None) as batch_op:
          batch_op.add_column(sa.Column("project_id", sa.Integer()))
          batch_op.create_foreign_key(
              "fk_project_id", "project", ["project_id"], ["id"]
          )
  
      conn.execute(
          sa.sql.text(
              """
          update view set project_id = :project_id
      """
          ),
          {"project_id": project_record.id},
      )
  
      with op.batch_alter_table("view", schema=None) as batch_op:
          batch_op.alter_column(
              "project_id", existing_type=sa.INTEGER(), nullable=False
          )
  
      views = conn.execute(
          sa.text(
              """
          select id, name from view
          where exists (select 1 from predictor where view.name = predictor.name)
      """
          )
      ).fetchall()
  
      for row in views:
          conn.execute(
              text(
                  """
                  update view
                  set name = :name
                  where id = :view_id
              """
              ),
              {"name": f"{row['name']}_view", "view_id": row["id"]},
          )
  
      session.commit()
  
imports: from alembic import op
  import sqlalchemy
  from sqlalchemy.sql import text
  import mindsdb.interfaces.storage.db
label_desc: Use image node_id 1 for calling a global function with example usage: upgrade() without return types