X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=9f9770c31e311e3a189e892a81f7ca5e5a33efbf;hb=6af1b1bfa25e5ececef5e0dcd38b55917121cee2;hp=e811856669e23041add702a2c8b6159530e18acf;hpb=2c757d7db4cb6a7b9655de13206fcc84fb7ce61f;p=freeside.git diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index e81185666..9f9770c31 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -16,13 +16,6 @@ use FS::UID qw(datasrc); $DEBUG = 0; $me = '[FS::Schema]'; -#ask FS::UID to run this stuff for us later -FS::UID->install_callback( sub { - #$conf = new FS::Conf; - &reload_dbdef("/usr/local/etc/freeside/dbdef.". datasrc) - unless $setup_hack; #$setup_hack needed now? -} ); - =head1 NAME FS::Schema - Freeside database schema @@ -58,7 +51,7 @@ sub reload_dbdef { unless ( exists $dbdef_cache{$file} ) { warn "[debug]$me loading dbdef for $file\n" if $DEBUG; $dbdef_cache{$file} = DBIx::DBSchema->load( $file ) - or die "can't load database schema from $file"; + or die "can't load database schema from $file: $DBIx::DBSchema::errstr\n"; } else { warn "[debug]$me re-using cached dbdef for $file\n" if $DEBUG; } @@ -389,10 +382,24 @@ sub tables_hashref { 'index' => [ ['crednum'], ['invnum'] ], }, + 'cust_credit_bill_pkg' => { + 'columns' => [ + 'creditbillpkgnum', 'serial', '', '', '', '', + 'creditbillnum', 'int', '', '', '', '', + 'billpkgnum', 'int', '', '', '', '', + 'amount', @money_type, '', '', + 'setuprecur', 'varchar', '', $char_d, '', '', + ], + 'primary_key' => 'creditbillpkgnum', + 'unique' => [], + 'index' => [ [ 'creditbillnum' ], [ 'billpkgnum' ], ], + }, + 'cust_main' => { 'columns' => [ 'custnum', 'serial', '', '', '', '', 'agentnum', 'int', '', '', '', '', + 'agent_custid', 'varchar', 'NULL', $char_d, '', '', # 'titlenum', 'int', 'NULL', '', '', '', 'last', 'varchar', '', $char_d, '', '', # 'middle', 'varchar', 'NULL', $char_d, '', '', @@ -442,7 +449,7 @@ sub tables_hashref { 'spool_cdr','char', 'NULL', 1, '', '', ], 'primary_key' => 'custnum', - 'unique' => [], + 'unique' => [ [ 'agentnum', 'agent_custid' ] ], #'index' => [ ['last'], ['company'] ], 'index' => [ ['last'], [ 'company' ], [ 'referral_custnum' ], [ 'daytime' ], [ 'night' ], [ 'fax' ], [ 'refnum' ], @@ -538,10 +545,49 @@ sub tables_hashref { 'index' => [ [ 'paynum' ], [ 'invnum' ] ], }, + 'cust_bill_pay_batch' => { + 'columns' => [ + 'billpaynum', 'serial', '', '', '', '', + 'invnum', 'int', '', '', '', '', + 'paybatchnum', 'int', '', '', '', '', + 'amount', @money_type, '', '', + '_date', @date_type, '', '', + ], + 'primary_key' => 'billpaynum', + 'unique' => [], + 'index' => [ [ 'paybatchnum' ], [ 'invnum' ] ], + }, + + 'cust_bill_pay_pkg' => { + 'columns' => [ + 'billpaypkgnum', 'serial', '', '', '', '', + 'billpaynum', 'int', '', '', '', '', + 'billpkgnum', 'int', '', '', '', '', + 'amount', @money_type, '', '', + 'setuprecur', 'varchar', '', $char_d, '', '', + ], + 'primary_key' => 'billpaypkgnum', + 'unique' => [], + 'index' => [ [ 'billpaynum' ], [ 'billpkgnum' ], ], + }, + + 'pay_batch' => { #batches of payments to an external processor + 'columns' => [ + 'batchnum', 'serial', '', '', '', '', + 'status', 'char', 'NULL', 1, '', '', + 'download', @date_type, '', '', + 'upload', @date_type, '', '', + ], + 'primary_key' => 'batchnum', + 'unique' => [], + 'index' => [], + }, + 'cust_pay_batch' => { #what's this used for again? list of customers #in current CARD batch? (necessarily CARD?) 'columns' => [ 'paybatchnum', 'serial', '', '', '', '', + 'batchnum', 'int', '', '', '', '', 'invnum', 'int', '', '', '', '', 'custnum', 'int', '', '', '', '', 'last', 'varchar', '', $char_d, '', '', @@ -553,15 +599,17 @@ sub tables_hashref { 'zip', 'varchar', 'NULL', 10, '', '', 'country', 'char', '', 2, '', '', # 'trancode', 'int', '', '', '', '' - 'cardnum', 'varchar', '', 16, '', '', + 'payby', 'char', '', 4, '', '', # CARD/BILL/COMP, should be + 'payinfo', 'varchar', '', 512, '', '', #'exp', @date_type, '', '' - 'exp', 'varchar', '', 11, '', '', + 'exp', 'varchar', 'NULL', 11, '', '', 'payname', 'varchar', 'NULL', $char_d, '', '', 'amount', @money_type, '', '', + 'status', 'varchar', 'NULL', $char_d, '', '', ], 'primary_key' => 'paybatchnum', 'unique' => [], - 'index' => [ ['invnum'], ['custnum'] ], + 'index' => [ ['batchnum'], ['invnum'], ['custnum'] ], }, 'cust_pkg' => { @@ -676,9 +724,10 @@ sub tables_hashref { 'part_referral' => { 'columns' => [ - 'refnum', 'serial', '', '', '', '', - 'referral', 'varchar', '', $char_d, '', '', - 'disabled', 'char', 'NULL', 1, '', '', + 'refnum', 'serial', '', '', '', '', + 'referral', 'varchar', '', $char_d, '', '', + 'disabled', 'char', 'NULL', 1, '', '', + 'agentnum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'refnum', 'unique' => [], @@ -1464,6 +1513,7 @@ sub tables_hashref { '_password', 'varchar', '', $char_d, '', '', 'last', 'varchar', '', $char_d, '', '', 'first', 'varchar', '', $char_d, '', '', + 'disabled', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'usernum', 'unique' => [ [ 'username' ] ], @@ -1526,6 +1576,18 @@ sub tables_hashref { 'index' => [], }, + 'svc_phone' => { + 'columns' => [ + 'svcnum', 'int', '', '', '', '', + 'countrycode', 'varchar', '', 3, '', '', + 'phonenum', 'varchar', '', 15, '', '', #12 ? + 'pin', 'varchar', 'NULL', $char_d, '', '', + ], + 'primary_key' => 'svcnum', + 'unique' => [], + 'index' => [ [ 'countrycode', 'phonenum' ] ], + }, + }; #'new_table' => {