I\'m having trouble getting Alembic to autogenerate candidate migrations from changes to classes using db.Model (Flask-SQLAlchemy) instead of Base.
I also faced this issue and using this way to solve that:
open the migrations/env.py file, and on def run_migrations_online() function look at the context.configure, on Alembic 1.0.8 it should look like this:
with connectable.connect() as connection:
context.configure(
connection=connection,
target_metadata=target_metadata,
process_revision_directives=process_revision_directives,
**current_app.extensions['migrate'].configure_args,
)
Just remove or comment theprocess_revision_directives=process_revision_directives and then add the compare_type=True on that.
Like this:
with connectable.connect() as connection:
context.configure(
connection=connection,
target_metadata=target_metadata,
# process_revision_directives=process_revision_directives,
**current_app.extensions['migrate'].configure_args,
compare_type=True
)