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)