Dependancy between flags

This commit is contained in:
nemunaire 2018-12-02 19:21:07 +01:00
commit f9abdd23c6
8 changed files with 111 additions and 1 deletions

View file

@ -172,6 +172,16 @@ 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 exercice_flags_deps(
id_flag INTEGER NOT NULL,
id_flag_dep INTEGER NOT NULL,
FOREIGN KEY(id_flag) REFERENCES exercice_flags(id_flag),
FOREIGN KEY(id_flag_dep) REFERENCES exercice_flags(id_flag)
) DEFAULT CHARACTER SET = utf8 COLLATE = utf8_bin;
`); err != nil {
return err
}