def upgrade(migrate_engine):
    meta.bind = migrate_engine
    domains_table = Table('domains', meta, autoload=True)
    constraint = UniqueConstraint('name', 'deleted', name=CONSTRAINT_NAME, table=domains_table)
    constraint.drop()
    constraint = UniqueConstraint('name', 'deleted', 'pool_id', name=CONSTRAINT_NAME, table=domains_table)
    constraint.create()
def upgrade(migrate_engine):
    meta.bind = migrate_engine
    domains_table = Table('domains', meta, autoload=True)
    constraint = UniqueConstraint('name', 'deleted', name=CONSTRAINT_NAME, table=domains_table)
    constraint.drop()
    constraint = UniqueConstraint('name', 'deleted', 'pool_id', name=CONSTRAINT_NAME, table=domains_table)
    constraint.create()