When to use an enum or a small table in a relational database?

Hate to answer a question with a question, but it depends. How often do you expect the values to change, and how often do you release code?

Enum types will require a code change. A pure database table will be much easier to change. Enum types are more convenient for coding.

For infrequent releases, or if you often have new/deleted/changed values, use a database table. For static sets of values, or if you release code all the time, use an enum.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)