IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 27, 2010, 2:42:17 PM (16 years ago)
Author:
rhenders
Message:

Loads of stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/czartool/CzarDb.pm

    r28715 r28719  
    7272       $query->execute;
    7373}
     74
     75###########################################################################
     76#
     77# Sets priority for this label
     78#
     79###########################################################################
     80sub 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';
     88SQL
     89
     90    $query->execute;
     91}
     92
    7493###########################################################################
    7594#
     
    7998sub updateCurrentLabels {
    8099    my ($self, $server, $labels) = @_;
     100
     101    my $size = scalar @{$labels};
     102    if ($size < 1) {return;}
    81103
    82104    my $query = $self->{_db}->prepare(<<SQL);
     
    181203
    182204        my ($timestamp, $pending, $faults, $processed) = @row;
     205    #    print  "'$timestamp' '$pending' '$faults' '$processed'\n";
    183206        print $tempFile "$timestamp $pending $faults $processed\n";
    184207    }
     
    298321
    299322    my $currentRevision = -1;
    300     my $latestRevision = 6;
     323    my $latestRevision = 7;
    301324
    302325    while ($currentRevision != $latestRevision) {
     
    311334        elsif ($currentRevision == 4) {$self->createRevision_5();}
    312335        elsif ($currentRevision == 5) {$self->createRevision_6();}
     336        elsif ($currentRevision == 6) {$self->createRevision_7();}
    313337    }
    314338}
     
    476500#######################################################################################
    477501#
     502# Create revision 7 of the database
     503#
     504#######################################################################################
     505sub 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;
     513SQL
     514
     515    $query->execute;
     516
     517    $self->setRevision(7);
     518}
     519
     520#######################################################################################
     521#
    478522# Sets current revision of ippToPsps database
    479523#
Note: See TracChangeset for help on using the changeset viewer.