My requirement
A table needs to maintain a status column.
This column represents one of 5 states.
initial design
I figured I can just make it an integer column and represent the states using a numeric value.
- 0 = start
- 1 = running
- 2 = crashed
- 3 = paused
- 4 = stopped
Since I don't want my app to maintain the mapping from the integers to their string description, I plan to place those in a separate state description table (relying on a FK relation).
Then I discovered that mysql has an ENUM type which matches my requirement exactly. Other than a direct dependency on mysql, are there any pitfalls with using the ENUM type ?