mysql enum vs tinyint

enum的缺点:

  • mysql 独有的定义
  • Also, ENUM is a non-standard MySql extension. You should avoid it, especially if you can achieve the same results in a standard way.

  • ENUM requires a rebuild of the table when adding a value to the middle of the set.
  • ENUM values are ordered in the order they’re added to the database
  • ENUM values do in the database what should be done in the model.

相关文章: