Merge "Fix migration scripts with SQLAlchemy 2.0"

This commit is contained in:
Zuul 2024-04-17 00:17:51 +00:00 committed by Gerrit Code Review
commit 0c004ecbb2
2 changed files with 3 additions and 3 deletions

View File

@ -54,8 +54,8 @@ def upgrade():
sa.ForeignKey('load_balancer.id'), nullable=True))
# Populate this new column appropriately
select_obj = sa.select([listener.c.load_balancer_id,
listener.c.default_pool_id]).where(
select_obj = sa.select(listener.c.load_balancer_id,
listener.c.default_pool_id).where(
listener.c.default_pool_id is not None)
result = conn.execute(select_obj)
for row in result:

View File

@ -43,7 +43,7 @@ def migrate_pools():
j = pool_table.join(lb_table,
pool_table.c.load_balancer_id == lb_table.c.id)
stmt = sa.select([pool_table.c.id]).select_from(j).where(
stmt = sa.select(pool_table.c.id).select_from(j).where(
lb_table.c.provider == 'ovn')
result = conn.execute(stmt)