[alembic] Alembic operations require keywords only arguments

Since [1] (release 1.11.0), the Alembic operations "now enforce
keyword-only arguments as passed as keyword and not positionally"
(from the commit message).

This change is compatible with the previous versions (as confirmed
in the CI).

[1]df75e85489

Closes-Bug: #2019948
Change-Id: Ic5e7790377668d83be2cebbba8f6bfa09f7cee5e
This commit is contained in:
Rodolfo Alonso Hernandez 2023-05-17 12:06:19 +02:00
parent 0959e452d3
commit 43c756d728
2 changed files with 2 additions and 2 deletions

View File

@ -132,7 +132,7 @@ def recreate_index(index, table_name):
old_name = index['name']
new_name = old_name.replace('tenant', 'project')
op.drop_index(op.f(old_name), table_name)
op.drop_index(index_name=op.f(old_name), table_name=table_name)
op.create_index(new_name, table_name, ['project_id'])

View File

@ -99,7 +99,7 @@ def recreate_index(table):
for idx in (idx for idx in indexes if idx['name'] == index_name):
old_name = idx['name']
new_name = old_name.replace('target_tenant', 'target_project')
op.drop_index(op.f(old_name), table)
op.drop_index(index_name=op.f(old_name), table_name=table)
op.create_index(new_name, table, ['target_project'])