Skip to content

Conversation

@gharlan
Copy link
Contributor

@gharlan gharlan commented Jun 30, 2025

Q A
Type bug
BC Break no
Fixed issues

Summary

These options (when used) always require a value.

@greg0ire greg0ire added the Bug label Jun 30, 2025
@greg0ire greg0ire added this to the 3.9.2 milestone Jun 30, 2025
@greg0ire greg0ire merged commit dfc28ae into doctrine:3.9.x Jun 30, 2025
12 checks passed
@greg0ire
Copy link
Member

Thanks @gharlan !

@gharlan gharlan deleted the command-option-mode branch July 1, 2025 10:32
@JoniJnm
Copy link

JoniJnm commented Sep 16, 2025

I think this change is wrong, when --all is specified, the --range--from and --range-to should not be set, so they should not be required

if ($allOption === true && ($rangeFromOption !== null || $rangeToOption !== null)) {
throw InvalidOptionUsage::new(
'Options --all and --range-to/--range-from both used. You should use only one of them.',
);
}

@greg0ire
Copy link
Member

@JoniJnm do you think this just by reading the code or did you experience an actual bug? Because this makes the value required. Options still stay options.

@JoniJnm
Copy link

JoniJnm commented Sep 16, 2025

After upgrading from 3.9.0 to 3.9.4 my command fails. I run:

doctrine:migrations:version --em=app --add --all

the error is:

The "--range-from" option requires a value.

That's why I was checking the code, to know if I did something wrong or it's a breaking change

(I need that command in some integration tests)

@gharlan
Copy link
Contributor Author

gharlan commented Sep 16, 2025

That error should only happen if you use --range-from without a value. --range-from requires a value (--range-from=...). But only if you use the option. Options are always optional.

@JoniJnm
Copy link

JoniJnm commented Sep 16, 2025

ok, sorry, I'm was using the wrapper avaibooksports/doctrine-migrations-multiple-database-bundle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants