Update migrator.go
add autoIncrement implement
This commit is contained in:
parent
a70af2a4c0
commit
6470a9462f
@ -73,6 +73,10 @@ func (m Migrator) FullDataTypeOf(field *schema.Field) (expr clause.Expr) {
|
|||||||
expr.SQL += " NOT NULL"
|
expr.SQL += " NOT NULL"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if field.AutoIncrement {
|
||||||
|
expr.SQL += " AUTO_INCREMENT"
|
||||||
|
}
|
||||||
|
|
||||||
if field.Unique {
|
if field.Unique {
|
||||||
expr.SQL += " UNIQUE"
|
expr.SQL += " UNIQUE"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user