Commit e4988b71 authored by supar's avatar supar

Add property colDefault to fieldInfo object, set its true if there is

orm configuration default `orm:"default(1)"`
parent 9c07332c
......@@ -116,6 +116,7 @@ type fieldInfo struct {
null bool
index bool
unique bool
colDefault bool
initial StrTo
size int
auto_now bool
......@@ -280,6 +281,11 @@ checkType:
fi.pk = attrs["pk"]
fi.unique = attrs["unique"]
// Mark object property if there is attribute "default" in the orm configuration
if _, ok := tags["default"]; ok {
fi.colDefault = true
}
switch fieldType {
case RelManyToMany, RelReverseMany, RelReverseOne:
fi.null = false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment