Skip to content

Fix up short name to work with seeding. #868

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

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from
Open

Conversation

dereuromark
Copy link
Member

@dereuromark dereuromark commented Jul 18, 2025

This always bothered me.
The whole framework works with aliases (short name) without the need of the suffix.
But seeders need it.
While I can understand that they could be also called differently, the convention and normal approach would be to use
{name}Seed.
And as such I would expect it to work with --seed MyName etc.

Also fixed some of the exception messages to proper code fencing for copy and paste.

This also links to Bake which also accepts the same short name and auto adds the suffix:
https://book.cakephp.org/migrations/4/en/index.html#seed-seeding-your-database

Copy link

@jamisonbryant jamisonbryant left a comment

Choose a reason for hiding this comment

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

Looks good, agreed have always gotten tripped up on the need for the “Seed” suffix.

I left one grammar tweak suggestion that should be trivial to apply.

@@ -39,8 +39,8 @@ protected function _getSchema(InputInterface $input, OutputInterface $output): ?

if (!method_exists($connection, 'getSchemaCollection')) {
$msg = sprintf(
'The "%s" connection is not compatible with orm caching, ' .
'as it does not implement a "getSchemaCollection()" method.',
'The `%s` connection is not compatible with orm caching, ' .

Choose a reason for hiding this comment

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

Suggested change
'The `%s` connection is not compatible with orm caching, ' .
'The `%s` connection is not compatible with ORM caching, ' .

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

Successfully merging this pull request may close these issues.

2 participants