From 5bd8b593ff1136bd76b8dc132a39d9ed3458b187 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 18 Oct 2023 12:05:17 +0300 Subject: Explicitly specify columns Due to possible schema differences between local small db on development computer and those on CI/CD and Production, explicitly specify the columns being operated on by the queries. --- qc_app/dbinsert.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qc_app/dbinsert.py b/qc_app/dbinsert.py index e9dc3ff..df9a9fd 100644 --- a/qc_app/dbinsert.py +++ b/qc_app/dbinsert.py @@ -193,7 +193,9 @@ def create_study(): datetime.now().date().strftime("%Y-%m-%d"), form["inbredsetid"]) query = ( - "INSERT INTO ProbeFreeze() " + "INSERT INTO ProbeFreeze(" + "Id, ProbeFreezeId, ChipId, TissueId, Name, FullName, " + "ShortName, CreateTime, InbredSetId) " "VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s)") cursor.execute(query, values) flash("Study created successfully", "alert-success") @@ -291,7 +293,11 @@ def create_dataset(): form["datasetpublic"], form["datasetconfidentiality"], form["datasetdatascale"]) query = ( - "INSERT INTO ProbeSetFreeze VALUES" + "INSERT INTO ProbeSetFreeze(" + "Id, ProbeFreezeId, AvgID, Name, Name2, FullName, " + "ShortName, CreateTime, OrderList, public, " + "confidentiality, AuthorisedUsers, DataScale) " + "VALUES" "(%s, %s, %s, %s, %s, %s, %s, %s, NULL, %s, %s, NULL, %s)") cursor.execute(query, values) return render_template( -- cgit v1.2.3