From b6123ceb024067abe7f391d97baa2ca8d679518d Mon Sep 17 00:00:00 2001 From: haraldnilsen Date: Wed, 10 Jan 2024 19:09:04 +0100 Subject: [PATCH] :card_file_box: changed db variables Co-authored-by: Sindre Kjelsrud --- backend/cmd/main.go | 2 +- backend/db/db.go | 6 ++++++ backend/db/insert_bug_report.go | 2 +- backend/db/insert_evaluation.go | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/backend/cmd/main.go b/backend/cmd/main.go index 3763477..2a2ae7e 100644 --- a/backend/cmd/main.go +++ b/backend/cmd/main.go @@ -143,5 +143,5 @@ func main() { // Run the server on port 8080 router.Run(":8080") - //db.SetupDb() + // db.SetupDb() } diff --git a/backend/db/db.go b/backend/db/db.go index 4c5f41d..0ef8e8a 100644 --- a/backend/db/db.go +++ b/backend/db/db.go @@ -62,6 +62,12 @@ func SetupDb() { empati INT, hjelpsomhet INT );`, + `CREATE TABLE IF NOT EXISTS Evaluering ( + evalueringtekst TEXT + );`, + `CREATE TABLE IF NOT EXISTS FeilRapport ( + feiltekst TEXT + );`, } // Execute SQL statements diff --git a/backend/db/insert_bug_report.go b/backend/db/insert_bug_report.go index 76ae413..3c9fdf3 100644 --- a/backend/db/insert_bug_report.go +++ b/backend/db/insert_bug_report.go @@ -28,7 +28,7 @@ func InsertBugReport(bugText string) (error) { } insertStatement := ` - INSERT INTO FeilRapport (feilTekst) + INSERT INTO FeilRapport (feiltekst) VALUES ($1) ` stmt, err := db.Prepare(insertStatement) diff --git a/backend/db/insert_evaluation.go b/backend/db/insert_evaluation.go index e25b093..f218bce 100644 --- a/backend/db/insert_evaluation.go +++ b/backend/db/insert_evaluation.go @@ -28,7 +28,7 @@ func InsertEvaluation(evaluationText string) (error) { } insertStatement := ` - INSERT INTO Evaluering (evalueringTekst) + INSERT INTO Evaluering (evalueringtekst) VALUES ($1) ` stmt, err := db.Prepare(insertStatement)