This commit is contained in:
Lunny Xiao 2015-02-16 21:12:22 +08:00
parent f2d3be988e
commit 5af80770ea
1 changed files with 5 additions and 1 deletions

View File

@ -773,7 +773,11 @@ func (engine *Engine) mapType(v reflect.Value) *core.Table {
col.IsPrimaryKey = true
col.Nullable = false
case k == "NULL":
if j == 0 {
col.Nullable = true
} else {
col.Nullable = (strings.ToUpper(tags[j-1]) != "NOT")
}
/*case strings.HasPrefix(k, "AUTOINCR(") && strings.HasSuffix(k, ")"):
col.IsAutoIncrement = true