Why Flask Migrate doesn't create an empty migration file?
<p>I am using Flask, Flask-SqlAlchemy and Flask-Migrate to manage my models. And I just realize that in my latest database state, when I create a new migration file, <code>python manage.py db migrate -m'test migration</code>, it will not create an empty migration file. Instead it tries to create and drop several unique key and foreign key constraints.</p>

<p>Any ideas why it behaves like this?</p>

<p>If you have made no changes to your model from the current migration, but you get a non-empty migration file generated, then it suggests for some reason your models became out of sync with the database, and the contents of this new migration are just the things that are mismatched.</p>

<p>If you say that the migration contains code that drops some constraints and add some other ones, it makes me think that the constraint names have probable changed, or maybe you upgraded your SQLAlchemy version to a newer version that generates constraints with different names.</p>

python flask-sqlalchemy flask-migrate