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
[5.8] Migration Events #28342
This PR adds events to migrations.
The benefit of having these methods is it will allow users to clear cache on migrations, perform maintainence if necessary.
driesvints left a comment •
You're on the right track but I believe we can do better. First of all: there's no need for the static keyword anywhere. Check my comments.
I also believe it might be better if we used dedicated classes instead of the string based ones. There's an
Based on your list above these could be:
And might I suggest adding:
Maybe we only need the last four above? Do we really need to know if a migration is a down migration or not?
Nice job so far
@driesvints I have made those changes. Couple of things to note.
For the events, in the old system there was wildcard support, which is why I have put a Contract in there, since that allows the same thing:
I have also changed how data is passed around, the events now instead store the migration and the direction, instead of it being a separate parameter.
I would like this as well. I have some migrations that change information inside the database and I wanted to write tests to make sure the migration was doing the expected process, I ended up doing this:
Current assertions are fine
I see you've added a merge commit. Can you try to purge this commit and use rebase instead? Because this adds unnecessary extra commits to the PR.