From 5ffe8e070381dc23dbb7dfb5031d12c3f93145af Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2026 06:58:25 +0000 Subject: [PATCH] [CLEANUP] Unused process_revision_directives function Removed the unused process_revision_directives function and its registration from migrations/env.py to simplify the codebase. Verified that flask db migrate and upgrade still function correctly. Co-authored-by: arumes31 <114224498+arumes31@users.noreply.github.com> --- migrations/env.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/migrations/env.py b/migrations/env.py index 5417995..2f96186 100644 --- a/migrations/env.py +++ b/migrations/env.py @@ -76,21 +76,7 @@ def run_migrations_online(): and associate a connection with the context. """ - - # this callback is used to prevent an auto-migration from being generated - # when there are no changes to the schema - # reference: http://alembic.zzzcomputing.com/en/latest/cookbook.html - def process_revision_directives(context, revision, directives): - if getattr(config.cmd_opts, "autogenerate", False): - script = directives[0] - if script.upgrade_ops.is_empty(): - directives[:] = [] - logger.info("No changes in schema detected.") - conf_args = current_app.extensions["migrate"].configure_args - if conf_args.get("process_revision_directives") is None: - conf_args["process_revision_directives"] = process_revision_directives - connectable = get_engine() with connectable.connect() as connection: