X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=b3cce9a93a16981cc3b471847c1a889c1ebefcaa;hb=4c1394f92330b2fd21dc56c988d7fac05b18cd28;hp=33b3064249943a107bdfd262fc622744342b7308;hpb=20d7ca3a3e37b9748eed3f7ef362f04c757420ba;p=freeside.git diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 33b306424..b3cce9a93 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', @@ -500,8 +508,6 @@ sub tables_hashref { 'quantity', 'int', 'NULL', '', '', '', 'unitsetup', @money_typen, '', '', 'unitrecur', @money_typen, '', '', - 'duplicate', 'char', 'NULL', 1, '', '', # does this need to be in db? - 'post_total', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'billpkgnum', 'unique' => [], @@ -514,12 +520,30 @@ sub tables_hashref { 'billpkgnum', 'int', 'NULL', '', '', '', # should not be nullable 'pkgnum', 'int', 'NULL', '', '', '', # deprecated 'invnum', 'int', 'NULL', '', '', '', # deprecated + 'amount', @money_typen, '', '', 'format', 'char', 'NULL', 1, '', '', + 'classnum', 'char', 'NULL', 1, '', '', 'detail', 'varchar', '', $char_d, '', '', ], 'primary_key' => 'detailnum', 'unique' => [], - 'index' => [ [ 'billpkgnum' ], [ 'pkgnum', 'invnum' ] ], + 'index' => [ [ 'billpkgnum' ], [ 'classnum' ], [ 'pkgnum', 'invnum' ] ], + }, + + 'cust_bill_pkg_display' => { + 'columns' => [ + 'billpkgdisplaynum', 'serial', '', '', '', '', + 'billpkgnum', 'int', '', '', '', '', + 'section', 'varchar', 'NULL', $char_d, '', '', + #'unitsetup', @money_typen, '', '', #override the linked real one? + #'unitrecur', @money_typen, '', '', #this too? + 'post_total', 'char', 'NULL', 1, '', '', + 'type', 'char', 'NULL', 1, '', '', + 'summary', 'char', 'NULL', 1, '', '', + ], + 'primary_key' => 'billpkgdisplaynum', + 'unique' => [], + 'index' => [ ['billpkgnum'], ], }, 'cust_credit' => { @@ -571,6 +595,7 @@ sub tables_hashref { 'custnum', 'serial', '', '', '', '', 'agentnum', 'int', '', '', '', '', 'agent_custid', 'varchar', 'NULL', $char_d, '', '', + 'custbatch', 'varchar', 'NULL', $char_d, '', '', # 'titlenum', 'int', 'NULL', '', '', '', 'last', 'varchar', '', $char_d, '', '', # 'middle', 'varchar', 'NULL', $char_d, '', '', @@ -636,6 +661,7 @@ sub tables_hashref { [ 'ship_last' ], [ 'ship_company' ], [ 'ship_daytime' ], [ 'ship_night' ], [ 'ship_fax' ], [ 'payby' ], [ 'paydate' ], + [ 'agentnum' ], [ 'custbatch' ], ], }, @@ -940,6 +966,19 @@ sub tables_hashref { 'index' => [ [ 'pkgnum' ], [ 'optionname' ] ], }, + 'cust_pkg_detail' => { + 'columns' => [ + 'pkgdetailnum', 'serial', '', '', '', '', + 'pkgnum', 'int', '', '', '', '', + 'detail', 'varchar', '', $char_d, '', '', + 'detailtype', 'char', '', 1, '', '', # "I"nvoice or "C"omment + 'weight', 'int', '', '', '', '', + ], + 'primary_key' => 'pkgdetailnum', + 'unique' => [], + 'index' => [ [ 'pkgnum', 'detailtype' ] ], + }, + 'cust_pkg_reason' => { 'columns' => [ 'num', 'serial', '', '', '', '', @@ -951,7 +990,7 @@ sub tables_hashref { ], 'primary_key' => 'num', 'unique' => [], - 'index' => [], + 'index' => [ [ 'pkgnum' ], [ 'reasonnum' ], ['action'], ], }, 'cust_refund' => { @@ -1001,6 +1040,18 @@ sub tables_hashref { 'index' => [ ['svcnum'], ['pkgnum'], ['svcpart'] ], }, + 'cust_svc_option' => { + 'columns' => [ + 'optionnum', 'serial', '', '', '', '', + 'svcnum', 'int', '', '', '', '', + 'optionname', 'varchar', '', $char_d, '', '', + 'optionvalue', 'text', 'NULL', '', '', '', + ], + 'primary_key' => 'optionnum', + 'unique' => [], + 'index' => [ [ 'svcnum' ], [ 'optionname' ] ], + }, + 'part_pkg' => { 'columns' => [ 'pkgpart', 'serial', '', '', '', '', @@ -1089,6 +1140,7 @@ sub tables_hashref { 'taxoverridenum', 'serial', '', '', '', '', 'pkgpart', 'serial', '', '', '', '', 'taxclassnum', 'serial', '', '', '', '', + 'usage_class', 'varchar', 'NULL', $char_d, '', '', ], 'primary_key' => 'taxoverridenum', 'unique' => [], @@ -1657,6 +1709,7 @@ sub tables_hashref { 'min_charge', 'decimal', '', '10,5', '', '', 'sec_granularity', 'int', '', '', '', '', #time period (link to table of periods)? + 'classnum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'ratedetailnum', 'unique' => [ [ 'ratenum', 'orig_regionnum', 'dest_regionnum' ] ], @@ -1686,6 +1739,17 @@ sub tables_hashref { 'index' => [ [ 'countrycode' ], [ 'regionnum' ] ], }, + 'usage_class' => { + 'columns' => [ + 'classnum', 'serial', '', '', '', '', + 'classname', 'varchar', '', $char_d, '', '', + 'disabled', 'char', 'NULL', 1, '', '', + ], + 'primary_key' => 'classnum', + 'unique' => [], + 'index' => [ ['disabled'] ], + }, + 'reg_code' => { 'columns' => [ 'codenum', 'serial', '', '', '', '', @@ -1891,10 +1955,12 @@ sub tables_hashref { #NULL, done (or something) 'freesidestatus', 'varchar', 'NULL', 32, '', '', + 'cdrbatch', 'varchar', 'NULL', $char_d, '', '', + ], 'primary_key' => 'acctid', 'unique' => [], - 'index' => [ [ 'calldate' ], [ 'dst' ], [ 'accountcode' ], [ 'freesidestatus' ] ], + 'index' => [ [ 'calldate' ], [ 'dst' ], [ 'accountcode' ], [ 'freesidestatus' ], [ 'cdrbatch' ], ], }, 'cdr_calltype' => { @@ -2054,10 +2120,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' => {