Remove default length of 50 for Blob
There is an odd inconsistency with default blob sizes - this PR only sets the default size for bytea and binary. Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
e323971011
commit
4ab644369a
|
@ -303,11 +303,16 @@ func (db *mssql) SQLType(c *schemas.Column) string {
|
||||||
c.IsPrimaryKey = true
|
c.IsPrimaryKey = true
|
||||||
c.Nullable = false
|
c.Nullable = false
|
||||||
res = schemas.BigInt
|
res = schemas.BigInt
|
||||||
case schemas.Bytea, schemas.Blob, schemas.Binary, schemas.TinyBlob, schemas.MediumBlob, schemas.LongBlob:
|
case schemas.Bytea, schemas.Binary:
|
||||||
res = schemas.VarBinary
|
res = schemas.VarBinary
|
||||||
if c.Length == 0 {
|
if c.Length == 0 {
|
||||||
c.Length = 50
|
c.Length = 50
|
||||||
}
|
}
|
||||||
|
case schemas.Blob, schemas.TinyBlob, schemas.MediumBlob, schemas.LongBlob:
|
||||||
|
res = schemas.VarBinary
|
||||||
|
if c.Length == -1 {
|
||||||
|
res += "(MAX)"
|
||||||
|
}
|
||||||
case schemas.TimeStamp:
|
case schemas.TimeStamp:
|
||||||
res = schemas.DateTime
|
res = schemas.DateTime
|
||||||
case schemas.TimeStampz:
|
case schemas.TimeStampz:
|
||||||
|
|
Loading…
Reference in New Issue