From 5a80d57ca2a14f7985a3d00e84bd0d5b45728178 Mon Sep 17 00:00:00 2001 From: Tom Bloor Date: Thu, 21 Sep 2017 15:48:25 +0100 Subject: [PATCH] Added table for storing postcodes --- .../LocalLoop/Schema/Result/GbPostcode.pm | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 lib/Pear/LocalLoop/Schema/Result/GbPostcode.pm diff --git a/lib/Pear/LocalLoop/Schema/Result/GbPostcode.pm b/lib/Pear/LocalLoop/Schema/Result/GbPostcode.pm new file mode 100644 index 0000000..048d3b6 --- /dev/null +++ b/lib/Pear/LocalLoop/Schema/Result/GbPostcode.pm @@ -0,0 +1,38 @@ +package Pear::LocalLoop::Schema::Result::GbPostcode; + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +__PACKAGE__->table('gb_postcodes'); + +__PACKAGE__->add_columns( + outcode => { + data_type => 'char', + size => 4, + is_nullable => 0, + }, + incode => { + data_type => 'char', + size => 3, + is_nullable => 0, + default_value => '', + }, + latitude => { + data_type => 'decimal', + size => [7,5], + is_nullable => 1, + default_value => undef, + }, + longitude => { + data_type => 'decimal', + size => [7,5], + is_nullable => 1, + default_value => undef, + }, +); + +__PACKAGE__->set_primary_key(qw/ outcode incode /); + +1;