From 4322c59c4fca4a7b052e027b81503bf60f144528 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Mon, 12 Apr 2021 12:55:39 +0100 Subject: [PATCH] better Signed-off-by: Andrew Thornton --- engine.go | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/engine.go b/engine.go index adf7a57b..fba4a736 100644 --- a/engine.go +++ b/engine.go @@ -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 {