MySQL ENUM type vs join tables

后端 未结 5 1556
北恋
北恋 2020-11-27 13:04

My requirement

A table needs to maintain a status column.

This column represents one of 5 states.


initial desi

5条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 13:38

    A table would be easier to internationalize. But so would a class outside the database entirely. This kind of check can be hard to debug when it's not in the business logic, and would typically not be the responsibility of database people.

    As an optimization, it's probably very premature; but OP mainly proposes it as a convenience feature anyway.

    See also http://komlenic.com/244/8-reasons-why-mysqls-enum-data-type-is-evil/

提交回复
热议问题