add autoIncrement:true

autoIncrement:true
master
xxj 2 years ago
parent aa53e84c49
commit fc112a736b

@ -39,7 +39,6 @@ type TabInfo struct {
type ColumnsInfo struct {
BaseInfo
IsNull bool // null if db is set null
Extra string // Extra (AUTO_INCREMENT 自增加)
Type string // Type.类型标记
Gormt string // 默认值
Index []KList // index list.index列表

@ -16,7 +16,6 @@ type genColumns struct {
Key string `gorm:"column:Key"`
Desc string `gorm:"column:Comment"`
Null string `gorm:"column:Null"`
Extra string `gorm:"Extra"`
Default *string `gorm:"column:Default"`
}

@ -153,7 +153,6 @@ func (m *mysqlModel) getTableElement(orm *mysqldb.MySqlDB, tab string) (el []mod
var tmp model.ColumnsInfo
tmp.Name = v.Field
tmp.Type = v.Type
tmp.Extra = v.Extra
FixNotes(&tmp, v.Desc) // 分析表注释
if v.Default != nil {

@ -140,9 +140,6 @@ 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:

Loading…
Cancel
Save