2

Been coming up to speed with SqlAlchemy and Alembic (for migration). I understand that the Alembic revision files get "locked down" as a form of documentation of the migration history. That said, it seems like there ought to be a way to "flatten" all the revisions at run time in a way that yields enough metadata to reduce the duplication/overlap I'm seeing between the Alembic DDL-ish python code and the SqlAlchemy ORM mapping model code. (Especially in cases where you're mapping python classes one to one with tables.)

Has anyone found a good way to do this?

ipmcc
  • 29,581
  • 5
  • 84
  • 147
  • Are you asking squashing all existing migrations to one initial migration or something more sophisticated? – Mikko Ohtamaa Jul 22 '15 at 23:20
  • I'm asking if there's a way to flatten them and use the resulting projection as an input to the ORM metadata. I assume the flattening part will be needed because any given Alembic rev only captures the differences from the last one. – ipmcc Jul 23 '15 at 00:03

0 Answers0