添加自增控制

This commit is contained in:
eson
2023-06-19 18:27:31 +08:00
parent 05363b1849
commit 640d3261e0
148 changed files with 1101 additions and 757 deletions

View File

@@ -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, "需要默认值")
// }