Yeah as mentioned in the article, enums may break pre-existing data in the DB if new values are introduced (if you don't explicitly mention the mapped values). If you plan to use enums, mapping them to a specific value is a non-negotiable, but you can always use constant objects, mapping the same values.
I personally prefer using enums & haven't run into any issues over the past 4 years apart from the unmapped enums being overwritten
For further actions, you may consider blocking this person and/or reporting abuse
We're a blogging-forward open source social network where we learn from one another
Yeah as mentioned in the article,
enums
may break pre-existing data in the DB if new values are introduced (if you don't explicitly mention the mapped values). If you plan to useenums
, mapping them to a specific value is a non-negotiable, but you can always use constant objects, mapping the same values.I personally prefer using
enums
& haven't run into any issues over the past 4 years apart from the unmapped enums being overwritten