X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=941eafc7fe4be0abe3f4a6010cf6a7ac982247e1;hb=bd4151f99f8a2249977e65947cc8762ec50166e2;hp=d354561e53874b5f4c2789a07766e2fae4cc8355;hpb=44b5d849d7fb3af5ea1e2812097126633add0fd4;p=freeside.git diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index d354561e5..941eafc7f 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -200,6 +200,14 @@ sub dbdef_dist { ], }); + $h_indices{"h_${table}_srckey2"} = DBIx::DBSchema::Index->new({ + 'name' => "h_${table}_srckey2", + 'unique' => 0, + 'columns' => [ 'history_date', + $tableobj->primary_key, + ], + }); + my $h_tableobj = DBIx::DBSchema::Table->new( { 'name' => "h_$table", 'primary_key' => 'historynum', @@ -324,17 +332,17 @@ sub tables_hashref { 'agentnum', 'serial', '', '', '', '', 'agent', 'varchar', '', $char_d, '', '', 'typenum', 'int', '', '', '', '', - 'disabled', 'char', 'NULL', 1, '', '', 'ticketing_queueid', 'int', 'NULL', '', '', '', 'invoice_template', 'varchar', 'NULL', $char_d, '', '', + 'agent_custnum', 'int', 'NULL', '', '', '', + 'disabled', 'char', 'NULL', 1, '', '', 'username', 'varchar', 'NULL', $char_d, '', '', #deprecated '_password', 'varchar', 'NULL', $char_d, '', '', #deprecated 'freq', 'int', 'NULL', '', '', '', #deprecated (never used) 'prog', @perl_type, '', '', #deprecated (never used) - ], 'primary_key' => 'agentnum', - 'unique' => [], + 'unique' => [ [ 'agent_custnum' ] ], #one agent per customer? 'index' => [ ['typenum'], ['disabled'] ], }, @@ -519,42 +527,25 @@ sub tables_hashref { ], 'primary_key' => 'detailnum', 'unique' => [], - 'index' => [ [ 'billpkgnum' ], [ 'pkgnum', 'invnum' ] ], + 'index' => [ [ 'billpkgnum' ], [ 'classnum' ], [ 'pkgnum', 'invnum' ] ], }, - #instead of 'duplicate', 'char', 'NULL', 1, '', '', - # that way we keep display vs *TOTALLY* out of the table for actual - # finanancial line items 'cust_bill_pkg_display' => { 'columns' => [ 'billpkgdisplaynum', 'serial', '', '', '', '', 'billpkgnum', 'int', '', '', '', '', 'section', 'varchar', 'NULL', $char_d, '', '', - #override the linked real one?#'unitsetup', @money_typen, '', '', - #this too?#'unitrecur', @money_typen, '', '', + #'unitsetup', @money_typen, '', '', #override the linked real one? + #'unitrecur', @money_typen, '', '', #this too? 'post_total', 'char', 'NULL', 1, '', '', 'type', 'char', 'NULL', 1, '', '', - #any other fields we need to control this display-only line item... + 'summary', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'billpkgdisplaynum', 'unique' => [], 'index' => [ ['billpkgnum'], ], }, - #and this, to break down a line item into slices for taxation purposes - #(instead of creating usage line items for each usage class) - 'cust_bill_pkg_slice' => { - 'columns' => [ - 'slicenum', 'serial', '', '', '', '', - 'billpkgnum', 'int', '', '', '', '', - 'amount', @money_typen, '', '', - 'classnum', 'int', '', '', '', '', - ], - 'primary_key' => 'slicenum', - 'unique' => [], - 'index' => [ [ 'billpkgnum' ], [ 'classnum' ], ], - }, - 'cust_credit' => { 'columns' => [ 'crednum', 'serial', '', '', '', '', @@ -614,6 +605,7 @@ sub tables_hashref { 'stateid_state', 'varchar', 'NULL', $char_d, '', '', 'birthdate' ,@date_type, '', '', 'signupdate',@date_type, '', '', + 'dundate', @date_type, '', '', 'company', 'varchar', 'NULL', $char_d, '', '', 'address1', 'varchar', '', $char_d, '', '', 'address2', 'varchar', 'NULL', $char_d, '', '', @@ -1594,6 +1586,7 @@ sub tables_hashref { 'ip_gateway', 'varchar', '', 15, '', '', 'ip_netmask', 'int', '', '', '', '', 'agentnum', 'int', 'NULL', '', '', '', + 'manual_flag', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'blocknum', 'unique' => [ [ 'blocknum', 'routernum' ] ], @@ -2129,10 +2122,19 @@ sub tables_hashref { 'state', 'char', 'NULL', 2, '', '', 'npa', 'char', '', 3, '', '', 'nxx', 'char', 'NULL', 3, '', '', + 'station', 'char', 'NULL', 4, '', '', + 'svcnum', 'int', 'NULL', '', '', '', + 'availbatch', 'varchar', 'NULL', $char_d, '', '', ], 'primary_key' => 'availnum', 'unique' => [], - 'index' => [ [ 'exportnum', 'countrycode', 'state' ] ], + 'index' => [ [ 'exportnum', 'countrycode', 'state' ], #npa search + [ 'exportnum', 'countrycode', 'npa' ], #nxx search + [ 'exportnum', 'countrycode', 'npa', 'nxx' ],#station search + [ 'exportnum', 'countrycode', 'npa', 'nxx', 'station' ], # # + [ 'svcnum' ], + [ 'availbatch' ], + ], }, 'reason_type' => {