From: Moritz Bunkus Date: Mon, 9 Nov 2009 13:46:37 +0000 (+0100) Subject: Bei der Migration zu "Anrede -> Geschlecht" nicht nachfragen, wenn Tabelle leer ist. X-Git-Tag: release-2.6.1beta1~105 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=11654460e748a644893110a043c760a1fe25dd5b;p=kivitendo-erp.git Bei der Migration zu "Anrede -> Geschlecht" nicht nachfragen, wenn Tabelle leer ist. --- diff --git a/sql/Pg-upgrade2/cp_greeting_migration.pl b/sql/Pg-upgrade2/cp_greeting_migration.pl index 46fa43885..93f62134b 100644 --- a/sql/Pg-upgrade2/cp_greeting_migration.pl +++ b/sql/Pg-upgrade2/cp_greeting_migration.pl @@ -88,6 +88,11 @@ sub print_question { 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; + # 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 # without doing anything