Commit 314a447d authored by astaxie's avatar astaxie

Merge pull request #1879 from miraclesu/feature/orm_text

orm: use `text` as postgres default type
parents 9c400778 51858169
......@@ -52,7 +52,11 @@ checkColumn:
case TypeBooleanField:
col = T["bool"]
case TypeCharField:
col = fmt.Sprintf(T["string"], fieldSize)
if al.Driver == DRPostgres && fi.toText {
col = T["string-text"]
} else {
col = fmt.Sprintf(T["string"], fieldSize)
}
case TypeTextField:
col = T["string-text"]
case TypeTimeField:
......
......@@ -119,6 +119,7 @@ type fieldInfo struct {
colDefault bool
initial StrTo
size int
toText bool
autoNow bool
autoNowAdd bool
rel bool
......@@ -359,6 +360,7 @@ checkType:
}
} else {
fi.size = 255
fi.toText = true
}
case TypeTextField:
fi.index = 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