enum('yes', 'no') vs tinyint — which one to use?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 17:16:39

Also, ENUM is a non-standard MySql extension. You should avoid it, especially if you can achieve the same results in a standard way.

avoid enum from this reasons

The bottom line is that ENUM has its place, but should be used sparingly. The model should enforce the constraints, not the database; the model should handle interpreting raw data into useful information for your views, not the database.

BOOLEAN type is there for a reason. It is indeed a TINYINT(1) but since it's there, it must be the recommended way.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!