Today we ran into an issue adding a multi-database setup to prior single-db setup. Here's how we fixed it and reference links.
From the maintainer of Flask-Migrate, Miguel Grinberg:
I was able to convert a single-db repository to multi-db with the following procedure:
- backup everything just in case!
- rename your
migrationsfolder to something else (i.e.migrations-old) - run
flask db init --multidb - copy the contents of
migrations-old/versions/*tomigrations/versions. - run
flask db stamp head(this marks the additional databases as being updated) - delete
migrations-oldAt this point you should have a repository that can track changes in all your databases.