diff --git a/migrations/02_add_archive_count.py b/migrations/02_add_archive_count.py index dc5b19b..370899d 100644 --- a/migrations/02_add_archive_count.py +++ b/migrations/02_add_archive_count.py @@ -64,15 +64,19 @@ ] ) .where( - Alert.c.avro_archive_id.in_(sa.select([Archive.c.avro_archive_id]).where(Archive.c.refcount == 0)) + Alert.c.avro_archive_id.in_( + sa.select([Archive.c.avro_archive_id]).where( + Archive.c.refcount == 0 + ) + ) ) .group_by(Alert.c.avro_archive_id) ).alias("target") - statement = Archive.update().values(refcount=target.c.refcount).where( - Archive.c.avro_archive_id == target.c.avro_archive_id + connection.execute( + Archive.update() + .values(refcount=target.c.refcount) + .where(Archive.c.avro_archive_id == target.c.avro_archive_id) ) - print(statement.compile(engine, compile_kwargs={"literal_binds": True})) - assert False if False: for row in connection.execute(