Fix types

This commit is contained in:
Lunny Xiao 2021-07-23 15:17:03 +08:00
parent 99262651a6
commit 231960a0c2
1 changed files with 4 additions and 2 deletions

View File

@ -553,14 +553,16 @@ func (db *dameng) Version(ctx context.Context, queryer core.Queryer) (*schemas.V
func (db *dameng) SQLType(c *schemas.Column) string { func (db *dameng) SQLType(c *schemas.Column) string {
var res string var res string
switch t := c.SQLType.Name; t { switch t := c.SQLType.Name; t {
case schemas.TinyInt, "BYTE", schemas.Bool: case schemas.TinyInt, "BYTE":
res = "TINYINT" res = "TINYINT"
case schemas.SmallInt, schemas.MediumInt, schemas.Int, schemas.Integer: case schemas.SmallInt, schemas.MediumInt, schemas.Int, schemas.Integer:
return "INTEGER" return "INTEGER"
case schemas.Bit, schemas.BigInt, case schemas.BigInt,
schemas.UnsignedBigInt, schemas.UnsignedBit, schemas.UnsignedInt, schemas.UnsignedBigInt, schemas.UnsignedBit, schemas.UnsignedInt,
schemas.Serial, schemas.BigSerial: schemas.Serial, schemas.BigSerial:
res = "BIGINT" res = "BIGINT"
case schemas.Bit, schemas.Bool:
return schemas.Bit
case schemas.Binary, schemas.VarBinary, schemas.Blob, schemas.TinyBlob, schemas.MediumBlob, schemas.LongBlob, schemas.Bytea: case schemas.Binary, schemas.VarBinary, schemas.Blob, schemas.TinyBlob, schemas.MediumBlob, schemas.LongBlob, schemas.Bytea:
return schemas.Binary return schemas.Binary
case schemas.Date: case schemas.Date: