Lines 141-149
sub store {
Link Here
|
141 |
} |
141 |
} |
142 |
elsif ( _date_or_datetime_column_type( $columns_info->{$col}->{data_type} ) ) { |
142 |
elsif ( _date_or_datetime_column_type( $columns_info->{$col}->{data_type} ) ) { |
143 |
# Set to null if an empty string (or == 0 but should not happen) |
143 |
# Set to null if an empty string (or == 0 but should not happen) |
144 |
# Skip a default value for dates LIKE CURRENT_TIMESTAMP |
144 |
if ( defined $self->$col and not $self->$col ) { |
145 |
# In DBIx represented as: default_value => \'now()' |
145 |
if ( $columns_info->{$col}->{is_nullable} ) { |
146 |
$self->$col(undef) unless $self->$col || $columns_info->{$col}->{default_value}; |
146 |
$self->$col(undef); |
|
|
147 |
} else { |
148 |
$self->$col($columns_info->{$col}->{default_value}); |
149 |
} |
150 |
} |
147 |
} |
151 |
} |
148 |
} |
152 |
} |
149 |
|
153 |
|
150 |
- |
|
|