code: def upgrade():
      """Apply Add case-insensitive unique constraint"""
      conn = op.get_bind()
      if conn.dialect.name == "postgresql":
          op.create_index(
              "idx_ab_user_username",
              "ab_user",
              [sa.text("LOWER(username)")],
              unique=True,
          )
          op.create_index(
              "idx_ab_register_user_username",
              "ab_register_user",
              [sa.text("LOWER(username)")],
              unique=True,
          )
      elif conn.dialect.name == "sqlite":
          with op.batch_alter_table("ab_user") as batch_op:
              batch_op.alter_column(
                  "username",
                  existing_type=sa.String(64),
                  _type=sa.String(64, collation="NOCASE"),
                  unique=True,
                  nullable=False,
              )
          with op.batch_alter_table("ab_register_user") as batch_op:
              batch_op.alter_column(
                  "username",
                  existing_type=sa.String(64),
                  _type=sa.String(64, collation="NOCASE"),
                  unique=True,
                  nullable=False,
              )
  
imports: from __future__ import annotations
  import sqlalchemy
  from alembic import op
label_desc: Use image node_id 1 for calling a global function with example usage: upgrade() without return types