fix goctl model (#61)

This commit is contained in:
miaogaolin
2020-09-11 16:46:45 +08:00
committed by GitHub
parent e1d942a799
commit ce5961a7d0
4 changed files with 19 additions and 18 deletions

View File

@@ -36,6 +36,7 @@ type (
DataType string
IsKey bool
IsPrimaryKey bool
IsUniqueKey bool
Comment string
}
@@ -124,6 +125,7 @@ func Parse(ddl string) (*Table, error) {
if ok {
field.IsKey = true
field.IsPrimaryKey = key == primary
field.IsUniqueKey = key == unique
if field.IsPrimaryKey {
primaryKey.Field = field
if column.Type.Autoincrement {