by mohaine · 9y ago · 0 comments
Also watch out/avoid enums.
Example:
CREATE TABLE shirts ( ... size ENUM('x-small', 'small', 'medium', 'large', 'x-large'));
You have to specify all the values in the alter so to add xx-small it is
('xx-small','x-small', 'small', 'medium', 'large', 'x-large')
and then later if you add xx-large and forgot about the xx-small add:
('x-small', 'small', 'medium', 'large', 'x-large', 'xx-large')
You just silently lost all the xx-small values, they have been promoted to different values that exist. (Unless this has been fixed as well). Migration scripts are the real issue as they don't know about any custom values that may have been added out of band.