Skip to content

Commit f7f15e2

Browse files
authored
Set opts correctly when revision --autogenerate is used (#463)
1 parent 961a9d3 commit f7f15e2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/flask_migrate/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ def revision(directory=None, message=None, autogenerate=False, sql=False,
140140
head='head', splice=False, branch_label=None, version_path=None,
141141
rev_id=None):
142142
"""Create a new revision file."""
143-
config = current_app.extensions['migrate'].migrate.get_config(directory)
143+
opts = ['autogenerate'] if autogenerate else None
144+
config = current_app.extensions['migrate'].migrate.get_config(
145+
directory, opts=opts)
144146
command.revision(config, message, autogenerate=autogenerate, sql=sql,
145147
head=head, splice=splice, branch_label=branch_label,
146148
version_path=version_path, rev_id=rev_id)

0 commit comments

Comments
 (0)