From 4409c6f1b9a84f55adbdac906cee4a8b1a157a6e Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Tue, 28 Jul 2020 06:10:51 +0100 Subject: fixed bug where return.id was being left out of return_data row insert --- pkg/datamaps/db.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/datamaps/db.go b/pkg/datamaps/db.go index fb1785f..c930500 100644 --- a/pkg/datamaps/db.go +++ b/pkg/datamaps/db.go @@ -217,13 +217,13 @@ func importXLSXtoDB(dm_name string, return_name string, file string, db *sql.DB) fmt.Errorf("cannot find a datamap_line row for %s and %s: %s\n", sheetName, cellRef, err) } - insertStmt, err := db.Prepare("insert into return_data (dml_id, value) values(?,?)") + insertStmt, err := db.Prepare("insert into return_data (dml_id, ret_id, value) values(?,?,?)") if err != nil { log.Fatal(err) } defer insertStmt.Close() - res, err = insertStmt.Exec(dmlId, cellData.Value) + res, err = insertStmt.Exec(dmlId, retId, cellData.Value) if err != nil { log.Fatal(err) } -- cgit v1.2.3