From f7f15e2623866110974fddcdbea87ccbf1d74a40 Mon Sep 17 00:00:00 2001 From: Frazer McLean Date: Thu, 19 May 2022 11:36:05 +0200 Subject: [PATCH] Set opts correctly when revision --autogenerate is used (#463) --- src/flask_migrate/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/flask_migrate/__init__.py b/src/flask_migrate/__init__.py index ca4253d..362463c 100644 --- a/src/flask_migrate/__init__.py +++ b/src/flask_migrate/__init__.py @@ -140,7 +140,9 @@ def revision(directory=None, message=None, autogenerate=False, sql=False, head='head', splice=False, branch_label=None, version_path=None, rev_id=None): """Create a new revision file.""" - config = current_app.extensions['migrate'].migrate.get_config(directory) + opts = ['autogenerate'] if autogenerate else None + config = current_app.extensions['migrate'].migrate.get_config( + directory, opts=opts) command.revision(config, message, autogenerate=autogenerate, sql=sql, head=head, splice=splice, branch_label=branch_label, version_path=version_path, rev_id=rev_id)