From 3079de46927bb38c95722c542a39c489d6a602b3 Mon Sep 17 00:00:00 2001 From: matt Date: Tue, 12 Apr 2022 00:13:10 +0000 Subject: [PATCH] Added testResultId field to schema --- utility/db/initDb.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utility/db/initDb.js b/utility/db/initDb.js index ed1760f..8899d89 100644 --- a/utility/db/initDb.js +++ b/utility/db/initDb.js @@ -111,11 +111,12 @@ tableCreate.set('test', ` tableCreate.set('testResult', ` CREATE TABLE IF NOT EXISTS testResult ( + testResultId varchar(36) NOT NULL PRIMARY KEY, studentId varchar(36) NOT NULL , testId varchar(36) NOT NULL , accountId varchar(36) NOT NULL , mark int NOT NULL , - CONSTRAINT primarykey PRIMARY KEY ( studentId, testId ) + CONSTRAINT Unq_testResult UNIQUE ( studentId, testId ) ); `);