Closed lazka closed 1 year ago
What do the docs say?
I created a PR to correct the docs example: https://github.com/doctrine/migrations/pull/1296 as I just found this issue while working on automating Doctrine migrations in my work context.
@greg0ire what do you think?
I'll try to look into it but have you seen https://github.com/doctrine/migrations/pull/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?
Cc @grachevko
Added a test case in the PR confirming the current (and unexpected) behavior.
I was running the following:
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: https://github.com/doctrine/migrations/blob/5713b45c933122e509d9b31c767b420c3dfed399/lib/Doctrine/Migrations/Tools/Console/ConsoleInputMigratorConfigurationFactory.php#L24 (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?