From f44251d96a55c8c561172a0b510b487447a7c4c1 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 14 Jan 2010 10:00:34 +0100 Subject: [PATCH] Schema von contacts immer anpassen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Auch wenn in contacts noch keine EintrÀge existieren, muss das Datenbankschema angepasst werden. --- sql/Pg-upgrade2/cp_greeting_migration.pl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/sql/Pg-upgrade2/cp_greeting_migration.pl b/sql/Pg-upgrade2/cp_greeting_migration.pl index 43d83e1ad..176516572 100644 --- a/sql/Pg-upgrade2/cp_greeting_migration.pl +++ b/sql/Pg-upgrade2/cp_greeting_migration.pl @@ -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 -- 2.20.1