diff --git a/lib/NGCP/Schema/InflateColumn/DateTime/EpochString.pm b/lib/NGCP/Schema/InflateColumn/DateTime/EpochString.pm index fc219447..f0ef5008 100644 --- a/lib/NGCP/Schema/InflateColumn/DateTime/EpochString.pm +++ b/lib/NGCP/Schema/InflateColumn/DateTime/EpochString.pm @@ -30,7 +30,7 @@ sub add_columns { sub _inflate_to_datetime { my( $self, $value, $info, @rest ) = @_; return $self->next::method( $value, $info, @rest ) - unless $info->{ data_type } eq "varchar" + unless $info->{ data_type } eq "varchar" || $info->{ data_type } eq "integer" || (exists $info->{ inflate_datetime } && $info->{ inflate_datetime } eq 'epoch_string'); my $tz = DateTime::TimeZone->new( name => 'local' ); diff --git a/lib/NGCP/Schema/Result/fax_journal.pm b/lib/NGCP/Schema/Result/fax_journal.pm index c1ef3707..ae8abc5c 100644 --- a/lib/NGCP/Schema/Result/fax_journal.pm +++ b/lib/NGCP/Schema/Result/fax_journal.pm @@ -4,7 +4,11 @@ use parent 'DBIx::Class::Core'; our $VERSION = '2.007'; -__PACKAGE__->load_components("InflateColumn::DateTime", "Helper::Row::ToJSON"); +__PACKAGE__->load_components( + "InflateColumn::DateTime", + "Helper::Row::ToJSON", + "+NGCP::Schema::InflateColumn::DateTime::EpochString", +); __PACKAGE__->table("kamailio.fax_journal"); @@ -29,6 +33,7 @@ __PACKAGE__->add_columns( default_value => 0, extra => { unsigned => 1 }, is_nullable => 0, + inflate_datetime => 'epoch_string', }, "duration", {