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 return schemas.BigInt
case schemas.UnsignedInt: case schemas.UnsignedInt:
return schemas.BigInt return schemas.BigInt
case schemas.Int, schemas.Integer:
return schemas.Integer
case schemas.Bit, schemas.Bool, schemas.Boolean: case schemas.Bit, schemas.Bool, schemas.Boolean:
res = schemas.Boolean res = schemas.Boolean
return res return res
case schemas.Binary, schemas.VarBinary: case schemas.Binary:
return schemas.Bytea res = schemas.Binary
case schemas.DateTime: case schemas.DateTime:
res = schemas.TimeStamp res = schemas.TimeStamp
case schemas.TimeStampz: case schemas.TimeStampz:
@ -82,8 +84,13 @@ func (db *db2) SQLType(c *schemas.Column) string {
res = schemas.Varchar res = schemas.Varchar
case schemas.Uuid: case schemas.Uuid:
return 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: case schemas.Blob, schemas.TinyBlob, schemas.MediumBlob, schemas.LongBlob:
return schemas.Bytea return schemas.Blob
default: default:
res = t res = t
} }