Phinx: changeColumn() allow null

Created on 24 Aug 2013  路  15Comments  路  Source: cakephp/phinx

$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.

enhancement

Most helpful comment

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

All 15 comments

+1

+1

+1

+1

+1

+1

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

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

+1

+1

:+1:

+1

+1

+1

Anyone wants to make a PR here?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

orderbynull picture orderbynull  路  19Comments

BallisticPain picture BallisticPain  路  13Comments

alex-barylski picture alex-barylski  路  14Comments

SergeC picture SergeC  路  13Comments

wpillar picture wpillar  路  97Comments