X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FInflateColumn%2FIP.pm;h=a37dfa1d351fec0c444dfc124c73850d122ff2e3;hb=5da3e14747f34ab3fccb870e513f0b0ae762851f;hp=ba4a3d580bdc0fa63fd1cd4c0d432344146d7e23;hpb=779843115880e1daf4c4454944c8d2673fef7daf;p=dbsrgits%2FDBIx-Class-InflateColumn-IP.git diff --git a/lib/DBIx/Class/InflateColumn/IP.pm b/lib/DBIx/Class/InflateColumn/IP.pm index ba4a3d5..a37dfa1 100644 --- a/lib/DBIx/Class/InflateColumn/IP.pm +++ b/lib/DBIx/Class/InflateColumn/IP.pm @@ -22,7 +22,7 @@ appropriate format. __PACKAGE__->load_components(qw/InflateColumn::IP Core/); __PACKAGE__->add_columns( ip_address => { - data_type => 'integer', + data_type => 'bigint', is_nullable => 0, is_ip => 1, ip_format => 'numeric', @@ -48,8 +48,9 @@ Then you can treat the specified column as a NetAddr::IP object. DBIx::Class::InflateColumn::IP supports a limited amount of auto-detection of the format based on the column type. If the type -begins with C, it's assumed to be numeric, while C and -C (as used by e.g. PostgreSQL) are assumed to be C format. +begins with C or C, it's assumed to be numeric, while +C and C (as used by e.g. PostgreSQL) are assumed to be +C format. =head1 METHODS @@ -109,7 +110,7 @@ sub register_column { } my @format_map = ( - { type => qr/^int/i, format => 'numeric' }, + { type => qr/^(?:big)?int/i, format => 'numeric' }, { type => qr{^(?:inet|cidr)$}i, format => 'cidr' }, );