sync: implement hint dependency on flags
This commit is contained in:
parent
20f2597248
commit
6740256a32
6 changed files with 72 additions and 2 deletions
10
libfic/db.go
10
libfic/db.go
|
|
@ -179,6 +179,16 @@ CREATE TABLE IF NOT EXISTS exercice_flags(
|
|||
choices_cost INTEGER 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_hints_deps(
|
||||
id_hint INTEGER NOT NULL,
|
||||
id_flag_dep INTEGER NOT NULL,
|
||||
FOREIGN KEY(id_hint) REFERENCES exercice_hints(id_hint),
|
||||
FOREIGN KEY(id_flag_dep) REFERENCES exercice_flags(id_flag)
|
||||
) DEFAULT CHARACTER SET = utf8 COLLATE = utf8_bin;
|
||||
`); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue