From: Steinar H. Gunderson Date: Sun, 20 Feb 2005 01:29:43 +0000 (+0000) Subject: Add information to the SQL schema saying when the group was last updated. Make the... X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=9c78e37258ab59892b8032be8ed2265d2ad2f587 Add information to the SQL schema saying when the group was last updated. Make the web interface update that information. --- diff --git a/html/do-edit-scores.pl b/html/do-edit-scores.pl index 4c83b7c..a6a498c 100755 --- a/html/do-edit-scores.pl +++ b/html/do-edit-scores.pl @@ -72,6 +72,8 @@ for my $p ($cgi->param()) { } } +$dbh->do('UPDATE bigscreen.active_groups SET last_updated=now() WHERE tournament=? AND round=? AND parallel=?', + undef, $tournament, $round, $group); $dbh->do('NOTIFY scores'); $dbh->commit; diff --git a/html/do-set-active-round.pl b/html/do-set-active-round.pl index 1d892b1..c98a478 100755 --- a/html/do-set-active-round.pl +++ b/html/do-set-active-round.pl @@ -16,7 +16,7 @@ $dbh->{AutoCommit} = 0; $dbh->do('DELETE FROM bigscreen.active_groups WHERE tournament=? AND round=? AND parallel=?', undef, $tournament, $round, $parallel); if ($cgi->param('show') eq 'true') { - $dbh->do('INSERT INTO bigscreen.active_groups (tournament, round, parallel) VALUES (?,?,?)', + $dbh->do('INSERT INTO bigscreen.active_groups (tournament, round, parallel, last_updated) VALUES (?,?,?,now())', undef, $tournament, $round, $parallel); } diff --git a/sql/ccbs.sql b/sql/ccbs.sql index 97bcd3f..4a9f0a8 100644 --- a/sql/ccbs.sql +++ b/sql/ccbs.sql @@ -175,8 +175,8 @@ CREATE TABLE bigscreen.active_groups ( tournament INTEGER NOT NULL REFERENCES bigscreen.active_tournament, round INTEGER NOT NULL, parallel INTEGER NOT NULL, + last_updated TIMESTAMP NOT NULL, PRIMARY KEY ( tournament, round, parallel ), FOREIGN KEY ( tournament, round, parallel ) REFERENCES groups ); -);