From: Moritz Bunkus Date: Wed, 22 May 2013 13:38:33 +0000 (+0200) Subject: Umstellung Geburtsspalte Ansprechppersonen auf Datum: Wert '0000-00-00' als leer... X-Git-Tag: release-3.1.0beta1~405^2~4 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c2230797de646779408a5b57ec3ebe339ed7abfc;p=kivitendo-erp.git Umstellung Geburtsspalte Ansprechppersonen auf Datum: Wert '0000-00-00' als leer werten --- diff --git a/sql/Pg-upgrade2/contacts_convert_cp_birthday_to_date.pl b/sql/Pg-upgrade2/contacts_convert_cp_birthday_to_date.pl index bb45209e2..ab4a0175a 100644 --- a/sql/Pg-upgrade2/contacts_convert_cp_birthday_to_date.pl +++ b/sql/Pg-upgrade2/contacts_convert_cp_birthday_to_date.pl @@ -11,10 +11,10 @@ use parent qw(SL::DBUpgrade2::Base); sub convert_to_date { my ($self, $str) = @_; - return '' if !$str; + return '' if !$str || ($str =~ m/00.*00.*00.*00/); # 0000-00-00 may be present in old databases. my $sth = $self->dbh->prepare('SELECT ?::date AS date') or return undef; - $sth->execute($str) or return undef; + $sth->execute($str) or return undef; return $sth->fetchrow_hashref->{date}; }