X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=sql%2FPg-upgrade2%2Fcp_greeting_migration.pl;h=176516572fbe8064e3d1e3068434a74778eda1e0;hb=a8da95826e357e75f78ccfc6b8f2c2523c52723f;hp=93f62134bab88b9caa9397b13d95cb2d9f85ad5f;hpb=11654460e748a644893110a043c760a1fe25dd5b;p=kivitendo-erp.git diff --git a/sql/Pg-upgrade2/cp_greeting_migration.pl b/sql/Pg-upgrade2/cp_greeting_migration.pl index 93f62134b..176516572 100644 --- a/sql/Pg-upgrade2/cp_greeting_migration.pl +++ b/sql/Pg-upgrade2/cp_greeting_migration.pl @@ -38,11 +38,11 @@ sub query_result { while (my $row = $sth2->fetchrow_hashref()) { if ($main::form->{"gender_$i"} eq "f" ) { - $mchecked = ""; - $fchecked = "checked"; + $mchecked = ""; + $fchecked = "checked"; } else { - $mchecked = "checked"; - $fchecked = ""; + $mchecked = "checked"; + $fchecked = ""; }; $gender_table .= "{cp_id}\"> $row->{cp_givenname} $row->{cp_name} $row->{cp_title} $row->{cp_greeting} \n"; @@ -85,13 +85,25 @@ sub print_question { print $main::form->parse_html_template("dbupgrade/cp_greeting_update_form"); } +sub alter_schema_only { + my $sqlcode = <do($sqlcode); +} + sub do_update { # main function # Do not ask the user anything if there are no entries in the # contacts table. my ($data_exists) = $dbh->selectrow_array("SELECT * FROM contacts LIMIT 1"); - return 1 if !$data_exists; + if (!$data_exists) { + alter_schema_only(); + return 1; + } # first of all check if gender.sql was already run and thus cp_gender exists # if it exists there is no need for this update anymore, so return