X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=sql%2FPg-upgrade2%2Fcontacts_add_street_and_zipcode_and_city.pl;h=9d684c123928bc8a8b1c4167f2baafa7218e9db1;hb=b36fb0f412d2d2b43b8d98d787743cbe1fbf2540;hp=f1dde25bf6e129e64d283394a147cdf5bfd29307;hpb=f33abdbb755528638fe81ea62200e69e5583ec00;p=kivitendo-erp.git 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 index f1dde25bf..9d684c123 100644 --- a/sql/Pg-upgrade2/contacts_add_street_and_zipcode_and_city.pl +++ b/sql/Pg-upgrade2/contacts_add_street_and_zipcode_and_city.pl @@ -1,24 +1,25 @@ # @tag: contacts_add_street_and_zipcode_and_city # @description: Spalten hinzufügen. # @depends: release_2_7_0 -# @charset: utf-8 +package SL::DBUpgrade2::contacts_add_street_and_zipcode_and_city; -use utf8; use strict; +use utf8; + +use parent qw(SL::DBUpgrade2::Base); + +sub run { + my ($self) = @_; -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;', -); + 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; - } + $self->db_query($_, may_fail => 1) for @queries; - $dbh->rollback(); - $dbh->begin_work(); + return 1; } -return 1; +1;