Skip to content

How to check if models are in sync with generated migrations? #491

Discussion options

You must be logged in to vote

The tool that you referenced does not check for sync between models and migrations, it checks for sync between models and your database.

You can do the same with the flask db migrate command. If this command returns an error, then your models are identical to your database tables and there is nothing to migrate. If this command generates a migration file, that means that there are some differences and these will be listed in the generated migration script. If you don't care to keep the generate migration script, you can safely delete it.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by miguelgrinberg
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@miguelgrinberg
Comment options

@KyloEntro
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #490 on October 21, 2022 08:46.