Fix mssql
This commit is contained in:
parent
5510be60a3
commit
c14c385394
|
@ -318,7 +318,7 @@ func (db *mssql) SQLType(c *schemas.Column) string {
|
||||||
case schemas.TimeStampz:
|
case schemas.TimeStampz:
|
||||||
res = "DATETIMEOFFSET"
|
res = "DATETIMEOFFSET"
|
||||||
c.Length = 7
|
c.Length = 7
|
||||||
case schemas.MediumInt:
|
case schemas.MediumInt, schemas.TinyInt, schemas.SmallInt, schemas.UnsignedMediumInt, schemas.UnsignedTinyInt, schemas.UnsignedSmallInt:
|
||||||
res = schemas.Int
|
res = schemas.Int
|
||||||
case schemas.Text, schemas.MediumText, schemas.TinyText, schemas.LongText, schemas.Json:
|
case schemas.Text, schemas.MediumText, schemas.TinyText, schemas.LongText, schemas.Json:
|
||||||
res = db.defaultVarchar + "(MAX)"
|
res = db.defaultVarchar + "(MAX)"
|
||||||
|
|
|
@ -879,13 +879,13 @@ func (db *postgres) SetQuotePolicy(quotePolicy QuotePolicy) {
|
||||||
func (db *postgres) SQLType(c *schemas.Column) string {
|
func (db *postgres) 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, schemas.UnsignedTinyInt, schemas.UnsignedSmallInt:
|
case schemas.TinyInt, schemas.UnsignedTinyInt:
|
||||||
res = schemas.SmallInt
|
res = schemas.SmallInt
|
||||||
return res
|
return res
|
||||||
case schemas.Bit:
|
case schemas.Bit:
|
||||||
res = schemas.Boolean
|
res = schemas.Boolean
|
||||||
return res
|
return res
|
||||||
case schemas.MediumInt, schemas.Int, schemas.Integer, schemas.UnsignedMediumInt:
|
case schemas.MediumInt, schemas.Int, schemas.Integer, schemas.UnsignedMediumInt, schemas.UnsignedSmallInt:
|
||||||
if c.IsAutoIncrement {
|
if c.IsAutoIncrement {
|
||||||
return schemas.Serial
|
return schemas.Serial
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue