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

Contain migration name in error if pending actions are still present #719

Open
1 of 3 tasks
LordSimal opened this issue May 21, 2024 · 2 comments
Open
1 of 3 tasks

Comments

@LordSimal
Copy link
Contributor

This is a (multiple allowed):

  • bug

  • enhancement

  • feature-discussion (RFC)

  • CakePHP Version: 5.1.0-RC1

  • Migrations plugin version: 4.3.1

  • PHP Version: PHP 8.3.7

What you did

With the newest version of migrations it will throw an error if you have a migration which looks like this

$this->table('some_table')->drop();

because it should have actually been

$this->table('some_table')->drop()->save();

Expected Behavior

The error should contain the migration file which caused the error so its easier to debug, not just what you can see bellow

Actual Behavior

Could not apply migrations for {"plugin":"AlfredStaffMembers","connection":"test"}
Migrations failed to apply with message:
Migration has pending actions after execution!
@dereuromark
Copy link
Member

Wouldnt it usually be the first one that is not yet "migrated"?
But sure, if it is doable, having the actual file(name) included could really help.

@LordSimal
Copy link
Contributor Author

LordSimal commented May 22, 2024

In my case it wasn't a migration which wasn't applied yet to live but instead a phpunit run.

And since my DB schema is built with the migrator I rebuild the whole DB schema on each phpunit run and therefore execute all existing migrations in my app.

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

2 participants