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 warning for diffCommand #941

Closed
wants to merge 5 commits into from
Closed

Add warning for diffCommand #941

wants to merge 5 commits into from

Conversation

VincentLanglet
Copy link
Contributor

Q A
Type improvement
BC Break yes
Fixed issues #930

Summary

Add warning when running diff command with executed unavalaible or non executed migrations.

@goetas
Copy link
Member

goetas commented Mar 9, 2020

I think that you should be targeting the master branch

@goetas
Copy link
Member

goetas commented Mar 9, 2020

That seems to be the reason why tests are failing

@VincentLanglet VincentLanglet changed the base branch from 2.2.x to master March 9, 2020 22:11
@VincentLanglet
Copy link
Contributor Author

@goetas I fix some stuffs, but I don't understand the static analysis failure.

VincentLanglet and others added 4 commits March 10, 2020 10:16
Co-Authored-By: Andreas Braun <alcaeus@users.noreply.github.com>
@VincentLanglet
Copy link
Contributor Author

@goetas @alcaeus Phpstan is fixed now. Is the Scrutinizer check required ?

@SenseException
Copy link
Member

I've restarted the check and it's green now.

@goetas
Copy link
Member

goetas commented Mar 13, 2020

I'm not sure if we need that many warnings... I was just thinking about adding a a warning but keep the flow exactly as before. I'm this pr in the worst case we as to the user confirmation for two times...

Opinions?

@VincentLanglet
Copy link
Contributor Author

I'm not sure if we need that many warnings... I was just thinking about adding a a warning but keep the flow exactly as before. I'm this pr in the worst case we as to the user confirmation for two times...

IMO, you barely never want to create a new migration with non executed ones or executed non available one because it will generate some conflict between the migrations.

The goal of adding these warning was to prevent the developper from messing up BEFORE the migrations was created.

If you look at the issue doctrine/DoctrineMigrationsBundle#177, you'll have opinion. They wanted to not allow running diff command when not in sync, or to run migrate before diff. This is going in my way.

@goetas
Copy link
Member

goetas commented Mar 14, 2020

I'm convinced then. Looks good to me.

Can you add tests please for this feature?

@VincentLanglet
Copy link
Contributor Author

@goetas Tests added

@SenseException
Copy link
Member

I'd like to see the true case of these two new methods covered too. You can have an early exit after their if-blocks are done by having the empty diff functionality.

@VincentLanglet
Copy link
Contributor Author

@SenseException Sorry, I don't understand what you mean by the true case ?
There was already a test for this command. I added the case with non-executed migration or executed-non-available one.

@goetas
Copy link
Member

goetas commented Mar 21, 2020

Please see #948

@VincentLanglet
Copy link
Contributor Author

VincentLanglet commented Mar 22, 2020

@goetas Should I close my PR in favor of yours ?
It seems indeed better with only one prompt.

@goetas
Copy link
Member

goetas commented Mar 22, 2020

yeah, I suggest to move the discussion to #948

@goetas goetas closed this Mar 22, 2020
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.

4 participants