add autoIncrement

This commit is contained in:
xxj
2022-07-06 18:41:33 +08:00
parent fc112a736b
commit 3dea08f1e4
4 changed files with 7 additions and 1 deletions

View File

@@ -140,6 +140,9 @@ func (m *_Model) genTableElement(cols []ColumnsInfo) (el []genstruct.GenElement)
if len(_tagGorm) > 0 {
// not simple output. 默认只输出gorm主键和字段标签
if !config.GetSimple() {
if strings.EqualFold(v.Extra, "auto_increment") {
tmp.AddTag(_tagGorm, "autoIncrement:true")
}
for _, v1 := range v.Index {
switch v1.Key {
// case ColumnsKeyDefault: