Add information to the SQL schema saying when the group was last updated. Make the...
authorSteinar H. Gunderson <sesse@samfundet.no>
Sun, 20 Feb 2005 01:29:43 +0000 (01:29 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Sun, 20 Feb 2005 01:29:43 +0000 (01:29 +0000)
html/do-edit-scores.pl
html/do-set-active-round.pl
sql/ccbs.sql

index 4c83b7c..a6a498c 100755 (executable)
@@ -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;
index 1d892b1..c98a478 100755 (executable)
@@ -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);
 }
 
index 97bcd3f..4a9f0a8 100644 (file)
@@ -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
 );
-);