How to alter a column and change the default value?

The Solution to How to alter a column and change the default value? is


ALTER TABLE foobar_data MODIFY COLUMN col VARCHAR(255) NOT NULL DEFAULT '{}';

A second possibility which does the same (thanks to juergen_d):

ALTER TABLE foobar_data CHANGE COLUMN col col VARCHAR(255) NOT NULL DEFAULT '{}';

~ Answered on 2012-07-03 13:54:10


Most Viewed Questions: