alembic how to merge all revision files to one file? alembic how to merge all revision files to one file? flask flask

alembic how to merge all revision files to one file?


If you have all the models in models.py (or whatever you use for models), it should be possible to achieve your goal by recreating migrations in a single file. Like this:

  1. Point Alembic to a different and empty database
  2. run alembic revision --autogenerate
  3. You'll get the mirroring revision in a single file.