mirror of https://github.com/go-gorm/gorm.git
Merge pull request #170 from chr4/master
Add basic support for DEFAULT values
This commit is contained in:
commit
ae12a1cca5
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