Remove default length of 50 for Blob (#1959)
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> Reviewed-on: https://gitea.com/xorm/xorm/pulls/1959 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Andrew Thornton <art27@cantab.net> Co-committed-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
6f79e06376
commit
ad4830f531
|
@ -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 == 0 {
|
||||||
|
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