Changeset 28813
- Timestamp:
- Jul 30, 2010, 4:00:22 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/perl/ippToPsps/IppToPspsDb.pm (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/perl/ippToPsps/IppToPspsDb.pm
r28756 r28813 59 59 my ($self, $batchId, $expId, $processed, $published, $totalDetections) = @_; 60 60 61 print "HJHJH '$batchId', '$expId', '$processed', '$published', '$totalDetections'\n";62 63 61 if (!$totalDetections) {$totalDetections = -1;} 64 62 … … 118 116 $batchId++; 119 117 120 my$query = $self->{_db}->prepare(<<SQL);118 $query = $self->{_db}->prepare(<<SQL); 121 119 INSERT INTO batches 122 120 (batch_id, exp_id, survey_id, batch_type) … … 142 140 143 141 my $currentRevision = -1; 144 my $latestRevision = 4;142 my $latestRevision = 5; 145 143 146 144 while ($currentRevision != $latestRevision) { … … 153 151 elsif ($currentRevision == 2) {$self->createRevision_3();} 154 152 elsif ($currentRevision == 3) {$self->createRevision_4();} 153 elsif ($currentRevision == 4) {$self->createRevision_5();} 155 154 } 156 155 } … … 164 163 my ($self) = @_; 165 164 166 print "* Creating revision 1 of '$ dbname'\n";165 print "* Creating revision 1 of '$self->{_dbName}'\n"; 167 166 168 167 my $query = $self->{_db}->prepare(<<SQL); … … 175 174 $query->execute; 176 175 177 my$query = $self->{_db}->prepare(<<SQL);176 $query = $self->{_db}->prepare(<<SQL); 178 177 CREATE TABLE batches ( 179 178 batch_id BIGINT NOT NULL, … … 192 191 $query->execute; 193 192 194 setRevision(1);193 $self->setRevision(1); 195 194 } 196 195 … … 203 202 my ($self) = @_; 204 203 205 print "* Creating revision 2 of '$ dbname'\n";204 print "* Creating revision 2 of '$self->{_dbName}'\n"; 206 205 207 206 my $query = $self->{_db}->prepare(<<SQL); … … 211 210 $query->execute; 212 211 213 setRevision(2);212 $self->setRevision(2); 214 213 } 215 214 … … 222 221 my ($self) = @_; 223 222 224 print "* Creating revision 3 of '$ dbname'\n";223 print "* Creating revision 3 of '$self->{_dbName}'\n"; 225 224 226 225 my $query = $self->{_db}->prepare(<<SQL); … … 230 229 $query->execute; 231 230 232 setRevision(3);231 $self->setRevision(3); 233 232 } 234 233 … … 241 240 my ($self) = @_; 242 241 243 print "* Creating revision 4 of '$ dbname'\n";242 print "* Creating revision 4 of '$self->{_dbName}'\n"; 244 243 245 244 my $query = $self->{_db}->prepare(<<SQL); … … 249 248 $query->execute; 250 249 251 setRevision(4); 250 $self->setRevision(4); 251 } 252 253 ####################################################################################### 254 # 255 # Create revision 5 of the database 256 # 257 ####################################################################################### 258 sub createRevision_5 { 259 my ($self) = @_; 260 261 print "* Creating revision 5 of '$self->{_dbName}'\n"; 262 263 my $query = $self->{_db}->prepare(<<SQL); 264 CREATE INDEX batchesIndex ON batches (batch_id); 265 SQL 266 $query->execute; 267 268 $self->setRevision(5); 252 269 } 253 270
Note:
See TracChangeset
for help on using the changeset viewer.
