添加自增控制
This commit is contained in:
@@ -162,6 +162,10 @@ func GenFromPath(mdir string, cols []Column, tableName string, tableComment stri
|
||||
typeName = typeName[1:]
|
||||
}
|
||||
|
||||
if col.AutoIncrement {
|
||||
|
||||
}
|
||||
|
||||
tagstr := "`gorm:"
|
||||
|
||||
gormTag := ""
|
||||
@@ -170,6 +174,10 @@ func GenFromPath(mdir string, cols []Column, tableName string, tableComment stri
|
||||
}
|
||||
|
||||
gormTag += defaultString
|
||||
|
||||
if col.AutoIncrement {
|
||||
gormTag += "auto_increment;"
|
||||
}
|
||||
// if col.DefaultValue == "" {
|
||||
// log.Panic(col, "需要默认值")
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user