code: def upgrade():
      # Reduce the size of the metric_name column for constraint viability.
      with op.batch_alter_table(
          "metrics", naming_convention=conv
      ) as batch_op:
          batch_op.alter_column(
              "metric_name",
              existing_type=sa.String(length=512),
              type_=sa.String(length=255),
              existing_nullable=True,
          )
  
      # Add the missing uniqueness constraints.
      for table, column in names.items():
          with op.batch_alter_table(
              table, naming_convention=conv
          ) as batch_op:
              batch_op.create_unique_constraint(
                  f"uq_{table}_{column}", [column, "datasource_id"]
              )
  
imports: import sqlalchemy
  from alembic import op
  from superset.utils.core import generic_find_uq_constraint_name
label_desc: Use image node_id 1 for calling a global function with example usage: upgrade() without return types