summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorivan <ivan>2005-04-02 22:46:44 +0000
committerivan <ivan>2005-04-02 22:46:44 +0000
commitf583418a23dfb001978d3abf8476670d5adb96af (patch)
tree14bc6232c49f4ef9a1890f95f0d8dbc28536d334 /FS/FS
parent5d2eb9bf6bc24562ed6cff037379e78a2da7a654 (diff)
herding elephants: add primary keys to *all* tables for slony
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/cust_bill_pkg.pm5
-rwxr-xr-xFS/FS/part_svc_router.pm3
-rw-r--r--FS/FS/pkg_svc.pm5
-rw-r--r--FS/FS/rate_detail.pm5
-rw-r--r--FS/FS/reg_code_pkg.pm5
-rw-r--r--FS/FS/type_pkgs.pm5
6 files changed, 22 insertions, 6 deletions
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index 6800707..3478904 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -36,6 +36,8 @@ supported:
=over 4
+=item billpkgnum - primary key
+
=item invnum - invoice (see L<FS::cust_bill>)
=item pkgnum - package (see L<FS::cust_pkg>) or 0 for the special virtual sales tax package
@@ -153,7 +155,8 @@ sub check {
my $self = shift;
my $error =
- $self->ut_number('pkgnum')
+ $self->ut_numbern('billpkgnum')
+ || $self->ut_number('pkgnum')
|| $self->ut_number('invnum')
|| $self->ut_money('setup')
|| $self->ut_money('recur')
diff --git a/FS/FS/part_svc_router.pm b/FS/FS/part_svc_router.pm
index 0b23ab5..df04cc9 100755
--- a/FS/FS/part_svc_router.pm
+++ b/FS/FS/part_svc_router.pm
@@ -13,7 +13,8 @@ sub table { 'part_svc_router'; }
sub check {
my $self = shift;
my $error =
- $self->ut_foreign_key('svcpart', 'part_svc', 'svcpart')
+ $self->ut_numbern('svcrouternum')
+ || $self->ut_foreign_key('svcpart', 'part_svc', 'svcpart')
|| $self->ut_foreign_key('routernum', 'router', 'routernum');
return $error if $error;
''; #no error
diff --git a/FS/FS/pkg_svc.pm b/FS/FS/pkg_svc.pm
index ea52176..065ddbe 100644
--- a/FS/FS/pkg_svc.pm
+++ b/FS/FS/pkg_svc.pm
@@ -39,6 +39,8 @@ FS::Record. The following fields are currently supported:
=over 4
+=item pkgsvcnum - primary key
+
=item pkgpart - Billing item definition (see L<FS::part_pkg>)
=item svcpart - Service definition (see L<FS::part_svc>)
@@ -101,7 +103,8 @@ sub check {
my $error;
$error =
- $self->ut_number('pkgpart')
+ $self->ut_numbern('pkgsvcnum')
+ || $self->ut_number('pkgpart')
|| $self->ut_number('svcpart')
|| $self->ut_number('quantity')
;
diff --git a/FS/FS/rate_detail.pm b/FS/FS/rate_detail.pm
index 313b053..7d54355 100644
--- a/FS/FS/rate_detail.pm
+++ b/FS/FS/rate_detail.pm
@@ -34,6 +34,8 @@ inherits from FS::Record. The following fields are currently supported:
=over 4
+=item ratedetailnum - primary key
+
=item ratenum - rate plan (see L<FS::rate>)
=item orig_regionnum - call origination region
@@ -106,7 +108,8 @@ sub check {
my $self = shift;
my $error =
- $self->ut_foreign_key('ratenum', 'rate', 'ratenum')
+ $self->ut_numbern('ratedetailnum')
+ || $self->ut_foreign_key('ratenum', 'rate', 'ratenum')
|| $self->ut_foreign_keyn('orig_regionnum', 'rate_region', 'regionnum' )
|| $self->ut_foreign_key('dest_regionnum', 'rate_region', 'regionnum' )
|| $self->ut_number('min_included')
diff --git a/FS/FS/reg_code_pkg.pm b/FS/FS/reg_code_pkg.pm
index 598497c..9b9a877 100644
--- a/FS/FS/reg_code_pkg.pm
+++ b/FS/FS/reg_code_pkg.pm
@@ -35,6 +35,8 @@ supported:
=over 4
+=item codepkgnum - primary key
+
=item codenum - registration code (see L<FS::reg_code>)
=item pkgpart - package definition (see L<FS::part_pkg>)
@@ -99,7 +101,8 @@ sub check {
my $self = shift;
my $error =
- $self->ut_foreign_key('codenum', 'reg_code', 'codenum')
+ $self->ut_numbern('codepkgnum')
+ || $self->ut_foreign_key('codenum', 'reg_code', 'codenum')
|| $self->ut_foreign_key('pkgpart', 'part_pkg', 'pkgpart')
;
return $error if $error;
diff --git a/FS/FS/type_pkgs.pm b/FS/FS/type_pkgs.pm
index 07ad2bc..bf34e7c 100644
--- a/FS/FS/type_pkgs.pm
+++ b/FS/FS/type_pkgs.pm
@@ -35,6 +35,8 @@ FS::Record. The following fields are currently supported:
=over 4
+=item typepkgnum - primary key
+
=item typenum - Agent type, see L<FS::agent_type>
=item pkgpart - Billing item definition, see L<FS::part_pkg>
@@ -80,7 +82,8 @@ sub check {
my $self = shift;
my $error =
- $self->ut_number('typenum')
+ $self->ut_numbern('typepkgnum')
+ || $self->ut_number('typenum')
|| $self->ut_number('pkgpart')
;
return $error if $error;