X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=0e41b1afe6f5e4386d7607b3b0794027cf2e55ca;hp=2cb942524db55fd1dc1ff2c3ac62650f19f7bc7c;hb=7a33cb6e4c3e33b7399d6574cbd3ee38ddcba5e0;hpb=cc40b7d77271966a6922317774f63f8fa86d0871 diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 2cb942524..0e41b1afe 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -203,6 +203,7 @@ sub dbdef_dist { && ! /^log(_context)?$/ && ! /^(legacy_cust_history|cacti_page|template_image|access_user_log)$/ && ( ! /^queue(_arg|_depend|_stat)?$/ || ! $opt->{'queue-no_history'} ) + && ! /^addr_status$/ && ! $tables_hashref_torrus->{$_} } $dbdef->tables @@ -923,12 +924,13 @@ sub tables_hashref { '_date', @date_type, '', '', 'status', 'varchar', '', $char_d, '', '', 'statustext', 'text', 'NULL', '', '', '', + 'no_action', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'eventnum', #no... there are retries now #'unique' => [ [ 'eventpart', 'invnum' ] ], 'unique' => [], 'index' => [ ['eventpart'], ['tablenum'], ['status'], - ['statustext'], ['_date'], + ['statustext'], ['_date'], ['no_action'], ], 'foreign_keys' => [ { columns => [ 'eventpart' ], @@ -1360,6 +1362,7 @@ sub tables_hashref { 'commission_agentnum', 'int', 'NULL', '', '', '', # 'commission_salesnum', 'int', 'NULL', '', '', '', # 'commission_pkgnum', 'int', 'NULL', '', '', '', # + 'commission_invnum', 'int', 'NULL', '', '', '', 'credbatch', 'varchar', 'NULL', $char_d, '', '', ], 'primary_key' => 'crednum', @@ -1395,6 +1398,10 @@ sub tables_hashref { table => 'cust_pkg', references => [ 'pkgnum' ], }, + { columns => [ 'commission_invnum' ], + table => 'cust_bill', + references => [ 'invnum' ], + }, ], }, @@ -1416,6 +1423,7 @@ sub tables_hashref { 'commission_agentnum', 'int', 'NULL', '', '', '', 'commission_salesnum', 'int', 'NULL', '', '', '', 'commission_pkgnum', 'int', 'NULL', '', '', '', + 'commission_invnum', 'int', 'NULL', '', '', '', #void fields 'void_date', @date_type, '', '', 'void_reason', 'varchar', 'NULL', $char_d, '', '', @@ -1455,6 +1463,10 @@ sub tables_hashref { table => 'cust_pkg', references => [ 'pkgnum' ], }, + { columns => [ 'commission_invnum' ], + table => 'cust_bill', + references => [ 'invnum' ], + }, { columns => [ 'void_reasonnum' ], table => 'reason', references => [ 'reasonnum' ], @@ -1629,6 +1641,7 @@ sub tables_hashref { 'accountcode_cdr', 'char', 'NULL', 1, '', '', 'billday', 'int', 'NULL', '', '', '', 'prorate_day', 'int', 'NULL', '', '', '', + 'force_prorate_day', 'char', 'NULL', 1, '', '', 'edit_subject', 'char', 'NULL', 1, '', '', 'locale', 'varchar', 'NULL', 16, '', '', 'calling_list_exempt', 'char', 'NULL', 1, '', '', @@ -1692,7 +1705,7 @@ sub tables_hashref { 'weight', 'int', 'NULL', '', '', '', 'payby', 'char', '', 4, '', '', 'payinfo', 'varchar', 'NULL', 512, '', '', - 'cardtype', 'varchar', 'NULL', $char_d, '', '', + 'paycardtype', 'varchar', 'NULL', $char_d, '', '', 'paycvv', 'varchar', 'NULL', 512, '', '', 'paymask', 'varchar', 'NULL', $char_d, '', '', #'paydate', @date_type, '', '', @@ -2038,9 +2051,12 @@ sub tables_hashref { 'district', 'varchar', 'NULL', 20, '', '', 'censustract', 'varchar', 'NULL', 20, '', '', 'censusyear', 'char', 'NULL', 4, '', '', + + #used only in... DSL qualification? .CA DSL qualification? 'location_type', 'varchar', 'NULL', 20, '', '', 'location_number', 'varchar', 'NULL', 20, '', '', 'location_kind', 'char', 'NULL', 1, '', '', + 'incorporated', 'char', 'NULL', 1, '', '', 'disabled', 'char', 'NULL', 1, '', '', ], @@ -2375,7 +2391,7 @@ sub tables_hashref { 'cust_pay_pending' => { 'columns' => [ 'paypendingnum', 'serial', '', '', '', '', - 'custnum', 'int', '', '', '', '', + 'custnum', 'int', 'NULL', '', '', '', 'paid', @money_type, '', '', 'currency', 'char', 'NULL', 3, '', '', '_date', @date_type, '', '', @@ -2442,6 +2458,7 @@ sub tables_hashref { 'usernum', 'int', 'NULL', '', '', '', 'payby', 'char', '', 4, '', '', 'payinfo', 'varchar', 'NULL', 512, '', '', + 'paycardtype', 'varchar', 'NULL', $char_d, '', '', 'paymask', 'varchar', 'NULL', $char_d, '', '', 'paydate', 'varchar', 'NULL', 10, '', '', 'paybatch', 'varchar', 'NULL', $char_d, '', '',#for auditing purposes @@ -2462,7 +2479,7 @@ sub tables_hashref { 'gatewaynum', 'int', 'NULL', '', '', '', # payment_gateway FK 'processor', 'varchar', 'NULL', $char_d, '', '', # module name 'auth', 'varchar', 'NULL', 16, '', '', # CC auth number - 'order_number','varchar', 'NULL', $char_d, '', '', # transaction number + 'order_number','varchar', 'NULL', 256, '', '', # transaction number ], 'primary_key' => 'paynum', #i guess not now, with cust_pay_pending, if we actually make it here, we _do_ want to record it# 'unique' => [ [ 'payunique' ] ], @@ -2499,7 +2516,8 @@ sub tables_hashref { 'usernum', 'int', 'NULL', '', '', '', 'payby', 'char', '', 4, '', '', 'payinfo', 'varchar', 'NULL', 512, '', '', - 'paymask', 'varchar', 'NULL', $char_d, '', '', + 'paycardtype', 'varchar', 'NULL', $char_d, '', '', + 'paymask', 'varchar', 'NULL', $char_d, '', '', #'paydate' ? 'paybatch', 'varchar', 'NULL', $char_d, '', '', #for auditing purposes. 'closed', 'char', 'NULL', 1, '', '', @@ -2516,7 +2534,7 @@ sub tables_hashref { 'gatewaynum', 'int', 'NULL', '', '', '', # payment_gateway FK 'processor', 'varchar', 'NULL', $char_d, '', '', # module name 'auth', 'varchar', 'NULL', 16, '', '', # CC auth number - 'order_number','varchar', 'NULL', $char_d, '', '', # transaction number + 'order_number','varchar', 'NULL', 256, '', '', # transaction number #void fields 'void_date', @date_type, '', '', @@ -3058,7 +3076,8 @@ sub tables_hashref { # be index into payby # table eventually 'payinfo', 'varchar', 'NULL', 512, '', '', #see cust_main above - 'paymask', 'varchar', 'NULL', $char_d, '', '', + 'paycardtype', 'varchar', 'NULL', $char_d, '', '', + 'paymask', 'varchar', 'NULL', $char_d, '', '', 'paybatch', 'varchar', 'NULL', $char_d, '', '', 'closed', 'char', 'NULL', 1, '', '', 'source_paynum', 'int', 'NULL', '', '', '', # link to cust_payby, to prevent unapply of gateway-generated refunds @@ -3229,6 +3248,7 @@ sub tables_hashref { 'adjourn_months', 'int', 'NULL', '', '', '', 'contract_end_months','int','NULL', '', '', '', 'change_to_pkgpart', 'int', 'NULL', '', '', '', + 'units_taxproductnum','int','NULL', '', '', '', ], 'primary_key' => 'pkgpart', 'unique' => [], @@ -3246,6 +3266,10 @@ sub tables_hashref { { columns => [ 'taxproductnum' ], table => 'part_pkg_taxproduct', }, + { columns => [ 'units_taxproductnum' ], + table => 'part_pkg_taxproduct', + references => [ 'taxproductnum' ], + }, { columns => [ 'agentnum' ], table => 'agent', }, @@ -3590,10 +3614,11 @@ sub tables_hashref { 'refnum', 'serial', '', '', '', '', 'referral', 'varchar', '', $char_d, '', '', 'disabled', 'char', 'NULL', 1, '', '', - 'agentnum', 'int', 'NULL', '', '', '', + 'agentnum', 'int', 'NULL', '', '', '', + 'title', 'varchar', 'NULL', $char_d, '', '', ], 'primary_key' => 'refnum', - 'unique' => [], + 'unique' => [ ['agentnum', 'title'] ], 'index' => [ ['disabled'], ['agentnum'], ], 'foreign_keys' => [ { columns => [ 'agentnum' ], @@ -3680,6 +3705,24 @@ sub tables_hashref { ], }, + 'part_svc_msgcat' => { + 'columns' => [ + 'svcpartmsgnum', 'serial', '', '', '', '', + 'svcpart', 'int', '', '', '', '', + 'locale', 'varchar', '', 16, '', '', + 'svc', 'varchar', '', $char_d, '', '', + ], + 'primary_key' => 'svcpartmsgnum', + 'unique' => [ [ 'svcpart', 'locale' ] ], + 'index' => [], + 'foreign_keys' => [ + { columns => [ 'svcpart' ], + table => 'part_svc', + }, + ], + }, + + #(this should be renamed to part_pop) 'svc_acct_pop' => { 'columns' => [ @@ -3868,9 +3911,12 @@ sub tables_hashref { 'unique' => [], 'index' => [ ['svcnum', 'transaction_id'] ], 'foreign_keys' => [ - { columns => [ 'svcnum' ], - table => 'svc_acct', #'cust_svc', - }, + # problems w/deleted services, and as per below, this + # is our internal hack, not a customer-facing feature + #{ columns => [ 'svcnum' ], + # table => 'svc_acct', #'cust_svc', + #}, + # 1. RT tables aren't part of our data structure, so # we can't make sure Queue is created already # 2. This is our internal hack for time tracking, not @@ -4099,6 +4145,7 @@ sub tables_hashref { 'classnum', 'int', '', '', '', '', 'model', 'varchar', '', $char_d, '', '', 'revision','varchar', 'NULL', $char_d, '', '', + 'title', 'varchar', 'NULL', $char_d, '', '', # external id ], 'primary_key' => 'typenum', 'unique' => [ [ 'classnum', 'model', 'revision' ] ], @@ -4843,9 +4890,23 @@ sub tables_hashref { 'freq_mhz', 'int', 'NULL', '', '', '', 'direction', 'int', 'NULL', '', '', '', 'width', 'int', 'NULL', '', '', '', - #downtilt etc? rfpath has profile files for devices/antennas you upload? 'sector_range', 'decimal', 'NULL', '', '', '', #? - ], + 'downtilt', 'decimal', 'NULL', '', '', '', + 'v_width', 'int', 'NULL', '', '', '', + 'power', 'decimal', 'NULL', '', '', '', + 'line_loss', 'decimal', 'NULL', '', '', '', + 'antenna_gain', 'decimal', 'NULL', '', '', '', + 'hardware_typenum', 'int', 'NULL', '', '', '', + 'db_high', 'int', 'NULL', '', '', '', + 'db_low', 'int', 'NULL', '', '', '', + 'image', 'blob', 'NULL', '', '', '', + 'west', 'decimal', 'NULL', '10,7', '', '', + 'east', 'decimal', 'NULL', '10,7', '', '', + 'south', 'decimal', 'NULL', '10,7', '', '', + 'north', 'decimal', 'NULL', '10,7', '', '', + + 'title', 'varchar', 'NULL', $char_d,'', '', + ], 'primary_key' => 'sectornum', 'unique' => [ [ 'towernum', 'sectorname' ], [ 'ip_addr' ], ], 'index' => [ [ 'towernum' ] ], @@ -4853,6 +4914,27 @@ sub tables_hashref { { columns => [ 'towernum' ], table => 'tower', }, + { columns => [ 'hardware_typenum' ], + table => 'hardware_type', + references => [ 'typenum' ], + }, + ], + }, + + 'sector_coverage' => { + 'columns' => [ + 'coveragenum', 'serial', '', '', '', '', + 'sectornum', 'int', '', '', '', '', + 'db_loss', 'int', '', '', '', '', + 'geometry', 'text', 'NULL', '', '', '', + ], + 'primary_key' => 'coveragenum', + 'unique' => [], + 'index' => [], + 'foreign_keys' => [ + { columns => [ 'sectornum' ], + table => 'tower_sector' + }, ], }, @@ -5504,6 +5586,10 @@ sub tables_hashref { 'rated_ratename', 'varchar', 'NULL', $char_d, '', '', 'rated_cost', 'decimal', 'NULL', '10,4', '', '', + # real endpoints of the call + 'src_lrn', 'varchar', 'NULL', '15', '', '', + 'dst_lrn', 'varchar', 'NULL', '15', '', '', + 'carrierid', 'bigint', 'NULL', '', '', '', # service it was matched to @@ -5566,6 +5652,7 @@ sub tables_hashref { 'rated_price', 'decimal', 'NULL', '10,4', '', '', 'rated_seconds', 'int', 'NULL', '', '', '', 'rated_minutes', 'double precision', 'NULL', '', '', '', + 'rated_granularity','int', 'NULL', '', '', '', 'status', 'varchar', 'NULL', 32, '', '', 'svcnum', 'int', 'NULL', '', '', '', ], @@ -6623,6 +6710,7 @@ sub tables_hashref { 'min_level', 'int', 'NULL', '', '', '', 'msgnum', 'int', '', '', '', '', 'to_addr', 'varchar', 'NULL', 255, '', '', + 'context_height', 'int', 'NULL', '', '', '', ], 'primary_key' => 'logemailnum', 'unique' => [], @@ -7268,6 +7356,7 @@ sub tables_hashref { 'graphnum', 'int', 'NULL', '', '', '', 'imported', @date_type, '', '', 'content', 'text', 'NULL', '', '', '', + 'thumbnail', 'text', 'NULL', '', '', '', ], 'primary_key' => 'cacti_pagenum', 'unique' => [ ], @@ -7384,6 +7473,92 @@ sub tables_hashref { ], }, + 'rt_field_charge' => { + 'columns' => [ + 'rtfieldchargenum', 'serial', '', '', '', '', + 'pkgnum', 'int', '', '', '', '', + 'ticketid', 'int', '', '', '', '', + 'rate', @money_type, '', '', + 'units', 'decimal', '', '10,4', '', '', + 'charge', @money_type, '', '', + '_date', @date_type, '', '', + ], + 'primary_key' => 'rtfieldchargenum', + 'unique' => [], + 'index' => [ ['pkgnum', 'ticketid'] ], + 'foreign_keys' => [ + { columns => [ 'pkgnum' ], + table => 'cust_pkg', + }, + ], + }, + + 'commission_schedule' => { + 'columns' => [ + 'schedulenum', 'serial', '', '', '', '', + 'schedulename', 'varchar', '', $char_d, '', '', + 'reasonnum', 'int', 'NULL', '', '', '', + 'basis', 'varchar', 'NULL', 32, '', '', + ], + 'primary_key' => 'schedulenum', + 'unique' => [], + 'index' => [], + }, + + 'commission_rate' => { + 'columns' => [ + 'commissionratenum', 'serial', '', '', '', '', + 'schedulenum', 'int', '', '', '', '', + 'cycle', 'int', '', '', '', '', + 'amount', @money_type, '', '', + 'percent', 'decimal','', '7,4', '', '', + ], + 'primary_key' => 'commissionratenum', + 'unique' => [ [ 'schedulenum', 'cycle', ] ], + 'index' => [], + 'foreign_keys' => [ + { columns => [ 'schedulenum' ], + table => 'commission_schedule', + }, + ], + }, + + 'saved_search' => { + 'columns' => [ + 'searchnum', 'serial', '', '', '', '', + 'usernum', 'int', 'NULL', '', '', '', + 'searchname', 'varchar', '', $char_d, '', '', + 'path', 'varchar', '', $char_d, '', '', + 'params', 'text', 'NULL', '', '', '', + 'disabled', 'char', 'NULL', 1, '', '', + 'freq', 'varchar', 'NULL', 16, '', '', + 'last_sent', 'int', 'NULL', '', '', '', + 'format', 'varchar', 'NULL', 32, '', '', + ], + 'primary_key' => 'searchnum', + 'unique' => [], + 'index' => [], + 'foreign_keys' => [ + { columns => [ 'usernum' ], + table => 'access_user', + }, + ], + }, + + 'addr_status' => { + 'columns' => [ + 'addrnum', 'serial', '', '', '', '', + 'ip_addr', 'varchar', 'NULL', 40, '', '', + '_date', @date_type, '', '', + 'up', 'char', 'NULL', 1, '', '', + 'delay', 'int', 'NULL', '', '', '', + ], + 'primary_key' => 'addrnum', + 'unique' => [ [ 'ip_addr' ] ], + 'index' => [ [ '_date' ] ], + 'foreign_keys' => [], + }, + # name type nullability length default local #'new_table' => {