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

Sequential Migrations don't run to the correct version #1666

Closed
lonnieezell opened this issue Jan 16, 2019 · 4 comments
Closed

Sequential Migrations don't run to the correct version #1666

lonnieezell opened this issue Jan 16, 2019 · 4 comments
Labels
bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer
Milestone

Comments

@lonnieezell
Copy link
Member

From the forums:

When i use: php spark migrate:version 20180116211000
it's executing always the first in the migration directory for instance 20180115210500_Add_Department.

When i using the sequential system it work correctly.
For instance: php spark migrate: version 007

@lonnieezell lonnieezell added bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer labels Jan 16, 2019
@lonnieezell lonnieezell added this to the 4.0.0 milestone Jan 16, 2019
@bangbangda
Copy link
Contributor

I tested, I didn't find the problem.
Migrations file:
20190118151243_blog.php, 20190118151543_user.php

php spark migrate:version 20190118151543
Run 20190118151543_user.php file, is ok.

@lonnieezell
Copy link
Member Author

I couldn't replicate either.

@d4mn
Copy link

d4mn commented Feb 14, 2019

It's because on some systems default file sort differs i think. When i print $migrations array before migrate it shows bad sorting. Actually migrations array should be sorted on code side to not get this I think.

@lonnieezell
Copy link
Member Author

@d4mn Oh man, I had totally forgotten about that. Good call, thanks! It's been a few years since I ran into that but have seen that before.

@lonnieezell lonnieezell reopened this Feb 14, 2019
lonnieezell added a commit that referenced this issue Feb 19, 2019
Manually sort migrations found instead of relying on the OS. Fixes #1666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer
Projects
None yet
Development

No branches or pull requests

3 participants