Revision 858d25a8
Von Moritz Bunkus vor fast 10 Jahren hinzugefügt
SL/DBUpgrade2.pm | ||
---|---|---|
297 | 297 |
: $self->process_perl_script($dbh, $filename, $version_or_control); |
298 | 298 |
} |
299 | 299 |
|
300 |
sub update2_available { |
|
301 |
$::lxdebug->enter_sub(); |
|
302 |
|
|
303 |
my ($self, $dbh) = @_; |
|
304 |
|
|
305 |
map { $_->{applied} = 0; } values %{ $self->{all_controls} }; |
|
306 |
|
|
307 |
my $sth = $dbh->prepare(qq|SELECT tag FROM | . $self->{schema} . qq|schema_info|); |
|
308 |
if ($sth->execute) { |
|
309 |
while (my ($tag) = $sth->fetchrow_array) { |
|
310 |
$self->{all_controls}->{$tag}->{applied} = 1 if defined $self->{all_controls}->{$tag}; |
|
311 |
} |
|
312 |
} |
|
313 |
$sth->finish(); |
|
314 |
|
|
315 |
my $needs_update = any { !$_->{applied} } values %{ $self->{all_controls} }; |
|
316 |
|
|
317 |
$::lxdebug->leave_sub(); |
|
318 |
|
|
319 |
return $needs_update; |
|
320 |
} |
|
321 |
|
|
322 | 300 |
sub unapplied_upgrade_scripts { |
323 | 301 |
my ($self, $dbh) = @_; |
324 | 302 |
|
... | ... | |
335 | 313 |
return grep { !$_->{applied} } @all_scripts; |
336 | 314 |
} |
337 | 315 |
|
316 |
sub update2_available { |
|
317 |
my ($self, $dbh) = @_; |
|
318 |
|
|
319 |
my @unapplied_scripts = $self->unapplied_upgrade_scripts($dbh); |
|
320 |
|
|
321 |
return !!@unapplied_scripts; |
|
322 |
} |
|
323 |
|
|
338 | 324 |
sub apply_admin_dbupgrade_scripts { |
339 | 325 |
my ($self, $called_from_admin) = @_; |
340 | 326 |
|
Auch abrufbar als: Unified diff
SL::DBUpgrade2: Doppelten Code entfernen