1

Say this is my graph of alembic versions:

a -> b -> c -> d
       \> e -> f

i'm interested in rolling back e and f but not c and d

so the issue is:

  1. alembic downgrade takes an argument that represents the target revision (rather than the revision to be rolled back)
  2. alembic downgrade e will correctly downgrade from f to e
  3. alembic downgrade -1, so far as I can tell, can technically roll back the head of either branch.
  4. I can't seem to do alembic downgrade b to roll back e and f without also rolling back c and d

Is the thing I'm trying to do possible with alembic?

Aviv Goldgeier
  • 799
  • 7
  • 23

1 Answers1

1

UPDATE: It turns out this has been an open issue since 2017.

https://github.com/sqlalchemy/alembic/issues/464

My solution, for posterity, is to make a new revision g that will undo the changes in e and f so I basically get to work from the state of b.

Aviv Goldgeier
  • 799
  • 7
  • 23