Bug 21610: (follow-up) Default value for dates
We have some dates with DEFAULT CURRENT_TIMESTAMP and some dates with
default and UPDATE clause.
Test plan:
Run Object.t again.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 0ee4e9e14f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
b1af157152
commit
87d59cfb7d
|
|
@ -141,7 +141,9 @@ sub store {
|
|||
}
|
||||
elsif ( _date_or_datetime_column_type( $columns_info->{$col}->{data_type} ) ) {
|
||||
# Set to null if an empty string (or == 0 but should not happen)
|
||||
$self->$col(undef) unless $self->$col;
|
||||
# Skip a default value for dates LIKE CURRENT_TIMESTAMP
|
||||
# In DBIx represented as: default_value => \'now()'
|
||||
$self->$col(undef) unless $self->$col || $columns_info->{$col}->{default_value};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue