fic: Can overwrite authors for each exercice
This commit is contained in:
parent
1a8ebcb8bf
commit
28ad0fa791
5 changed files with 23 additions and 11 deletions
|
|
@ -142,6 +142,7 @@ CREATE TABLE IF NOT EXISTS exercices(
|
|||
id_exercice INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
id_theme INTEGER NOT NULL,
|
||||
title VARCHAR(255) NOT NULL,
|
||||
authors TEXT NOT NULL,
|
||||
image VARCHAR(255) NOT NULL,
|
||||
disabled BOOLEAN NOT NULL DEFAULT 0,
|
||||
headline TEXT NOT NULL,
|
||||
|
|
@ -562,7 +563,7 @@ func DBRecreateDiscountedView() (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
_, err = db.Exec("CREATE OR REPLACE VIEW exercices_discounted AS SELECT E.id_exercice, E.id_theme, E.title, E.image, E.disabled, E.headline, E.url_id, E.path, E.statement, E.overview, E.issue, E.issue_kind, E.depend, E.gain - " + fmt.Sprintf("%f", DiscountedFactor) + " * E.gain * (COUNT(*) - 1) AS gain, E.coefficient_cur, E.finished, E.video_uri, E.resolution, E.seealso FROM exercices E LEFT OUTER JOIN exercice_solved S ON S.id_exercice = E.id_exercice GROUP BY E.id_exercice;")
|
||||
_, err = db.Exec("CREATE OR REPLACE VIEW exercices_discounted AS SELECT E.id_exercice, E.id_theme, E.title, E.authors, E.image, E.disabled, E.headline, E.url_id, E.path, E.statement, E.overview, E.issue, E.issue_kind, E.depend, E.gain - " + fmt.Sprintf("%f", DiscountedFactor) + " * E.gain * (COUNT(*) - 1) AS gain, E.coefficient_cur, E.finished, E.video_uri, E.resolution, E.seealso FROM exercices E LEFT OUTER JOIN exercice_solved S ON S.id_exercice = E.id_exercice GROUP BY E.id_exercice;")
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue