-
-
Notifications
You must be signed in to change notification settings - Fork 350
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
通过gormt生成的model autoIncrement tag会被type tag覆盖。 #218
Comments
如果column设置了 |
|
我先在gorm提个Issue看能不能给修复 |
好的,这里也可以提pr,我来覆盖 |
问题找到了是通过gorm链接mysql使用的dialector有问题导致,这个问题已经被处理 go-gorm/mysql#83 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
以MYSQL为例在生成sql时
autoIncrement:true
会给ID column datatype·追加
AUTO_INCREMENT`。而
type:bigint(20) unsigned;not null
会给ID column datatype
设置bigint(20) unsigned NOT NULL
,而且由于type
指定了specified database data type
按照目前gorm的规则应给是specificed database data type
会覆盖掉其他datatype
设置,这导致之前的AUTO_INCREMENT
被覆盖。The text was updated successfully, but these errors were encountered: