Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration down does not work correctly #172

Open
xfg opened this issue Mar 24, 2020 · 1 comment
Open

Migration down does not work correctly #172

xfg opened this issue Mar 24, 2020 · 1 comment

Comments

@xfg
Copy link

xfg commented Mar 24, 2020

Hello. I created the test repo on which I am testing the current library.

I run migrate up command and get next output

up : 1585061628701-1.js
up 1 migration
  up : 1585061705214-2.js
up 2 migration
  up : 1585061975014-3.js
up 3 migration
  migration : complete

Everything works as it should but now I run migrate down 1585061705214-2 and get

down : 1585061975014-3.js
down 3 migration
  migration : complete

It is not right since the 1585061705214-2 migration should have rolled back too based on this quote from the documentation

Similarly you can run down-migrations up to (and including) a specific migration

and if after it I run migrate down 1585061975014-3 which was rolled back above I get

down : 1585061705214-2.js
down 2 migration
  migration : complete

That's very strange.

And the last.

If we have two branches and the migrations 1585061628701-1 and 1585061975014-3 were created and applied in first branch, and the migration 158506170521414-2 was created in the other branch, which was created earlier than 1585061975014-3, then when the second branch merges with the first and call migrate up and then migrate down 1585061705214-2 everything will break down and we won’t be able to roll back to any specific migration except migrate down.

@wesleytodd
Copy link
Collaborator

Hey @xfg, would you be willing to make a test case for this behavior as a PR? I believe the report, just would make it easier to fix quickly if there was a test written.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants