def upgrade(migrate_engine):
    meta = MetaData(bind=migrate_engine)
    key_pairs = Table('key_pairs', meta, autoload=True)

    # Note: Since we are altering name field, this constraint on name needs to
    # first be dropped before we can alter name. We then re-create the same
    # constraint. It was first added in 216_havana.py so no need to remove
    # constraint on downgrade.
    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=key_pairs,
                     name='uniq_key_pairs0user_id0name0deleted').create()
Test whether passing translated attributes to __init__() works.
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--crossover with--dataset/ETHPy150Open edoburu/django-parler/parler/tests/test_model_attributes.py/ModelAttributeTests.test_init_args