-
-
Notifications
You must be signed in to change notification settings - Fork 389
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
Diff command throws Exception instead of message #833
Comments
This change was made in 2.0 right? Your version says 1.8 but I thought it was done in 2.0 refactoring. Can you help me understand the use case for running diff in your CI? |
Before About my use case, in older projects I used to have a db: db-migrate db-diff db-migrate
.PHONY: db
db-migrate:
bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration
.PHONY: db-migrate
db-diff:
bin/console doctrine:migrations:diff --formatted
.PHONY: db-diff
# other targets here Running Please note that I use |
BC Break Report
Summary
In Migration v1.8,
diff command
throws Exception instead of message. This is a problem for pipelines (CI) and also for build tools (make, Phing, ...) since they rely on return values.This is new for me since, in older projects,
diff command
only returned a nice message (same kind of message thatmigrate command
returns).Digging into the code I found out where this change was made: cbe1b7f
As you can see, in this commit the following code was removed...:
and was moved as an exception:
IMHO a refactoring should not transform a message into an Exception.
Later, in commit d9c1b0c this exception was refactored as:
Previous behaviour
When there's no changes is mapping, the
diff command
displays a message as output:Current behaviour
When there's no changes is mapping, the
diff command
throws an Exception:How to reproduce
Run
diff command
when you have no changes in your mapping:I though in two possible solutions to solve this:
NoChangesDetected
exception is removed and a message is displayed (this was the behaviour before v1.8).--allow-no-diff
to mute theNoChangesDetected
exception. Please note thatmigration command
has a--allow-no-migration
option which has a similar behaviour.I'm more than happy to help with this if you can give some advices and tell me what to do and where to start :)
The text was updated successfully, but these errors were encountered: