fix default on postgres

This commit is contained in:
Lunny Xiao 2019-09-28 21:15:09 +08:00
parent 3c9bea03bb
commit 1a7ddf84c2
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 1 additions and 1 deletions

View File

@ -1045,7 +1045,7 @@ WHERE c.relkind = 'r'::char AND c.relname = $1%s AND f.attnum > 0 ORDER BY f.att
col.Length = maxLen col.Length = maxLen
if !col.DefaultIsEmpty && (col.SQLType.IsText() || col.SQLType.IsTime()) { if !col.DefaultIsEmpty && col.SQLType.IsText() {
if strings.HasSuffix(col.Default, "::character varying") { if strings.HasSuffix(col.Default, "::character varying") {
col.Default = strings.TrimRight(col.Default, "::character varying") col.Default = strings.TrimRight(col.Default, "::character varying")
} else if !strings.HasPrefix(col.Default, "'") { } else if !strings.HasPrefix(col.Default, "'") {