phinx icon indicating copy to clipboard operation
phinx copied to clipboard

changeColumn() allow null

Open joshribakoff opened this issue 12 years ago • 17 comments

$this->changeColumn('website', null, ['default'=>'null'])

This should keep the column type as is but just makes it null-able. Right now you have to specify the current column type for 2nd parameter even if its not changing. I should make it so that passing empty string or null keeps it as is.

Its also finicky about 'default' being set to the string 'null' and not the actual value null.

joshribakoff avatar Aug 24 '13 03:08 joshribakoff

+1

atber avatar Oct 10 '14 02:10 atber

+1

burzum avatar Oct 25 '14 16:10 burzum

+1

augusteiner avatar Oct 31 '14 14:10 augusteiner

+1

moskrc avatar May 14 '15 08:05 moskrc

+1

Isinlor avatar Jun 29 '15 13:06 Isinlor

+1

FluffyMatt avatar Aug 26 '15 11:08 FluffyMatt

I like this idea. somebody will need to contribute the code though.

robmorgan avatar Sep 02 '15 14:09 robmorgan

Man, this is the dream of every database user: not having to remember the column type if you want to just change an option. hahaha

igorsantos07 avatar Nov 18 '15 01:11 igorsantos07

+1

JREAM avatar Dec 17 '15 20:12 JREAM

+1

simkimsia avatar Feb 24 '16 04:02 simkimsia

:+1:

marcosdalte avatar Feb 28 '16 15:02 marcosdalte

+1

ghost avatar Jun 17 '16 22:06 ghost

+1

TeyimPila avatar Oct 19 '17 09:10 TeyimPila

+1

LauLogisch avatar Dec 10 '18 12:12 LauLogisch

Anyone wants to make a PR here?

dereuromark avatar Apr 11 '20 06:04 dereuromark