Handle choices in UCQ (db, sync done)

This commit is contained in:
nemunaire 2018-11-21 04:10:22 +01:00 committed by Pierre-Olivier Mercier
parent 333bb408e1
commit 488a032eba
7 changed files with 202 additions and 1 deletions

View file

@ -168,6 +168,17 @@ CREATE TABLE IF NOT EXISTS exercice_flags(
cksum BINARY(64) NOT NULL,
FOREIGN KEY(id_exercice) REFERENCES exercices(id_exercice)
) DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
`); err != nil {
return err
}
if _, err := db.Exec(`
CREATE TABLE IF NOT EXISTS flag_choices(
id_choice INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
id_flag INTEGER NOT NULL,
label VARCHAR(255) NOT NULL,
response VARCHAR(255) NOT NULL,
FOREIGN KEY(id_flag) REFERENCES exercice_flags(id_flag)
) DEFAULT CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
`); err != nil {
return err
}