From 825ee3743202c641a7c329777c0bd08097fe32dc Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 5 Apr 2024 12:57:53 +0100 Subject: [PATCH] db: rename_table is not a batch operation This is reported upstream [1] but I suspect the root cause is that we were relying on a bug in Alembic: renaming tables doesn't really make sense as a batch operation, which by definition works by recreating tables with an updated schema (to support SQLite and its lack of full 'ALTER' support). [1] https://github.com/sqlalchemy/alembic/issues/1453 Signed-off-by: Stephen Finucane Change-Id: I1da6d117778bbbad64b2df2dfd2f8aeef8a7084c --- .../alembic/versions/5077ffcc5f1c_add_share_instances.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manila/db/migrations/alembic/versions/5077ffcc5f1c_add_share_instances.py b/manila/db/migrations/alembic/versions/5077ffcc5f1c_add_share_instances.py index cce8507425..75b53a5c2a 100644 --- a/manila/db/migrations/alembic/versions/5077ffcc5f1c_add_share_instances.py +++ b/manila/db/migrations/alembic/versions/5077ffcc5f1c_add_share_instances.py @@ -246,8 +246,9 @@ def upgrade_export_locations_table(connection): with op.batch_alter_table("share_export_locations") as batch_op: batch_op.drop_constraint('sel_id_fk', type_='foreignkey') batch_op.drop_column('share_id') - batch_op.rename_table('share_export_locations', - 'share_instance_export_locations') + + op.rename_table( + 'share_export_locations', 'share_instance_export_locations') def downgrade_export_locations_table(connection):