Fix DB issues
This commit is contained in:
parent
21cc875cc0
commit
16abc95b4f
2 changed files with 7 additions and 6 deletions
|
|
@ -235,7 +235,9 @@ func (e Exercice) Delete() (int64, error) {
|
|||
func (e Exercice) DeleteCascade() (int64, error) {
|
||||
if _, err := DBExec("UPDATE exercices SET id_depend = NULL WHERE id_depend = ?", e.Id); err != nil {
|
||||
return 0, err
|
||||
} else if _, err := DBExec("DELETE FROM exercice_files_deps WHERE id_file IN (SELECT id_file FROM exercice_files WHERE id_exercice = ?)", e.Id); err != nil {
|
||||
} else if _, err := DBExec("DELETE FROM exercice_files_okey_deps WHERE id_file IN (SELECT id_file FROM exercice_files WHERE id_exercice = ?)", e.Id); err != nil {
|
||||
return 0, err
|
||||
} else if _, err := DBExec("DELETE FROM exercice_files_omcq_deps WHERE id_file IN (SELECT id_file FROM exercice_files WHERE id_exercice = ?)", e.Id); err != nil {
|
||||
return 0, err
|
||||
} else if _, err := DBExec("DELETE FROM exercice_files WHERE id_exercice = ?", e.Id); err != nil {
|
||||
return 0, err
|
||||
|
|
|
|||
Reference in a new issue