Last active
February 6, 2017 06:05
-
-
Save canabady/5c67bfcac3f881e9cdc005ceb48f6105 to your computer and use it in GitHub Desktop.
How to alter a column and change the default value in MYSQL ?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* How to alter a column and change the default value in MYSQL ? */ | |
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 '{}'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment