fic: Exercice can have heading.jpg

This commit is contained in:
nemunaire 2023-06-14 17:34:18 +02:00
parent f366d6b8c1
commit abe5ad61d4
5 changed files with 42 additions and 11 deletions

View file

@ -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,
image VARCHAR(255) NOT NULL,
disabled BOOLEAN NOT NULL DEFAULT 0,
headline TEXT NOT NULL,
url_id VARCHAR(255) NOT NULL,
@ -561,7 +562,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.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.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
}