From: mark Date: Mon, 28 Mar 2011 23:01:59 +0000 (+0000) Subject: primary key for areacode table X-Git-Tag: freeside_2_1_3~351 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=3ae9dd3079e47f05f0078bec83485497854da0c1;p=freeside.git primary key for areacode table --- diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 9406f883c..d52edcbaf 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -3067,13 +3067,14 @@ sub tables_hashref { 'areacode' => { 'columns' => [ + 'areanum', 'serial', '', '', '', '', 'code', 'char', '', 3, '', '', 'country', 'char', 'NULL', 2, '', '', 'state', 'char', 'NULL', 2, '', '', 'description','varchar', 'NULL', 255, '', '', ], - 'primary_key' => 'code', - 'unique' => [], + 'primary_key' => 'areanum', + 'unique' => [ [ 'code' ] ], 'index' => [], }, diff --git a/FS/FS/areacode.pm b/FS/FS/areacode.pm index 58b498c09..b6defa2fc 100644 --- a/FS/FS/areacode.pm +++ b/FS/FS/areacode.pm @@ -25,27 +25,20 @@ FS::areacode - Object methods for areacode records =head1 DESCRIPTION -An FS::areacode object represents an example. FS::areacode inherits from +An FS::areacode object represents an area code. FS::areacode inherits from FS::Record. The following fields are currently supported: =over 4 -=item code +=item areanum - primary key -area code (primary key) +=item code - area code -=item country +=item country - two-letter country code -two-letter country code - -=item state - -two-letter state code, if appropriate - -=item description - -description (optional) +=item state - two-letter state code, if appropriate +=item description - description (optional) =back @@ -92,7 +85,8 @@ sub check { my $self = shift; my $error = - $self->ut_number('code') + $self->ut_numbern('areanum') + || $self->ut_number('code') || $self->ut_text('country') || $self->ut_textn('state') || $self->ut_textn('description')