qa: New service to handle QA testing by students

This commit is contained in:
nemunaire 2020-09-08 12:50:41 +02:00
commit a237936feb
37 changed files with 1476 additions and 0 deletions

View file

@ -415,6 +415,37 @@ CREATE TABLE IF NOT EXISTS claim_descriptions(
publish BOOLEAN NOT NULL DEFAULT 0,
FOREIGN KEY(id_claim) REFERENCES claims(id_claim)
) DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
`); err != nil {
return err
}
if _, err := db.Exec(`
CREATE TABLE IF NOT EXISTS exercices_qa(
id_qa INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
id_exercice INTEGER NOT NULL,
id_team INTEGER NOT NULL,
authuser VARCHAR(255) NOT NULL,
subject VARCHAR(255) NOT NULL,
creation TIMESTAMP NOT NULL,
state VARCHAR(255) NOT NULL,
solved TIMESTAMP NULL,
closed TIMESTAMP NULL,
FOREIGN KEY(id_exercice) REFERENCES exercices(id_exercice),
FOREIGN KEY(id_team) REFERENCES teams(id_team)
) DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
`); err != nil {
return err
}
if _, err := db.Exec(`
CREATE TABLE IF NOT EXISTS qa_comments(
id_comment INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
id_qa INTEGER NOT NULL,
id_team INTEGER NOT NULL,
authuser VARCHAR(255) NOT NULL,
date TIMESTAMP NOT NULL,
content TEXT NOT NULL,
FOREIGN KEY(id_qa) REFERENCES exercices_qa(id_qa),
FOREIGN KEY(id_team) REFERENCES teams(id_team)
) DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
`); err != nil {
return err
}