code: def upgrade():
      # Attempt to drop any existing `status` constraints on the `runs` table. This operation
      # may fail against certain backends with different classes of Exception. For example,
      # in MySQL <= 8.0.15, dropping constraints produces an invalid `ALTER TABLE` expression.
      # Further, in certain versions of sqlite, `ALTER` (which is invoked by `drop_constraint`)
      # is unsupported on `CHECK` constraints. Accordingly, we catch the generic `Exception`
      # object because the failure modes are not well-enumerated or consistent across database
      # backends. Because failures automatically stop batch operations and the `drop_constraint()`
      # operation is expected to fail under certain circumstances, we execute `drop_constraint()`
      # outside of the batch operation context.
      try:
          # For other database backends, the status check constraint is dropped by
          # cfd24bdc0731_update_run_status_constraint_with_killed.py
          if op.get_bind().engine.name == "mysql":
              op.drop_constraint(
                  constraint_name="status",
                  table_name="runs",
                  type_="check",
              )
      except Exception as e:
          _logger.warning(
              "Failed to drop check constraint. Dropping check constraints may not be supported"
              " by your SQL database. Exception content: %s",
              e,
          )
  
imports: import logging
  from alembic import op
label_desc: Use image node_id 1 for calling a global function with example usage: upgrade() without return types