]> wagnertech.de Git - mfinanz.git/blobdiff - sql/Pg-upgrade2/cp_greeting_migration.pl
Bei der Migration zu "Anrede -> Geschlecht" nicht nachfragen, wenn Tabelle leer ist.
[mfinanz.git] / sql / Pg-upgrade2 / cp_greeting_migration.pl
index 46fa43885f644b785ca8b0313eafccaf5b2bf014..93f62134bab88b9caa9397b13d95cb2d9f85ad5f 100644 (file)
@@ -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