Last active
November 30, 2017 10:19
-
-
Save malys/ed1d468efb1323f440c9 to your computer and use it in GitHub Desktop.
[SQL Tips] #sql
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
IF EXISTS ( SELECT * FROM information_schema.columns WHERE table_name = 'country' AND column_name = 'created_at' AND table_schema = DATABASE() ) THEN | |
ALTER TABLE `country` DROP COLUMN `created_at`; | |
END IF; | |
Because DROP COLUMN IF EXISTS isn't supported by MySQL. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment