Files can now depends on MCQ
This commit is contained in:
parent
823328ead2
commit
e937073588
8 changed files with 90 additions and 28 deletions
12
libfic/db.go
12
libfic/db.go
|
|
@ -215,7 +215,7 @@ CREATE TABLE IF NOT EXISTS flag_choices(
|
|||
return err
|
||||
}
|
||||
if _, err := db.Exec(`
|
||||
CREATE TABLE IF NOT EXISTS exercice_files_deps(
|
||||
CREATE TABLE IF NOT EXISTS exercice_files_okey_deps(
|
||||
id_file INTEGER NOT NULL,
|
||||
id_flag INTEGER NOT NULL,
|
||||
FOREIGN KEY(id_file) REFERENCES exercice_files(id_file),
|
||||
|
|
@ -231,6 +231,16 @@ CREATE TABLE IF NOT EXISTS exercice_mcq(
|
|||
title VARCHAR(255) 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_files_omcq_deps(
|
||||
id_file INTEGER NOT NULL,
|
||||
id_mcq INTEGER NOT NULL,
|
||||
FOREIGN KEY(id_file) REFERENCES exercice_files(id_file),
|
||||
FOREIGN KEY(id_mcq) REFERENCES exercice_mcq(id_mcq)
|
||||
) DEFAULT CHARACTER SET = utf8 COLLATE = utf8_bin;
|
||||
`); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue