mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 10:11:29 +00:00
Merge pull request #1879 from miraclesu/feature/orm_text
orm: use `text` as postgres default type
This commit is contained in:
commit
314a447d57
@ -52,7 +52,11 @@ checkColumn:
|
||||
case TypeBooleanField:
|
||||
col = T["bool"]
|
||||
case TypeCharField:
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user