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

Add message if migrations/seeds folders do not exist and debug is dis… #584

Merged
merged 1 commit into from
Oct 30, 2022

Conversation

ajibarra
Copy link
Member

Fixes #565

Adds a message if debug is disabled and folders do not exist.
Adds more tests to ConfigurationTrait.

@ajibarra ajibarra marked this pull request as ready for review October 28, 2022 08:05
if (!is_dir($migrationsPath)) {
if (!Configure::read('debug')) {
throw new \RuntimeException(sprintf(
'Migrations path `%s` does not exist and cannot be created because `debug` is disabled.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats not the reason imo
Better to output that path needs to exist
No one should enable debug on prod

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed it will never happen in prod because when code reaches prod the Migrations folder will exist. The problem happens when somebody disables debug in local environment and tries to create a migration

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dereuromark this check works great if you are only using migrations but the seeds directory must exist now because of the check below to make sure the seeds directory exists. L96-L102

@markstory markstory merged commit b496bf2 into cakephp:3.x Oct 30, 2022
@othercorey
Copy link
Member

These tests are now failing after the merge.

@challgren
Copy link
Contributor

I think this PR is now causing issues with plugins that have migrations but don't have config/Seeds directory. dereuromark/cakephp-queue#348

@challgren
Copy link
Contributor

This is also happening with https://github.com/CakeDC/users/ since it too does not have a config/Seeds directory.

@othercorey
Copy link
Member

Can you create a new issue to track this

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

Successfully merging this pull request may close these issues.

migration create command is not creating required folders
6 participants