mirror of https://github.com/go-gorm/gorm.git
Add basic support for DEFAULT values
This commit is contained in:
parent
40c16f3c29
commit
4772acb1c4
5
field.go
5
field.go
|
@ -57,6 +57,11 @@ func parseSqlTag(str string) (typ string, addational_typ string, size int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
addational_typ = m["NOT NULL"] + " " + m["UNIQUE"]
|
addational_typ = m["NOT NULL"] + " " + m["UNIQUE"]
|
||||||
|
|
||||||
|
if len(m["DEFAULT"]) > 0 {
|
||||||
|
addational_typ = addational_typ + "DEFAULT " + m["DEFAULT"]
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue