]> git.sesse.net Git - ccbs/commitdiff
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 4c83b7ce538ece6a26a019cbbb8825f83684cf29..a6a498ca89eee45b0cdf89c56a034e110bbf3dc4 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 1d892b1e1ff111ca135a78d31b2883df475e020e..c98a478dc9a1320804cde5020167e50506fdcb58 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 97bcd3f1be8c9b2a0e0dbcba2ec285240f785b0a..4a9f0a8efc258c40f70f314a172d09a9dc323a20 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
 );
-);