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

Allow namespaced migration files #475

Open
dereuromark opened this issue Oct 23, 2020 · 1 comment
Open

Allow namespaced migration files #475

dereuromark opened this issue Oct 23, 2020 · 1 comment

Comments

@dereuromark
Copy link
Member

I wonder if we could use cakephp/phinx#1820 to namespace our migration classes
They are the only code I still have to exclude from sniffers so far:

FOUND 2 ERRORS AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------
 6 | ERROR | Class name "MigrationLanguages" doesn't match filename, expected "20201014000218_MigrationLanguages"
 6 | ERROR | Each class must be in a namespace of at least one level (a top-level vendor name)

With the namespace way it would also probably be a bit cleaner and less conflicting regarding the names.

Right now I always prefix them with Migration to avoid naming clashes/collisions with existing top level classes.

@dereuromark
Copy link
Member Author

dereuromark commented Dec 15, 2020

The CS issue is "hacked" for now with cakephp/cakephp-codesniffer#320

We should still looking into a phinx solution that allows namespace migration class names, though.
According to https://github.com/cakephp/phinx/blob/master/docs/en/namespaces.rst#psr-4-compliance this should already be possible, maybe sth for Cake 4.2+?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant