Avoid imposing alembic 6.0 requirement on all distros
Related-to: LP 1224666 Two of the alembic-based migrations use the new 'type_' kwarg in calls to op.drop_constraint(), even though the old 'type' form was retained for backward compatability: https://alembic.readthedocs.org/en/latest/ops.html "Changed in version 0.5.0: The type parameter is now named type_. The old name type will remain for backwards compatibility." To avoid needlessly imposing the alembic 6.0 on distros for which this version is not yet packaged, we revert these migrations to use the older form. The corresponding change to the global requirements is proposed here: https://review.openstack.org/48227 Change-Id: I3796ffa3de0e0f558f368d7ebf8e55c87657753d
This commit is contained in:
parent
09e0f3fabf
commit
0cd1c8baa6
@ -46,12 +46,12 @@ def change_uniq(table_name, uniq_name, columns, downgrade=False):
|
||||
# before renaming of constraint.
|
||||
op.drop_constraint('fk_sourceassoc_meter_id',
|
||||
table_name,
|
||||
type_='foreignkey')
|
||||
type='foreignkey')
|
||||
op.drop_constraint('fk_sourceassoc_user_id',
|
||||
table_name,
|
||||
type_='foreignkey')
|
||||
type='foreignkey')
|
||||
if downgrade:
|
||||
op.drop_constraint(uniq_name, table_name=table_name, type_='unique')
|
||||
op.drop_constraint(uniq_name, table_name=table_name, type='unique')
|
||||
else:
|
||||
op.create_unique_constraint(uniq_name, table_name, columns)
|
||||
if engine.name == 'mysql':
|
||||
|
@ -65,7 +65,7 @@ def index_cleanup(engine_names, table_name, uniq_name, columns, create,
|
||||
op.create_index(uniq_name, table_name, columns, unique=unique)
|
||||
else:
|
||||
if unique:
|
||||
op.drop_constraint(uniq_name, table_name, type_='unique')
|
||||
op.drop_constraint(uniq_name, table_name, type='unique')
|
||||
else:
|
||||
op.drop_index(uniq_name, table_name=table_name)
|
||||
|
||||
|
@ -5,7 +5,7 @@ iso8601>=0.1.4
|
||||
argparse
|
||||
SQLAlchemy>=0.7.8,<0.8
|
||||
sqlalchemy-migrate>=0.7.2
|
||||
alembic>=0.6.0
|
||||
alembic>=0.4.1
|
||||
netaddr
|
||||
pymongo>=2.4
|
||||
eventlet>=0.13.0
|
||||
|
Loading…
x
Reference in New Issue
Block a user