When deploying an application to a fresh server (i.e. the database is empty) how do I sync the database properly with Flask-Migrate?
I've added Flask-Migrate to the project when I already had some schema in place so I don't have "initial" migrations with all create_table()
. Now when I do manage.py db upgrade
in my deployment script I get relation "..." does not exist
.
Is there any built-in way to detect empty database and run 'create_all()' instead of migrations? This is what the Alembic's Cookbook suggests. Since I'm using Flask-Migrate already I'm looking for some unified way of dealing with migrations.