Changeset 28719 for trunk/tools/czartool/CzarDb.pm
- Timestamp:
- Jul 27, 2010, 2:42:17 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/tools/czartool/CzarDb.pm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/czartool/CzarDb.pm
r28715 r28719 72 72 $query->execute; 73 73 } 74 75 ########################################################################### 76 # 77 # Sets priority for this label 78 # 79 ########################################################################### 80 sub setLabelPriority { 81 my ($self, $label, $priority) = @_; 82 83 my $query = $self->{_db}->prepare(<<SQL); 84 UPDATE current_labels 85 SET priority = $priority 86 WHERE label LIKE '$label' 87 AND server LIKE 'stdscience'; 88 SQL 89 90 $query->execute; 91 } 92 74 93 ########################################################################### 75 94 # … … 79 98 sub updateCurrentLabels { 80 99 my ($self, $server, $labels) = @_; 100 101 my $size = scalar @{$labels}; 102 if ($size < 1) {return;} 81 103 82 104 my $query = $self->{_db}->prepare(<<SQL); … … 181 203 182 204 my ($timestamp, $pending, $faults, $processed) = @row; 205 # print "'$timestamp' '$pending' '$faults' '$processed'\n"; 183 206 print $tempFile "$timestamp $pending $faults $processed\n"; 184 207 } … … 298 321 299 322 my $currentRevision = -1; 300 my $latestRevision = 6;323 my $latestRevision = 7; 301 324 302 325 while ($currentRevision != $latestRevision) { … … 311 334 elsif ($currentRevision == 4) {$self->createRevision_5();} 312 335 elsif ($currentRevision == 5) {$self->createRevision_6();} 336 elsif ($currentRevision == 6) {$self->createRevision_7();} 313 337 } 314 338 } … … 476 500 ####################################################################################### 477 501 # 502 # Create revision 7 of the database 503 # 504 ####################################################################################### 505 sub createRevision_7 { 506 my ($self) = @_; 507 508 print "* Creating revision 7 of '$self->{_dbName}'\n"; 509 510 my $query = $self->{_db}->prepare(<<SQL); 511 ALTER TABLE current_labels 512 ADD COLUMN priority INT NOT NULL DEFAULT 0; 513 SQL 514 515 $query->execute; 516 517 $self->setRevision(7); 518 } 519 520 ####################################################################################### 521 # 478 522 # Sets current revision of ippToPsps database 479 523 #
Note:
See TracChangeset
for help on using the changeset viewer.
