Change field type from enum to multiEnum
Collapse
X
-
I think you also have to edit the field type in the mySQL (or database) too, changing the file code will just 'disable' the validation or visual look. But yes, safe approach would be export and import into a new field... but this might not be possible with multi-enum. -
Hi, I would not recommend manually updating schema of the field - this is not a great approach in any kind of system, where it's not built-in functionality. It might work at some point, but it may cause errors as well.
I would recommend you to create a new multiEnum field and migrate the data from original singleEnum to the new field, then delete the old field.Leave a comment:
-
Change field type from enum to multiEnum
Hi,
We have a enum field that we need to change to multiEnum. We saw this post to change the field type to varchar.
However, when adapting the same process to our field (enum to multiEnum) and rebuilding, an error occurs in the logs:
Code:ALERT: Rebuild database fault: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near
Code:"cejasPuntaUsada": { "type": "enum", "required": false, "options": [ "", "1", "2", "3", "18" ], "style": { "1": null, "2": null, "3": null, "18": null, "": null }, "default": "", "isCustom": true },
Code:"cejasPuntaUsada": { "type": "multiEnum", "storeArrayValues": true, "required": false, "options": [ "", "1", "2", "3", "18" ], "style": { "1": null, "2": null, "3": null, "18": null, "": null }, "isCustom": true },
Thanks!
Tags: None
Leave a comment: