fix default on postgres
This commit is contained in:
parent
7ebd9c4fe2
commit
3c9bea03bb
|
@ -1046,8 +1046,8 @@ 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() || col.SQLType.IsTime()) {
|
||||||
if col.Default == "''::character varying" {
|
if strings.HasSuffix(col.Default, "::character varying") {
|
||||||
col.Default = "''"
|
col.Default = strings.TrimRight(col.Default, "::character varying")
|
||||||
} else if !strings.HasPrefix(col.Default, "'") {
|
} else if !strings.HasPrefix(col.Default, "'") {
|
||||||
col.Default = "'" + col.Default + "'"
|
col.Default = "'" + col.Default + "'"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue