def upgrade(migrate_engine):

    meta = MetaData(bind=migrate_engine)

    bdm = Table('block_device_mapping', meta, autoload=True)
    for index in bdm.indexes:
        if index.name == INDEX_NAME:
            index.drop()
Remove duplicate index from block_device_mapping table.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/db/sqlalchemy/migrate_repo/versions/249_remove_duplicate_index.py/upgrade