phinx icon indicating copy to clipboard operation
phinx copied to clipboard

Easier way to modify with changeColumn?

Open joshbmarshall opened this issue 4 years ago • 2 comments
trafficstars

Hi, when changing a column, e.g. a new comment, default value or nullable yes/no we currently have to set all the attributes of the column.

Is there a way that we can just specify the attributes that change? Either through another function call e.g. changeColumnNull() or changeColumnComment() or by adding a flag to changeColumn() to indicate to start with the current column attributes and set only the options that have changed?

joshbmarshall avatar Jan 08 '21 01:01 joshbmarshall

Is this a duplicate of https://github.com/cakephp/phinx/issues/1221 ?

dereuromark avatar Jan 08 '21 01:01 dereuromark

Very close, apologies the issue search did not find that one for me. I will look into using getColumn() as a workaround.

It would also be nice to not have to specify the field type. e.g. working with some pre-existing systems that have uncommon column types.

joshbmarshall avatar Jan 08 '21 02:01 joshbmarshall