There is an existing query to create a column with enums as shown below.
ALTER TABLE org ADD COLUMN `classify` ENUM('Arg', 'Agent') NOT NULL;
Now, I cannot modify that. I need send another query to add another value, when I try
ALTER TABLE org change `classify` ENUM('Arg', 'Agent','brand') NOT NULL;
it doesn't work.
Try this:
ALTER TABLE org ADD COLUMN classify_aux ENUM('Arg', 'Agent','brand') NOT NULL;
UPDATE org SET classify_aux = classify;
ALTER TABLE org DROP COLUMN classify;
ALTER TABLE org ADD COLUMN `classify` ENUM('Arg', 'Agent','brand') NOT NULL;
UPDATE org SET classify = classify_aux;
ALTER TABLE org DROP COLUMN classify_aux;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.