Revision 90bb521a
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/DBUpgrade2.pm | ||
---|---|---|
27 | 27 |
|
28 | 28 |
$params{path_suffix} ||= ''; |
29 | 29 |
$params{schema} ||= ''; |
30 |
$params{path} = "sql/" . $params{dbdriver} . "-upgrade2" . $params{path_suffix};
|
|
30 |
$params{path} = "sql/Pg-upgrade2" . $params{path_suffix};
|
|
31 | 31 |
|
32 | 32 |
map { $self->{$_} = $params{$_} } keys %params; |
33 | 33 |
|
... | ... | |
243 | 243 |
|
244 | 244 |
my ($self, $dbh, $filename, $version_or_control, $db_charset) = @_; |
245 | 245 |
|
246 |
my %form_values = map { $_ => $::form->{$_} } qw(dbconnect dbdefault dbdriver dbhost dbmbkiviunstable dbname dboptions dbpasswd dbport dbupdate dbuser login template_object version);
|
|
246 |
my %form_values = map { $_ => $::form->{$_} } qw(dbconnect dbdefault dbhost dbmbkiviunstable dbname dboptions dbpasswd dbport dbupdate dbuser login template_object version); |
|
247 | 247 |
|
248 | 248 |
$dbh->begin_work; |
249 | 249 |
|
... | ... | |
302 | 302 |
|
303 | 303 |
local *SQLDIR; |
304 | 304 |
|
305 |
my $dbdriver = $self->{dbdriver}; |
|
306 |
opendir SQLDIR, "sql/${dbdriver}-upgrade" || error("", "sql/${dbdriver}-upgrade: $!"); |
|
307 |
my @upgradescripts = grep /${dbdriver}-upgrade-\Q$cur_version\E.*\.(sql|pl)$/, readdir SQLDIR; |
|
305 |
opendir SQLDIR, "sql/Pg-upgrade" || error("", "sql/Pg-upgrade: $!"); |
|
306 |
my @upgradescripts = grep /Pg-upgrade-\Q$cur_version\E.*\.(sql|pl)$/, readdir SQLDIR; |
|
308 | 307 |
closedir SQLDIR; |
309 | 308 |
|
310 | 309 |
return ($#upgradescripts > -1); |
... | ... | |
374 | 373 |
$::lxdebug->message(LXDebug->DEBUG2(), "Applying Update $control->{file}"); |
375 | 374 |
print $self->{form}->parse_html_template("dbupgrade/upgrade_message2", $control); |
376 | 375 |
|
377 |
$self->process_file($dbh, "sql/$self->{dbdriver}-upgrade2-auth/$control->{file}", $control, $db_charset);
|
|
376 |
$self->process_file($dbh, "sql/Pg-upgrade2-auth/$control->{file}", $control, $db_charset);
|
|
378 | 377 |
} |
379 | 378 |
|
380 | 379 |
print $self->{form}->parse_html_template("dbupgrade/footer", { is_admin => 1 }) if $called_from_admin; |
... | ... | |
461 | 460 |
# Apply outstanding updates to the authentication database |
462 | 461 |
my $scripts = SL::DBUpgrade2->new( |
463 | 462 |
form => $::form, |
464 |
dbdriver => 'Pg', |
|
465 | 463 |
auth => 1 |
466 | 464 |
); |
467 | 465 |
$scripts->apply_admin_dbupgrade_scripts(1); |
... | ... | |
469 | 467 |
# Apply updates to a user database |
470 | 468 |
my $scripts = SL::DBUpgrade2->new( |
471 | 469 |
form => $::form, |
472 |
dbdriver => $::form->{dbdriver}, |
|
473 | 470 |
auth => 1 |
474 | 471 |
); |
475 | 472 |
User->dbupdate2($form, $scripts->parse_dbupdate_controls); |
... | ... | |
603 | 600 |
|
604 | 601 |
C<SL::Form> object to use. Required. |
605 | 602 |
|
606 |
=item dbdriver |
|
607 |
|
|
608 |
Name of the database driver. Currently only C<Pg> for PostgreSQL is |
|
609 |
supported. |
|
610 |
|
|
611 | 603 |
=item auth |
612 | 604 |
|
613 | 605 |
Optional parameter defaulting to 0. If trueish then the scripts read |
Auch abrufbar als: Unified diff
Alle Vorkommen von dbdriver, sid, Oracle entfernt
...und gegen das hardcodierte Werte für PostgreSQL ersetzt.