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:
Andrew Thornton 2021-06-26 22:04:15 +01:00
parent e323971011
commit 4ab644369a
No known key found for this signature in database
GPG Key ID: 3CDE74631F13A748
1 changed files with 6 additions and 1 deletions

View File

@ -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: