Commit fa4006ee authored by Robert Czechowski's avatar Robert Czechowski
Browse files

Order contests by ID

parent e424e41c
Pipeline #273 passed with stages
in 13 minutes and 24 seconds
......@@ -535,7 +535,7 @@ impl MedalConnection for Connection {
fn get_contest_list(&self) -> Vec<Contest> {
let res =
self.query("SELECT id, location, filename, name, duration, public, start_date, end_date FROM contest", &[])
self.query("SELECT id, location, filename, name, duration, public, start_date, end_date FROM contest ORDER BY id", &[])
.unwrap();
res.iter()
.map(|row| Contest { id: Some(row.get(0)),
......
......@@ -527,7 +527,7 @@ impl MedalConnection for Connection {
fn get_contest_list(&self) -> Vec<Contest> {
let mut stmt =
self.prepare("SELECT id, location, filename, name, duration, public, start_date, end_date FROM contest")
self.prepare("SELECT id, location, filename, name, duration, public, start_date, end_date FROM contest ORDER BY id")
.unwrap();
let res = stmt.query_map(&[], |row| Contest { id: Some(row.get(0)),
location: row.get(1),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment