CRM-Datenbankfelder "cp_street", "cp_zipcode" und "cp_city" in die Tabelle "contacts...
authorThomas Heck <theck@linet-services.de>
Wed, 29 Aug 2012 13:32:40 +0000 (15:32 +0200)
committerThomas Heck <theck@linet-services.de>
Wed, 29 Aug 2012 13:32:40 +0000 (15:32 +0200)
sql/Pg-upgrade2/contacts_add_street_and_zipcode_and_city.pl [new file with mode: 0644]

diff --git a/sql/Pg-upgrade2/contacts_add_street_and_zipcode_and_city.pl b/sql/Pg-upgrade2/contacts_add_street_and_zipcode_and_city.pl
new file mode 100644 (file)
index 0000000..f1dde25
--- /dev/null
@@ -0,0 +1,24 @@
+# @tag: contacts_add_street_and_zipcode_and_city
+# @description: Spalten hinzuf&uuml;gen.
+# @depends: release_2_7_0
+# @charset: utf-8
+
+use utf8;
+use strict;
+
+my @queries = (
+  'ALTER TABLE contacts ADD COLUMN cp_street text;',
+  'ALTER TABLE contacts ADD COLUMN cp_zipcode text;',
+  'ALTER TABLE contacts ADD COLUMN cp_city text;',
+);
+
+foreach my $query (@queries) {
+  if ( $dbh->do($query) ) {
+    next;
+  }
+
+  $dbh->rollback();
+  $dbh->begin_work();
+}
+
+return 1;