Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2018年06月11日 数据库枚举值的坑 #29

Open
imzyf opened this issue Jun 11, 2018 · 0 comments
Open

2018年06月11日 数据库枚举值的坑 #29

imzyf opened this issue Jun 11, 2018 · 0 comments

Comments

@imzyf
Copy link
Contributor

imzyf commented Jun 11, 2018

在数据库使用枚举时可以规范数据字典,但是也造成了要添加值时,需要修改数据库结构,这是不可接受的

而且枚举值查询可以使用 0,1,2.. 索引值进行查询,也可以使用 'public' 'private' 这样的规定的字典值查询,有二义性,可能有伏笔

字典类型的字段我都以 _type 结尾,tinyint 型,无符号,数字代表的值写在字段注释里 eg: book_type

是否 概念的字段也不要用 枚举,我会使用 is_ 开头 eg: is_review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant