-
Notifications
You must be signed in to change notification settings - Fork 121
RFC: File management #882
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
base: 5.x
Are you sure you want to change the base?
RFC: File management #882
Conversation
I dont understand why we need to wrap the anonymous class in a function. cant we just get the version from the filename and thats it? But I am all for anonymous classes for migrations |
Then you need to change
and setVersion() or alike on it fair enough for me. |
I think it's fine the way it is. Unless we want to move Seeds also? There is currently nothing in the
I think if it's configurable it shouldn't much matter. Users can set which style they prefer and forget about it. If we're going to do a major plugin release, we should default to the new version. Perhaps, if we decide to backport this behavior to a 4.x release, we can default to the legacy version. We could also default to the legacy type and print a message "Baking migration using Legacy template, update 'Migrations.style' to try the new anonymous class style" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👏
I agree. |
Once this is done, we need to also tackle Seeds, as they have the same PSR2 namespace missing. |
@markstory How do we best proceed here? And we should probably squash merge to avoid extra conflicts in the future with other PRs. |
I think we can have 5.x switch to the newer format as long as we maintain backwards compatibility for 'old' migrations that applications might have. Existing migrations should continue to be applied and executed. Ideally with zero effort on the developers' part. It would also be good to have a If folks want 5.x to only provide the anonymous style migrations, then we'll need to introduce forwards compatibility and tooling to convert migrations over in 4.x. I think the getting developer experience smooth with this change is going to be important. I personally don't want maintenance toil from my database migrations. |
Right now both work equally. |
Implements some of the ideas of #822 as showcase
Resolves #475 by allowing to not use namespaces, but anonymous classes.
What do you think? Which ones do we want to pursue?
Open questions:
By allowing the old ones to continue to work, we should provide reasonable BC here.