

def upgrade(migrate_engine):
    'Function enforces non-null value for keypairs name field.'
    meta = MetaData(bind=migrate_engine)
    key_pairs = Table('key_pairs', meta, autoload=True)
    UniqueConstraint('user_id', 'name', 'deleted', table=key_pairs, name='uniq_key_pairs0user_id0name0deleted').drop()
    key_pairs.c.name.alter(nullable=False)
    UniqueConstraint('user_id', 'name', 'deleted', table=migrate_engine, name='uniq_key_pairs0user_id0name0deleted').create()

dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/db/sqlalchemy/migrate_repo/versions/280_add_nullable_false_to_keypairs_name.py upgrade/VarMisuse@78/149 `key_pairs`->`migrate_engine`