"""Bytea address in labels

Revision ID: 2e90b758090c
Revises: 792ca9c4722c
Create Date: 2024-07-15 17:38:36.529835

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "2e90b758090c"
down_revision: Union[str, None] = "9ca39b11e12a"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.execute(
        "ALTER TABLE amoy_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE amoy_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE amoy_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE arbitrum_nova_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE arbitrum_nova_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE arbitrum_nova_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE arbitrum_one_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE arbitrum_one_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE arbitrum_one_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE arbitrum_sepolia_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE arbitrum_sepolia_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE arbitrum_sepolia_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE avalanche_fuji_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE avalanche_fuji_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE avalanche_fuji_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE avalanche_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE avalanche_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE avalanche_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE base_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE base_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE base_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE blast_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE blast_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE blast_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE blast_sepolia_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE blast_sepolia_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE blast_sepolia_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE ethereum_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE ethereum_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE ethereum_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE game7_orbit_arbitrum_sepolia_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE game7_orbit_arbitrum_sepolia_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE game7_orbit_arbitrum_sepolia_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE mantle_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE mantle_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE mantle_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE mantle_sepolia_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE mantle_sepolia_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE mantle_sepolia_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE mumbai_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE mumbai_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE mumbai_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE polygon_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE polygon_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE polygon_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE proofofplay_apex_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE proofofplay_apex_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE proofofplay_apex_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE sepolia_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE sepolia_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE sepolia_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE starknet_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE starknet_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE starknet_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE starknet_sepolia_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE starknet_sepolia_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE starknet_sepolia_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE xai_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE xai_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE xai_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE xai_sepolia_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE xai_sepolia_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE xai_sepolia_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE xdai_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE xdai_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE xdai_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE zksync_era_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE zksync_era_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE zksync_era_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    op.execute(
        "ALTER TABLE zksync_era_sepolia_labels ALTER COLUMN caller_address TYPE bytea USING caller_address::bytea"
    )
    op.execute(
        "ALTER TABLE zksync_era_sepolia_labels ALTER COLUMN origin_address TYPE bytea USING origin_address::bytea"
    )
    op.execute(
        "ALTER TABLE zksync_era_sepolia_labels ALTER COLUMN address TYPE bytea USING address::bytea"
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "zksync_era_sepolia_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "zksync_era_sepolia_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "zksync_era_sepolia_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "zksync_era_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "zksync_era_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "zksync_era_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "xdai_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "xdai_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "xdai_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "xai_sepolia_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "xai_sepolia_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "xai_sepolia_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "xai_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "xai_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "xai_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "starknet_sepolia_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "starknet_sepolia_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "starknet_sepolia_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "starknet_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "starknet_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "starknet_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "sepolia_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "sepolia_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "sepolia_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "proofofplay_apex_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "proofofplay_apex_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "proofofplay_apex_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "polygon_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "polygon_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "polygon_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "mumbai_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "mumbai_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "mumbai_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "mantle_sepolia_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "mantle_sepolia_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "mantle_sepolia_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "mantle_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "mantle_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "mantle_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "game7_orbit_arbitrum_sepolia_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "game7_orbit_arbitrum_sepolia_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "game7_orbit_arbitrum_sepolia_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "ethereum_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "ethereum_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "ethereum_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "blast_sepolia_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "blast_sepolia_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "blast_sepolia_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "blast_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "blast_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "blast_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "base_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "base_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "base_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "avalanche_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "avalanche_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "avalanche_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "avalanche_fuji_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "avalanche_fuji_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "avalanche_fuji_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "arbitrum_sepolia_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "arbitrum_sepolia_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "arbitrum_sepolia_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "arbitrum_one_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "arbitrum_one_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "arbitrum_one_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "arbitrum_nova_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "arbitrum_nova_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "arbitrum_nova_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "amoy_labels",
        "address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        nullable=True,
    )
    op.alter_column(
        "amoy_labels",
        "origin_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    op.alter_column(
        "amoy_labels",
        "caller_address",
        existing_type=sa.LargeBinary(),
        type_=sa.VARCHAR(length=64),
        existing_nullable=True,
    )
    # ### end Alembic commands ###
