map "character" to Char for postgres

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
Andrew Thornton 2020-09-06 17:30:48 +01:00
parent 2f656b2211
commit 5729222a0e
No known key found for this signature in database
GPG Key ID: 3CDE74631F13A748
1 changed files with 4 additions and 4 deletions

View File

@ -857,10 +857,8 @@ func (db *postgres) SQLType(c *schemas.Column) string {
res = schemas.Real res = schemas.Real
case schemas.TinyText, schemas.MediumText, schemas.LongText: case schemas.TinyText, schemas.MediumText, schemas.LongText:
res = schemas.Text res = schemas.Text
case schemas.Char:
res = schemas.Varchar
case schemas.NChar: case schemas.NChar:
res = schemas.Varchar res = schemas.Char
case schemas.NVarchar: case schemas.NVarchar:
res = schemas.Varchar res = schemas.Varchar
case schemas.Uuid: case schemas.Uuid:
@ -1090,8 +1088,10 @@ WHERE n.nspname= s.table_schema AND c.relkind = 'r'::char AND c.relname = $1%s A
col.Nullable = (isNullable == "YES") col.Nullable = (isNullable == "YES")
switch strings.ToLower(dataType) { switch strings.ToLower(dataType) {
case "character varying", "character", "string": case "character varying", "string":
col.SQLType = schemas.SQLType{Name: schemas.Varchar, DefaultLength: 0, DefaultLength2: 0} col.SQLType = schemas.SQLType{Name: schemas.Varchar, DefaultLength: 0, DefaultLength2: 0}
case "character":
col.SQLType = schemas.SQLType{Name: schemas.Char, DefaultLength: 0, DefaultLength2: 0}
case "timestamp without time zone": case "timestamp without time zone":
col.SQLType = schemas.SQLType{Name: schemas.DateTime, DefaultLength: 0, DefaultLength2: 0} col.SQLType = schemas.SQLType{Name: schemas.DateTime, DefaultLength: 0, DefaultLength2: 0}
case "timestamp with time zone": case "timestamp with time zone":