Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
Andrew Thornton 2021-04-12 12:55:39 +01:00
parent de0cf1c553
commit 4322c59c4f
No known key found for this signature in database
GPG Key ID: 3CDE74631F13A748
1 changed files with 1 additions and 16 deletions

View File

@ -448,21 +448,6 @@ func formatColumnValue(dstDialect dialects.Dialect, d interface{}, col *schemas.
return "NULL"
}
if dstDialect.URI().DBType == schemas.SQLITE || dstDialect.URI().DBType == schemas.MSSQL {
if dq, ok := d.(bool); ok {
if dq {
return "1"
}
return "0"
}
if val, ok := d.(reflect.Value); ok && val.Kind() == reflect.Bool {
if val.Bool() {
return "1"
}
return "0"
}
}
if dq, ok := d.(bool); ok && (dstDialect.URI().DBType == schemas.SQLITE ||
dstDialect.URI().DBType == schemas.MSSQL) {
if dq {
@ -637,7 +622,7 @@ func (engine *Engine) dumpTables(tables []*schemas.Table, w io.Writer, tp ...sch
if col == nil {
return errors.New("unknown column error")
}
temp += "," + formatColumnValue(dstDialect, val.Elem().FieldByName(col.FieldName), col)
temp += "," + formatColumnValue(dstDialect, val.Elem().FieldByName(col.FieldName).Interface(), col)
}
_, err = io.WriteString(w, temp[1:]+");\n")
if err != nil {