Setting limit to null omits it from definition #2393
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now, when a
limitis not included in a column definition or it's set tonullexplicitly, phinx will use some default limit for the column type (e.g.255for character varying). Phinx is an opinionated migrations library that tries to encourage best practices (like setting limits on character varying) by default, so I don't really want to change the default behavior when limit is omitted, but this PR modifies the behavior of passingnull, where now the limit will be fully omitted from the definition, allowing an escape hatch from phinx's defaults.While this is BC breaking, I'd consider the fact that an explicit
nullwas ignored a bug, so won't cut a major release for this PR.Supersedes #2233 which made a BC only for postgres character varying, which I don't particularly like as I think it makes things confusing if going from one adapter to another.