Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Bugfix/rollback all wrong order #3172
This pull request should address, and fix, the bug reported in #3131
This bug looks like when trying to rollback all migrations it's running them in chronological order and, I think, attempting to rollback all migrations and not just the ones completed (which is also a problem). From this line in the
I updated the functionality, if
I updated the tests for the second migration to depend on the first. The reason I think these tests may have been passing previously is because each migration file was creating (on
It doesn't appear that the documentation found here needs any updates as the language seems correct
Happy to make any additional changes and/or updates
referenced this pull request
Apr 28, 2019
I completely agree that tests shouldn't depend on each other. Each one should be able to stand alone. Looking back at my description for the pull request I didn't explain myself well. I apologize for any misunderstanding. What I was trying to say was not that the existing tests depended on each other, but that none of the migrations used in the rollback tests themselves depended on each other, which is often the case in real applications (e.g. a later migration that adds a column to a table that was created in a previous migration) and that's why the tests were originally passing.
This test on
However, instead of altering existing migrations, I'm up for adding in new ones and writing a new test if that's what you would prefer instead?
This test may cover the scenario you mentioned but I could be completely off. Let me know what you think.
I appreciate your comments and I'm happy to help contribute
@leeallen337 Thank you for the explanation! Yes, that makes sense, sorry for the misunderstanding.
By additional test I meant for this new piece of code:
Wouldn't that test that you pointed at would be failing previously if it was covering this case as well?
Oh! I think I understand now. So you're asking for a test for something like the following situation:
Adding a test to make sure that a