Skip to content

Conversation

@ahmed-bhs
Copy link

Q A
Type feature
BC Break no
Fixed issues N/A

Summary

This pull request introduces a new --check option to the doctrine:migrations:diff command to improve its usability in CI/CD environments.

Currently, verifying that no pending migrations exist requires using fragile and complex shell scripts that check for the creation of new migration files. This approach is not ideal as it's not explicit and can be brittle. This PR proposes a cleaner, integrated solution.

The new --check flag allows you to verify the database schema status without generating a migration file.

  • If the database schema is in sync with the mapping, the command will output a success message and exit with a 0 status code.
  • If the database schema is not in sync, the command will output a clear, actionable error message (suggesting the diff command to run) and exit with a 1 status code.

This makes CI configuration much simpler, more readable, and improves the overall developer experience by providing a robust, self-documenting way to ensure schema consistency in automated workflows.

This option allows checking for schema differences in a CI/CD environment without generating a file.

It exits with a non-zero status code if changes are detected, providing a clear signal for CI workflows and actionable feedback for developers.
@ahmed-bhs ahmed-bhs force-pushed the feature/diff-check-option branch from 7dddfc6 to 5b3e769 Compare October 26, 2025 15:19
@greg0ire
Copy link
Member

verifying that no pending migrations

In what situations is this needed? I mean, if there are migrations, you probably want to run them at some point, and you probably want to do so inside your CI, right?

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.

2 participants