X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=3a27b741bf1a464d9165ec2da7cbfd04b0cb4c77;hp=c2d4f31e5c187ce49be6f2b9004ea7e7f2940a4e;hb=ec271a1445bf232cd172c38e2dd3fd9d3c5c7c4e;hpb=9ad0574bb99869836af00800423af7249721c1d1 diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index c2d4f31e5..3a27b741b 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -194,8 +194,10 @@ sub dbdef_dist { grep { ! /^clientapi_session/ && ! /^h_/ && ! /^log(_context)?$/ - && ( ! /^queue(_arg)?$/ || ! $opt->{'queue-no_history'} ) + && ! /^legacy_cust_history$/ + && ( ! /^queue(_arg|_depend|_stat)?$/ || ! $opt->{'queue-no_history'} ) && ! $tables_hashref_torrus->{$_} + && ! /^cacti_page$/ } $dbdef->tables ) { @@ -636,6 +638,22 @@ sub tables_hashref { 'index' => [ ['legacyid', 'custnum', 'locale' ], ], }, + 'legacy_cust_history' => { + 'columns' => [ + 'legacyhistorynum', 'serial', '', '', '', '', + 'custnum', 'int', '', '', '', '', + 'history_action', 'varchar', '', $char_d, '', '', + 'history_date', @date_type, '', '', + 'history_usernum', 'int', 'NULL', '', '', '', + 'item', 'varchar', 'NULL', $char_d, '', '', + 'description', 'varchar', 'NULL', 2*$char_d, '', '', + 'change_data', 'text', 'NULL', '', '', '', + ], + 'primary_key' => 'legacyhistorynum', + 'unique' => [], + 'index' => [ ['custnum'], ['history_date'], ], + }, + 'cust_statement' => { 'columns' => [ 'statementnum', 'serial', '', '', '', '', @@ -812,7 +830,7 @@ sub tables_hashref { 'classnum', 'int', 'NULL', '', '', '', 'duration', 'int', 'NULL', '', 0, '', 'phonenum', 'varchar', 'NULL', 25, '', '', - 'accountcode', 'varchar', 'NULL', 20, '', '', + 'accountcode', 'varchar', 'NULL', 32, '', '', 'startdate', @date_type, '', '', 'regionname', 'varchar', 'NULL', $char_d, '', '', 'detail', 'varchar', '', 255, '', '', @@ -854,6 +872,23 @@ sub tables_hashref { ], }, + 'cust_bill_pkg_fee_void' => { + 'columns' => [ + 'billpkgfeenum', 'serial', '', '', '', '', + 'billpkgnum', 'int', '', '', '', '', + 'base_invnum', 'int', '', '', '', '', + 'base_billpkgnum', 'int', 'NULL', '', '', '', + 'amount', @money_type, '', '', + ], + 'primary_key' => 'billpkgfeenum', + 'unique' => [], + 'index' => [ ['billpkgnum'], + ['base_invnum'], + ['base_billpkgnum'], + ], + }, + + 'cust_bill_pkg_tax_location' => { 'columns' => [ 'billpkgtaxlocationnum', 'serial', '', '', '', '', @@ -885,6 +920,7 @@ sub tables_hashref { 'taxratelocationnum', 'int', '', '', '', '', 'amount', @money_type, '', '', 'taxable_billpkgnum', 'int', 'NULL', '', '', '', + 'taxclass', 'varchar', 'NULL', 10, '', '', ], 'primary_key' => 'billpkgtaxratelocationnum', 'unique' => [], @@ -910,6 +946,7 @@ sub tables_hashref { 'unitsetup', @money_typen, '', '', 'unitrecur', @money_typen, '', '', 'hidden', 'char', 'NULL', 1, '', '', + 'feepart', 'int', 'NULL', '', '', '', #void fields 'void_date', @date_type, '', '', 'reason', 'varchar', 'NULL', $char_d, '', '', @@ -931,7 +968,7 @@ sub tables_hashref { 'classnum', 'int', 'NULL', '', '', '', 'duration', 'int', 'NULL', '', 0, '', 'phonenum', 'varchar', 'NULL', 25, '', '', - 'accountcode', 'varchar', 'NULL', 20, '', '', + 'accountcode', 'varchar', 'NULL', 32, '', '', 'startdate', @date_type, '', '', 'regionname', 'varchar', 'NULL', $char_d, '', '', 'detail', 'varchar', '', 255, '', '', @@ -1035,6 +1072,7 @@ sub tables_hashref { #void fields 'void_date', @date_type, '', '', 'void_reason', 'varchar', 'NULL', $char_d, '', '', + 'void_reasonnum', 'int', 'NULL', '', '', '', 'void_usernum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'crednum', @@ -1178,6 +1216,7 @@ sub tables_hashref { 'message_noemail', 'char', 'NULL', 1, '', '', 'bill_locationnum', 'int', 'NULL', '', '', '', 'ship_locationnum', 'int', 'NULL', '', '', '', + 'invoice_ship_address', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'custnum', 'unique' => [ [ 'agentnum', 'agent_custid' ] ], @@ -1322,7 +1361,7 @@ sub tables_hashref { ], 'primary_key' => 'quotationnum', 'unique' => [], - 'index' => [ [ 'prospectnum' ], ['custnum'], ], + 'index' => [ [ 'prospectnum' ], ['custnum'], ['disabled'], ], }, 'quotation_pkg' => { @@ -1336,6 +1375,8 @@ sub tables_hashref { 'contract_end', @date_type, '', '', 'quantity', 'int', 'NULL', '', '', '', 'waive_setup', 'char', 'NULL', 1, '', '', + 'unitsetup', @money_typen, '', '', + 'unitrecur', @money_typen, '', '', ], 'primary_key' => 'quotationpkgnum', 'unique' => [], @@ -1347,6 +1388,8 @@ sub tables_hashref { 'quotationpkgdiscountnum', 'serial', '', '', '', '', 'quotationpkgnum', 'int', '', '', '', '', 'discountnum', 'int', '', '', '', '', + 'setup_amount', @money_typen, '', '', + 'recur_amount', @money_typen, '', '', #'end_date', @date_type, '', '', ], 'primary_key' => 'quotationpkgdiscountnum', @@ -1354,6 +1397,21 @@ sub tables_hashref { 'index' => [ [ 'quotationpkgnum' ], ], #[ 'discountnum' ] ], }, + 'quotation_pkg_tax' => { + 'columns' => [ + 'quotationtaxnum', 'serial', '', '', '', '', + 'quotationpkgnum', 'int', '', '', '', '', + 'itemdesc', 'varchar', '', $char_d, '', '', + 'taxnum', 'int', '', '', '', '', + 'taxtype', 'varchar', '', $char_d, '', '', + 'setup_amount', @money_type, '', '', + 'recur_amount', @money_type, '', '', + ], + 'primary_key' => 'quotationtaxnum',, + 'unique' => [], + 'index' => [ [ 'quotationpkgnum' ] ], + }, + 'cust_location' => { #'location' now that its prospects too, but... 'columns' => [ 'locationnum', 'serial', '', '', '', '', @@ -1416,13 +1474,14 @@ sub tables_hashref { 'cust_main_note' => { 'columns' => [ - 'notenum', 'serial', '', '', '', '', - 'custnum', 'int', '', '', '', '', - 'classnum', 'int', 'NULL', '', '', '', - '_date', @date_type, '', '', - 'otaker', 'varchar', 'NULL', 32, '', '', - 'usernum', 'int', 'NULL', '', '', '', - 'comments', 'text', 'NULL', '', '', '', + 'notenum', 'serial', '', '', '', '', + 'custnum', 'int', '', '', '', '', + 'classnum', 'int', 'NULL', '', '', '', + '_date', @date_type, '', '', + 'otaker', 'varchar', 'NULL', 32, '', '', + 'usernum', 'int', 'NULL', '', '', '', + 'comments', 'text', 'NULL', '', '', '', + 'sticky', 'int', '', '', 0, '', ], 'primary_key' => 'notenum', 'unique' => [], @@ -1792,6 +1851,7 @@ sub tables_hashref { 'download', @date_type, '', '', 'upload', @date_type, '', '', 'title', 'varchar', 'NULL',255, '', '', + 'processor_id', 'varchar', 'NULL',255, '', '', ], 'primary_key' => 'batchnum', 'unique' => [], @@ -1877,6 +1937,7 @@ sub tables_hashref { 'recur_show_zero', 'char', 'NULL', 1, '', '', 'setup_show_zero', 'char', 'NULL', 1, '', '', 'change_to_pkgnum', 'int', 'NULL', '', '', '', + 'separate_bill', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'pkgnum', 'unique' => [], @@ -1911,11 +1972,11 @@ sub tables_hashref { 'cust_pkg_detail' => { 'columns' => [ - 'pkgdetailnum', 'serial', '', '', '', '', - 'pkgnum', 'int', '', '', '', '', - 'detail', 'varchar', '', $char_d, '', '', - 'detailtype', 'char', '', 1, '', '', # "I"nvoice or "C"omment - 'weight', 'int', '', '', '', '', + 'pkgdetailnum', 'serial', '', '', '', '', + 'pkgnum', 'int', '', '', '', '', + 'detail', 'varchar', '', 2*$char_d, '', '', + 'detailtype', 'char', '', 1, '', '', #"I"nvoice or "C"omment + 'weight', 'int', '', '', '', '', ], 'primary_key' => 'pkgdetailnum', 'unique' => [], @@ -1937,6 +1998,19 @@ sub tables_hashref { 'index' => [ [ 'pkgnum' ], [ 'reasonnum' ], ['action'], [ 'usernum' ], ], }, + 'cust_pkg_reason_fee' => { + 'columns' => [ + 'pkgreasonfeenum', 'serial', '', '', '', '', + 'pkgreasonnum', 'int', '', '', '', '', + 'billpkgnum', 'int', 'NULL', '', '', '', + 'feepart', 'int', '', '', '', '', + 'nextbill', 'char', 'NULL', 1, '', '', + ], + 'primary_key' => 'pkgreasonfeenum', + 'unique' => [ [ 'billpkgnum' ], [ 'pkgreasonnum' ] ], # one-to-one link + 'index' => [ [ 'feepart' ] ], + }, + 'cust_pkg_discount' => { 'columns' => [ 'pkgdiscountnum', 'serial', '', '', '', '', @@ -2126,6 +2200,7 @@ sub tables_hashref { 'part_pkg' => { 'columns' => [ 'pkgpart', 'serial', '', '', '', '', + 'pkgpartbatch', 'varchar', 'NULL', $char_d, '', '', 'pkg', 'varchar', '', $char_d, '', '', 'comment', 'varchar', 'NULL', 2*$char_d, '', '', 'promo_code', 'varchar', 'NULL', $char_d, '', '', @@ -2372,6 +2447,7 @@ sub tables_hashref { 'columnlabel', 'varchar', 'NULL', $char_d, '', '', 'columnvalue', 'varchar', 'NULL', 512, '', '', 'columnflag', 'char', 'NULL', 1, '', '', + 'required', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'columnnum', 'unique' => [ [ 'svcpart', 'columnname' ] ], @@ -3051,6 +3127,7 @@ sub tables_hashref { #'custnum', 'int', '', '', '', '' 'billpkgnum', 'int', '', '', '', '', 'taxnum', 'int', '', '', '', '', + 'taxtype', 'varchar', 'NULL', $char_d, '', '', 'year', 'int', 'NULL', '', '', '', 'month', 'int', 'NULL', '', '', '', 'creditbillpkgnum', 'int', 'NULL', '', '', '', @@ -3066,7 +3143,7 @@ sub tables_hashref { 'unique' => [], 'index' => [ [ 'taxnum', 'year', 'month' ], [ 'billpkgnum' ], - [ 'taxnum' ], + [ 'taxnum', 'taxtype' ], [ 'creditbillpkgnum' ], ], }, @@ -3077,6 +3154,7 @@ sub tables_hashref { #'custnum', 'int', '', '', '', '' 'billpkgnum', 'int', '', '', '', '', 'taxnum', 'int', '', '', '', '', + 'taxtype', 'varchar', 'NULL', $char_d, '', '', 'year', 'int', 'NULL', '', '', '', 'month', 'int', 'NULL', '', '', '', 'creditbillpkgnum', 'int', 'NULL', '', '', '', @@ -3092,7 +3170,7 @@ sub tables_hashref { 'unique' => [], 'index' => [ [ 'taxnum', 'year', 'month' ], [ 'billpkgnum' ], - [ 'taxnum' ], + [ 'taxnum', 'taxtype' ], [ 'creditbillpkgnum' ], ], }, @@ -3659,7 +3737,7 @@ sub tables_hashref { 'billsec', 'int', '', '', 0, '', 'disposition', 'varchar', '', 45, \"''", '', 'amaflags', 'int', '', '', 0, '', - 'accountcode', 'varchar', '', 20, \"''", '', + 'accountcode', 'varchar', '', 32, \"''", '', 'uniqueid', 'varchar', '', $char_d, \"''", '', 'userfield', 'varchar', '', 512, \"''", '', @@ -3948,11 +4026,6 @@ sub tables_hashref { 'primary_key' => 'itemnum', 'unique' => [ [ 'usernum' ] ], 'index' => [], - 'foreign_keys' => [ - { columns => [ 'usernum' ], - table => 'access_user', - }, - ], }, #'sched_item_class' @@ -3969,11 +4042,6 @@ sub tables_hashref { 'primary_key' => 'availnum', 'unique' => [], 'index' => [], - 'foreign_keys' => [ - { columns => [ 'itemnum' ], - table => 'sched_item', - }, - ], }, 'svc_phone' => { @@ -4004,6 +4072,7 @@ sub tables_hashref { 'e911_class', 'char', 'NULL', 1, '', '', 'e911_type', 'char', 'NULL', 1, '', '', 'circuit_svcnum', 'int', 'NULL', '', '', '', + 'sip_server', 'varchar', 'NULL', $char_d, '', '', ], 'primary_key' => 'svcnum', 'unique' => [ [ 'sms_carrierid', 'sms_account'] ], @@ -4157,6 +4226,9 @@ sub tables_hashref { 'unsuspend_pkgpart', 'int', 'NULL', '', '', '', 'unsuspend_hold','char', 'NULL', 1, '', '', 'unused_credit', 'char', 'NULL', 1, '', '', + 'feepart', 'int', 'NULL', '', '', '', + 'fee_on_unsuspend','char', 'NULL', 1, '', '', + 'fee_hold', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'reasonnum', 'unique' => [], @@ -4214,15 +4286,6 @@ sub tables_hashref { 'primary_key' => 'extensionnum', 'unique' => [ [ 'svcnum', 'extension' ] ], 'index' => [ [ 'svcnum' ] ], - 'foreign_keys' => [ - { columns => [ 'svcnum' ], - table => 'svc_pbx', - }, - { columns => [ 'circuit_svcnum' ], - table => 'svc_circuit', - references => [ 'svcnum' ], - }, - ], }, 'svc_mailinglist' => { #svc_group? @@ -4595,20 +4658,6 @@ sub tables_hashref { 'primary_key' => 'svcnum', 'unique' => [], 'index' => [ [ 'providernum' ], [ 'typenum' ] ], - 'foreign_keys' => [ - { columns => [ 'svcnum' ], - table => 'cust_svc', - }, - { columns => [ 'typenum' ], - table => 'circuit_type', - }, - { columns => [ 'providernum' ], - table => 'circuit_provider', - }, - { columns => [ 'termnum' ], - table => 'circuit_termination', - }, - ], }, %{ tables_hashref_torrus() }, @@ -4681,12 +4730,6 @@ sub tables_hashref { 'primary_key' => 'batchnum', 'unique' => [], 'index' => [ [ 'exportnum' ], [ 'status' ] ], - 'foreign_keys' => [ - { columns => [ 'exportnum' ], - table => 'part_export', - references => [ 'exportnum' ] - }, - ], }, 'export_batch_item' => { @@ -4701,12 +4744,6 @@ sub tables_hashref { 'primary_key' => 'itemnum', 'unique' => [], 'index' => [ [ 'batchnum' ], [ 'svcnum' ] ], - 'foreign_keys' => [ - { columns => [ 'batchnum' ], - table => 'export_batch', - references => [ 'batchnum' ] - }, - ], }, # lookup table for states, similar to msa and lata @@ -4746,12 +4783,6 @@ sub tables_hashref { 'primary_key' => 'zonenum', 'unique' => [], 'index' => [ [ 'agentnum' ] ], - 'foreign_keys' => [ - { columns => [ 'agentnum' ], - table => 'agent', - references => [ 'agentnum' ], - }, - ], }, 'deploy_zone_block' => { @@ -4764,12 +4795,6 @@ sub tables_hashref { 'primary_key' => 'blocknum', 'unique' => [], 'index' => [ [ 'zonenum' ] ], - 'foreign_keys' => [ - { columns => [ 'zonenum' ], - table => 'deploy_zone', - references => [ 'zonenum' ], - }, - ], }, 'deploy_zone_vertex' => { @@ -4782,17 +4807,21 @@ sub tables_hashref { 'primary_key' => 'vertexnum', 'unique' => [ ], 'index' => [ ], - 'foreign_keys' => [ - { columns => [ 'zonenum' ], - table => 'deploy_zone', - references => [ 'zonenum' ], - }, - ], }, - - - + 'cacti_page' => { + 'columns' => [ + 'cacti_pagenum', 'serial', '', '', '', '', + 'exportnum', 'int', 'NULL', '', '', '', + 'svcnum', 'int', 'NULL', '', '', '', + 'graphnum', 'int', 'NULL', '', '', '', + 'imported', @date_type, '', '', + 'content', 'text', 'NULL', '', '', '', + ], + 'primary_key' => 'cacti_pagenum', + 'unique' => [ ], + 'index' => [ ['svcnum'], ['imported'] ], + }, # name type nullability length default local