This commit is contained in:
Lunny Xiao 2021-08-12 20:37:25 +08:00
parent 1abb80f258
commit 815db53e9d
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 10 additions and 3 deletions

View File

@ -67,11 +67,13 @@ func (db *db2) SQLType(c *schemas.Column) string {
return schemas.BigInt
case schemas.UnsignedInt:
return schemas.BigInt
case schemas.Int, schemas.Integer:
return schemas.Integer
case schemas.Bit, schemas.Bool, schemas.Boolean:
res = schemas.Boolean
return res
case schemas.Binary, schemas.VarBinary:
return schemas.Bytea
case schemas.Binary:
res = schemas.Binary
case schemas.DateTime:
res = schemas.TimeStamp
case schemas.TimeStampz:
@ -82,8 +84,13 @@ func (db *db2) SQLType(c *schemas.Column) string {
res = schemas.Varchar
case schemas.Uuid:
return schemas.Uuid
case schemas.VarBinary, schemas.Bytea:
res = schemas.VarBinary
if c.Length == 0 {
return res + "(MAX)"
}
case schemas.Blob, schemas.TinyBlob, schemas.MediumBlob, schemas.LongBlob:
return schemas.Bytea
return schemas.Blob
default:
res = t
}