phinx icon indicating copy to clipboard operation
phinx copied to clipboard

Setting limit to null omits it from definition

Open MasterOdin opened this issue 3 months ago • 0 comments

Right now, when a limit is not included in a column definition or it's set to null explicitly, phinx will use some default limit for the column type (e.g. 255 for 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 passing null, 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 null was 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.

MasterOdin avatar Nov 27 '25 22:11 MasterOdin