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

Bug: Mixed migration formats don't order #2386

Closed
MGatner opened this issue Nov 4, 2019 · 1 comment
Closed

Bug: Mixed migration formats don't order #2386

MGatner opened this issue Nov 4, 2019 · 1 comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them

Comments

@MGatner
Copy link
Member

MGatner commented Nov 4, 2019

Describe the bug
Migrations support a variety of naming conventions: "The year, month, and date can be separated from each other by dashes, underscores, or not at all." However, in MigrationRunner the migrations are keyed by their UID (the version portion) and then ksort() orders them. This breaks ordering for mixed version formats:

2019-10-22-142810
2019-10-24-132943
20190319121802

We already have getObjectUid() which generates a UID for each migration so it should be a simple filter_var, but this will likely cause migrations already run to be detected as "not run" and amount to a breaking change, so should be done with caution.

CodeIgniter 4 version
Latest develop

Affected module(s)
Migrations

@MGatner MGatner added the bug Verified issues on the current code behavior or pull requests that will fix them label Nov 4, 2019
@MGatner
Copy link
Member Author

MGatner commented Nov 4, 2019

Actually the history is run through getObjectUid() as well so probably it would be okay to change it there:

		// Remove any migrations already in the history
		foreach ($this->getHistory($this->group) as $history)
		{
			unset($migrations[$this->getObjectUid($history)]);
		}

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
Projects
None yet
Development

No branches or pull requests

1 participant