Out of order migrations are not supported

Issue #1 resolved
fool repo owner created an issue

Lets say you have 2 branches, branch1 and branch2. Branch1 is a master trunk branch, branch2 is a feature branch.

On branch1 you have

  • A
  • B
  • C

as migrations. Branch2 branches off branch1 at this point to do a feature.

Then on branch2 you make another one, D, and dont commit it to branch1. While working on branch2 you up them all, so your DB has A, B, C, D.

Now you switch back to branch1 and you make a new migration E and push that to branch1. Now branch1 has A, B, C, E.

When you run miggy list / up / test it should recognize that D is missing. You may be able to get in a state where it recognizes E's and D is missing and doesnt tell you.

Also if this happens it should give you some help / options on running the migration out of order.

Comments (1)

  1. fool reporter

    This fixes the important part: https://bitbucket.org/fool/miggy/commits/ee730814b35d2dbbe885dc2ec21990858b603637

    There is still an unfixed issue described in the original bug. If you switch branches, and end up with a migration in your database but the migration file is not in the current branch, then miggy will not work. It will not be able to understand the migration in the database. I am not fixing this and unsure if it's a good feature to support at the moment. If your database relies on code that your current branch does not have, this is a real problem.

  2. Log in to comment