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

Database Migrations inconsistent info about sequential type #1577

Closed
Martin-4Spaces opened this issue Dec 3, 2018 · 3 comments
Closed

Database Migrations inconsistent info about sequential type #1577

Martin-4Spaces opened this issue Dec 3, 2018 · 3 comments

Comments

@Martin-4Spaces
Copy link

Hello

This only applies to migration type sequential.
After this commit adding type hints to system migration class. The supplied version is parsed as int.
If I want to migrate to version 002 it will parse this as int and therefore remove the 00. The class will then check for migration file with the name 2.php and not 002.php. Resulting in an error, migration file not found.
This conflicts with the old sequential style and the docs.

@Martin-4Spaces
Copy link
Author

Martin-4Spaces commented Dec 3, 2018

I tried to change my app from using 002.php to 2.php to comply with the new type hinting.
Then I get problems with MigrationRunner::findMigrations. This method checks the folder and validate the filename with regex /^\d{3}_(\w+)$/. The regex require three digits.

I'll suggest removing the int type hinting on MigrationRunner::version and MigrationRunner:checkMigrations.

@jim-parry
Copy link
Contributor

@Martin-4Spaces Can you test if PR 1585 addresses your issue?

@Martin-4Spaces
Copy link
Author

@natanfelles @jim-parry It works perfectly!

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