fix: benchmark_migration.py needs to close sssion (#15822)
This commit is contained in:
parent
32a5680510
commit
d26254099e
|
|
@ -172,6 +172,7 @@ def main(
|
|||
rows = session.query(model).count()
|
||||
print(f"- {model.__name__} ({rows} rows in table {model.__tablename__})")
|
||||
model_rows[model] = rows
|
||||
session.close()
|
||||
|
||||
print("Benchmarking migration")
|
||||
results: Dict[str, float] = {}
|
||||
|
|
|
|||
|
|
@ -32,8 +32,10 @@ from sqlalchemy_utils import UUIDType
|
|||
|
||||
|
||||
def upgrade():
|
||||
op.add_column("report_execution_log", sa.Column("uuid", UUIDType(binary=True)))
|
||||
with op.batch_alter_table("report_execution_log") as batch_op:
|
||||
batch_op.add_column(sa.Column("uuid", UUIDType(binary=True)))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_column("report_execution_log", "uuid")
|
||||
with op.batch_alter_table("report_execution_log") as batch_op:
|
||||
batch_op.drop_column("uuid")
|
||||
|
|
|
|||
Loading…
Reference in New Issue