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

--all-or-nothing option is very confusing #1279

Closed
lazka opened this issue Oct 6, 2022 · 5 comments
Closed

--all-or-nothing option is very confusing #1279

lazka opened this issue Oct 6, 2022 · 5 comments

Comments

@lazka
Copy link

lazka commented Oct 6, 2022

Q A
Version 3.1.5

I was running the following:

bin/console doctrine:migrations:migrate --em=my_em --no-interaction --all-or-nothing

Turns out just passing --all-or-nothing does not do anything, you have to pass --all-or-nothing=1 or --all-or-nothing=0 for it to have any effect:

$allOrNothing = $input->hasOption('all-or-nothing') ? $input->getOption('all-or-nothing') : null;
(it will result in null, then fall back to the configuration)

This is very confusing imo and there are lots of examples out there that just pass --all-or-nothing.

Am I missing something?

@greg0ire
Copy link
Member

greg0ire commented Oct 6, 2022

What do the docs say?

@agustingomes
Copy link
Contributor

I created a PR to correct the docs example: #1296 as I just found this issue while working on automating Doctrine migrations in my work context.

@greg0ire what do you think?

@greg0ire
Copy link
Member

greg0ire commented Jan 9, 2023

I'll try to look into it but have you seen #1161 ? Before it was merged, I think the --all-or-nothing must have been working as expected, because back then the code looked a lot like the code for the dry-run option (which works as expected, right?)

I think the code in that MR might be wrong. It should not fall back on the configuration as soon as $input->hasOption('all-or-nothing') returns true, right?

@greg0ire
Copy link
Member

greg0ire commented Jan 9, 2023

Cc @grachevko

@agustingomes
Copy link
Contributor

Added a test case in the PR confirming the current (and unexpected) behavior.

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

No branches or pull requests

3 participants