mirror of
https://github.com/astaxie/beego.git
synced 2024-11-23 02:40:54 +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:
|
case TypeBooleanField:
|
||||||
col = T["bool"]
|
col = T["bool"]
|
||||||
case TypeCharField:
|
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:
|
case TypeTextField:
|
||||||
col = T["string-text"]
|
col = T["string-text"]
|
||||||
case TypeTimeField:
|
case TypeTimeField:
|
||||||
|
@ -119,6 +119,7 @@ type fieldInfo struct {
|
|||||||
colDefault bool
|
colDefault bool
|
||||||
initial StrTo
|
initial StrTo
|
||||||
size int
|
size int
|
||||||
|
toText bool
|
||||||
autoNow bool
|
autoNow bool
|
||||||
autoNowAdd bool
|
autoNowAdd bool
|
||||||
rel bool
|
rel bool
|
||||||
@ -359,6 +360,7 @@ checkType:
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fi.size = 255
|
fi.size = 255
|
||||||
|
fi.toText = true
|
||||||
}
|
}
|
||||||
case TypeTextField:
|
case TypeTextField:
|
||||||
fi.index = false
|
fi.index = false
|
||||||
|
Loading…
Reference in New Issue
Block a user