warn "[debug]$me re-using cached dbdef for $file\n" if $DEBUG;
}
$dbdef = $dbdef_cache{$file};
+ FS::Record::fk_methods_init();
}
=item dbdef
grep { ! /^(clientapi|access_user)_session/
&& ! /^h_/
&& ! /^log(_context)?$/
- && ! /^legacy_cust_history$/
+ && ! /^(legacy_cust_history|cacti_page|template_image|access_user_log)$/
&& ( ! /^queue(_arg|_depend|_stat)?$/ || ! $opt->{'queue-no_history'} )
&& ! $tables_hashref_torrus->{$_}
}
#void fields
'void_date', @date_type, '', '',
- 'reason', 'varchar', 'NULL', $char_d, '', '',
- 'void_usernum', 'int', 'NULL', '', '', '',
+ 'reason', 'varchar', 'NULL', $char_d, '', '',
+ 'reasonnum', 'int', 'NULL', '', '', '',
+ 'void_usernum', 'int', 'NULL', '', '', '',
],
'primary_key' => 'invnum',
'unique' => [ [ 'custnum', 'agent_invid' ] ], #agentnum? huh
{ columns => [ 'statementnum' ],
table => 'cust_statement', #_void? both?
},
+ { columns => [ 'reasonnum' ],
+ table => 'reason',
+ },
{ columns => [ 'void_usernum' ],
table => 'access_user',
references => [ 'usernum' ],
'_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' ],
{ columns => [ 'eventnum' ],
table => 'cust_event',
},
- { columns => [ 'billpkgnum' ],
- table => 'cust_bill_pkg',
- },
+ #{ columns => [ 'billpkgnum' ],
+ # table => 'cust_bill_pkg',
+ #},
{ columns => [ 'feepart' ],
table => 'part_fee',
},
{ columns => [ 'billpkgnum' ],
table => 'cust_bill_pkg',
},
- { columns => [ 'base_billpkgnum' ],
- table => 'cust_bill_pkg',
- references => [ 'billpkgnum' ],
- },
- { columns => [ 'base_invnum' ],
- table => 'cust_bill',
- references => [ 'invnum' ],
+ ],
+ },
+
+ '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'],
+ ],
+ 'foreign_keys' => [
+ { columns => [ 'billpkgnum' ],
+ table => 'cust_bill_pkg_void',
},
],
},
+
'cust_bill_pkg_tax_location' => {
'columns' => [
'billpkgtaxlocationnum', 'serial', '', '', '', '',
{ columns => [ 'locationnum' ],
table => 'cust_location',
},
- { columns => [ 'taxable_billpkgnum' ],
- table => 'cust_bill_pkg',
- references => [ 'billpkgnum' ],
- },
+ #{ columns => [ 'taxable_billpkgnum' ],
+ # table => 'cust_bill_pkg',
+ # references => [ 'billpkgnum' ],
+ #},
],
},
'amount', @money_type, '', '',
'currency', 'char', 'NULL', 3, '', '',
'taxable_billpkgnum', 'int', 'NULL', '', '', '',
+ 'taxclass', 'varchar', 'NULL', 10, '', '',
],
'primary_key' => 'billpkgtaxratelocationnum',
'unique' => [],
{ columns => [ 'taxratelocationnum' ],
table => 'tax_rate_location',
},
- { columns => [ 'taxable_billpkgnum' ],
- table => 'cust_bill_pkg',
- references => [ 'billpkgnum' ],
- },
+ #{ columns => [ 'taxable_billpkgnum' ],
+ # table => 'cust_bill_pkg',
+ # references => [ 'billpkgnum' ],
+ #},
],
},
'unitsetup', @money_typen, '', '',
'unitrecur', @money_typen, '', '',
'hidden', 'char', 'NULL', 1, '', '',
+ 'feepart', 'int', 'NULL', '', '', '',
#void fields
'void_date', @date_type, '', '',
- 'reason', 'varchar', 'NULL', $char_d, '', '',
- 'void_usernum', 'int', 'NULL', '', '', '',
+ 'reason', 'varchar', 'NULL', $char_d, '', '',
+ 'reasonnum', 'int', 'NULL', '', '', '',
+ 'void_usernum', 'int', 'NULL', '', '', '',
],
'primary_key' => 'billpkgnum',
'unique' => [],
{ columns => [ 'invnum' ],
table => 'cust_bill_void',
},
+ { columns => [ 'reasonnum' ],
+ table => 'reason',
+ },
#pkgnum 0 and -1 are used for special things
#{ columns => [ 'pkgnum' ],
# table => 'cust_pkg',
{ columns => [ 'billpkgnum' ],
table => 'cust_bill_pkg_void',
},
- { columns => [ 'pkgnum' ],
- table => 'cust_pkg',
- },
{ columns => [ 'locationnum' ],
table => 'cust_location',
},
- { columns => [ 'taxable_billpkgnum' ],
- table => 'cust_bill_pkg_void',
- references => [ 'billpkgnum' ],
- },
+ #{ columns => [ 'taxable_billpkgnum' ],
+ # table => 'cust_bill_pkg_void',
+ # references => [ 'billpkgnum' ],
+ #},
],
},
'paystate', 'varchar', 'NULL', $char_d, '', '',
'paytype', 'varchar', 'NULL', $char_d, '', '',
'payip', 'varchar', 'NULL', 15, '', '',
+ 'paycardtype', 'varchar', 'NULL', $char_d, '', '',
+
+ 'is_tokenized', 'char', 'NULL', '1', '', '',
'geocode', 'varchar', 'NULL', 20, '', '',
'censustract', 'varchar', 'NULL', 20, '', '', # 7 to save space?
'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, '', '',
'message_noemail', 'char', 'NULL', 1, '', '',
'bill_locationnum', 'int', 'NULL', '', '', '',
'ship_locationnum', 'int', 'NULL', '', '', '',
- 'taxstatusnum', 'char', 'NULL', 32, '', '',
+ 'taxstatusnum', 'int', 'NULL', '', '', '',
'complimentary', 'char', 'NULL', 1, '', '',
'po_number', 'varchar', 'NULL', $char_d, '', '',
'invoice_attn', 'varchar', 'NULL', $char_d, '', '',
+ 'invoice_ship_address', 'char', 'NULL', 1, '', '',
+ 'postal_invoice', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'custnum',
'unique' => [ [ 'agentnum', 'agent_custid' ] ],
[ 'archived' ],
[ 'ship_locationnum' ],
[ 'bill_locationnum' ],
+ [ 'paycardtype' ],
+ [ 'is_tokenized' ],
],
'foreign_keys' => [
{ columns => [ 'agentnum' ],
'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, '', '',
'paytype', 'varchar', 'NULL', $char_d, '', '',
'payip', 'varchar', 'NULL', 15, '', '',
'locationnum', 'int', 'NULL', '', '', '',
+ 'is_tokenized', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'custpaybynum',
'unique' => [],
- 'index' => [ [ 'custnum' ] ],
+ 'index' => [ [ 'custnum' ], [ 'is_tokenized' ] ],
'foreign_keys' => [
{ columns => [ 'custnum' ],
table => 'cust_main',
'classnum', 'int', 'NULL', '', '', '',
'comment', 'varchar', 'NULL', 255, '', '',
'selfservice_access', 'char', 'NULL', 1, '', '',
+ 'invoice_dest', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'custcontactnum',
'unique' => [ [ 'custnum', 'contactnum' ], ],
'_password', 'varchar', 'NULL', $char_d, '', '',
'_password_encoding', 'varchar', 'NULL', $char_d, '', '',
'disabled', 'char', 'NULL', 1, '', '',
+ 'invoice_dest', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'contactnum',
'unique' => [],
'disabled', 'char', 'NULL', 1, '', '',
'custnum', 'int', 'NULL', '', '', '',
'refnum', 'int', 'NULL', '', '', '',
+ 'taxstatusnum', 'int', 'NULL', '', '', '',
],
'primary_key' => 'prospectnum',
'unique' => [],
'quotation' => {
'columns' => [
#regular fields
- 'quotationnum', 'serial', '', '', '', '',
- 'prospectnum', 'int', 'NULL', '', '', '',
- 'custnum', 'int', 'NULL', '', '', '',
- '_date', @date_type, '', '',
- 'disabled', 'char', 'NULL', 1, '', '',
- 'usernum', 'int', 'NULL', '', '', '',
+ 'quotationnum', 'serial', '', '', '', '',
+ 'prospectnum', 'int', 'NULL', '', '', '',
+ 'custnum', 'int', 'NULL', '', '', '',
+ '_date', @date_type, '', '',
+ 'disabled', 'char', 'NULL', 1, '', '',
+ 'usernum', 'int', 'NULL', '', '', '',
+ 'close_date', @date_type, '', '',
+ 'confidence', 'int', 'NULL', '', '', '',
+ 'quotation_description', 'varchar', 'NULL', '50', '', '',
#'total', @money_type, '', '',
#'quotation_term', 'varchar', 'NULL', $char_d, '', '',
],
],
},
+ 'quotation_pkg_detail' => {
+ 'columns' => [
+ 'detailnum', 'serial', '', '', '', '',
+ 'quotationpkgnum', 'int', '', '', '', '',
+ 'format', 'char', 'NULL', 1, '', '', # not used for anything
+ 'detail', 'varchar', '', 255, '', '',
+ 'copy_on_order', 'char', 'NULL', 1, '', '', # 'Y' to copy when ordering
+ ],
+ 'primary_key' => 'detailnum',
+ 'unique' => [],
+ 'index' => [ [ 'quotationpkgnum' ] ],
+ 'foreign_keys' => [
+ { columns => [ 'quotationpkgnum' ],
+ table => 'quotation_pkg',
+ references => [ 'quotationpkgnum' ],
+ },
+ ],
+ },
+
'quotation_pkg_discount' => {
'columns' => [
'quotationpkgdiscountnum', 'serial', '', '', '', '',
'quotationpkgnum', 'int', '', '', '', '',
'discountnum', 'int', '', '', '', '',
- 'setup_amount', @money_typen, '', '',
- 'recur_amount', @money_typen, '', '',
+ 'setuprecur', 'varchar', 'NULL', $char_d, '', '',
+ 'amount', @money_typen, '', '',
#'end_date', @date_type, '', '',
],
'primary_key' => 'quotationpkgdiscountnum',
'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',,
+ 'primary_key' => 'quotationtaxnum',
'unique' => [],
'index' => [ [ 'quotationpkgnum' ] ],
+ 'foreign_keys' => [
+ { columns => [ 'quotationpkgnum' ],
+ table => 'quotation_pkg',
+ },
+ ],
},
'cust_location' => { #'location' now that its prospects too, but...
'locationname', 'varchar', 'NULL', $char_d, '', '',
'address1', 'varchar', '', $char_d, '', '',
'address2', 'varchar', 'NULL', $char_d, '', '',
- 'city', 'varchar', '', $char_d, '', '',
+ 'city', 'varchar', 'NULL', $char_d, '', '',
'county', 'varchar', 'NULL', $char_d, '', '',
'state', 'varchar', 'NULL', $char_d, '', '',
'zip', 'varchar', 'NULL', 10, '', '',
'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, '', '',
],
'taxname', 'varchar', 'NULL', $char_d, '', '',
'setuptax', 'char', 'NULL', 1, '', '', # Y = setup tax exempt
'recurtax', 'char', 'NULL', 1, '', '', # Y = recur tax exempt
+ 'source', 'varchar', 'NULL', $char_d, '', '',
],
'primary_key' => 'taxnum',
'unique' => [],
'cust_pay_pending' => {
'columns' => [
'paypendingnum', 'serial', '', '', '', '',
- 'custnum', 'int', '', '', '', '',
+ 'custnum', 'int', 'NULL', '', '', '',
'paid', @money_type, '', '',
'currency', 'char', 'NULL', 3, '', '',
'_date', @date_type, '', '',
'manual', 'char', 'NULL', 1, '', '',
'discount_term','int', 'NULL', '', '', '',
'failure_status','varchar','NULL', 16, '', '',
+ 'is_tokenized', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'paypendingnum',
'unique' => [ [ 'payunique' ] ],
'index' => [ [ 'custnum' ], [ 'status' ],
['paynum'], ['void_paynum'], ['jobnum'], ['invnum'],
+ [ 'is_tokenized' ],
],
'foreign_keys' => [
{ columns => [ 'custnum' ],
'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
'payunique', 'varchar', 'NULL', $char_d, '', '',#separate paybatch "unique" functions from current usage
'closed', 'char', 'NULL', 1, '', '',
'pkgnum', 'int', 'NULL', '', '', '', #desired pkgnum for pkg-balances
-
+ 'no_auto_apply', 'char', 'NULL', 1, '', '',
+ 'is_tokenized', 'char', 'NULL', 1, '', '',
+
# cash/check deposit info fields
'bank', 'varchar', 'NULL', $char_d, '', '',
'depositor', 'varchar', 'NULL', $char_d, '', '',
'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' ] ],
'index' => [ ['custnum'], ['paybatch'], ['payby'], ['_date'],
- ['usernum'],
+ ['usernum'], ['is_tokenized'],
],
'foreign_keys' => [
{ columns => [ 'custnum' ],
'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, '', '',
'pkgnum', 'int', 'NULL', '', '', '', #desired pkgnum for pkg-balances
+ 'is_tokenized', 'char', 'NULL', 1, '', '',
# cash/check deposit info fields
'bank', 'varchar', 'NULL', $char_d, '', '',
'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, '', '',
'reason', 'varchar', 'NULL', $char_d, '', '',
+ 'reasonnum', 'int', 'NULL', '', '', '',
'void_usernum', 'int', 'NULL', '', '', '',
],
'primary_key' => 'paynum',
'unique' => [],
- 'index' => [ ['custnum'], ['usernum'], ['void_usernum'] ],
+ 'index' => [ ['custnum'], ['usernum'], ['void_usernum'],
+ ['is_tokenized'],
+ ],
'foreign_keys' => [
{ columns => [ 'custnum' ],
table => 'cust_main',
{ columns => [ 'gatewaynum' ],
table => 'payment_gateway',
},
+ { columns => [ 'reasonnum' ],
+ table => 'reason',
+ },
{ columns => [ 'void_usernum' ],
table => 'access_user',
references => [ 'usernum' ],
'download', @date_type, '', '',
'upload', @date_type, '', '',
'title', 'varchar', 'NULL',255, '', '',
+ 'processor_id', 'varchar', 'NULL',255, '', '',
],
'primary_key' => 'batchnum',
'unique' => [],
'first', 'varchar', '', $char_d, '', '',
'address1', 'varchar', '', $char_d, '', '',
'address2', 'varchar', 'NULL', $char_d, '', '',
- 'city', 'varchar', '', $char_d, '', '',
+ 'city', 'varchar', 'NULL', $char_d, '', '',
'state', 'varchar', 'NULL', $char_d, '', '',
'zip', 'varchar', 'NULL', 10, '', '',
'country', 'char', '', 2, '', '',
#'exp', @date_type, '', '',
'exp', 'varchar', 'NULL', 11, '', '',
'payname', 'varchar', 'NULL', $char_d, '', '',
+ 'paytype', 'varchar', 'NULL', $char_d, '', '',
'amount', @money_type, '', '',
'currency', 'char', 'NULL', 3, '', '',
'status', 'varchar', 'NULL', $char_d, '', '',
{ columns => [ 'batchnum' ],
table => 'pay_batch',
},
- { columns => [ 'invnum' ],
- table => 'cust_bill',
- },
+ #{ columns => [ 'invnum' ],
+ # table => 'cust_bill',
+ #},
{ columns => [ 'custnum' ],
table => 'cust_main',
},
'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' => [],
],
},
+ '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' ] ],
+ 'foreign_keys' => [
+ { columns => [ 'pkgreasonnum' ],
+ table => 'cust_pkg_reason',
+ references => [ 'num' ],
+ },
+ { columns => [ 'feepart' ],
+ table => 'part_fee',
+ },
+ # can't link billpkgnum, because of voids
+ ],
+ },
+
'cust_pkg_discount' => {
'columns' => [
'pkgdiscountnum', 'serial', '', '', '', '',
'otaker', 'varchar', 'NULL', 32, '', '',
'usernum', 'int', 'NULL', '', '', '',
'disabled', 'char', 'NULL', 1, '', '',
+ 'setuprecur', 'char', 'NULL', 5, '', '',
],
'primary_key' => 'pkgdiscountnum',
'unique' => [],
# 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
# credit card/EFT fields (formerly in paybatch)
'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
+ 'is_tokenized', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'refundnum',
'unique' => [],
- 'index' => [ ['custnum'], ['_date'], [ 'usernum' ], ],
+ 'index' => [ ['custnum'], ['_date'], [ 'usernum' ], ['is_tokenized'] ],
'foreign_keys' => [
{ columns => [ 'custnum' ],
table => 'cust_main',
{ columns => [ 'gatewaynum' ],
table => 'payment_gateway',
},
+ { columns => [ 'source_paynum' ],
+ table => 'cust_pay',
+ references => [ 'paynum' ],
+ },
],
},
'delay_start', 'int', 'NULL', '', '', '',
'start_on_hold', 'char', 'NULL', 1, '', '',
'agent_pkgpartid', 'varchar', 'NULL', 20, '', '',
+ 'expire_months', 'int', 'NULL', '', '', '',
+ 'adjourn_months', 'int', 'NULL', '', '', '',
+ 'contract_end_months','int','NULL', '', '', '',
+ 'change_to_pkgpart', 'int', 'NULL', '', '', '',
],
'primary_key' => 'pkgpart',
'unique' => [],
table => 'part_pkg',
references => [ 'pkgpart' ],
},
+ { columns => [ 'change_to_pkgpart' ],
+ table => 'part_pkg',
+ references => [ 'pkgpart' ],
+ },
],
},
'primary_svc', 'char', 'NULL', 1, '', '',
'hidden', 'char', 'NULL', 1, '', '',
'bulk_skip', 'char', 'NULL', 1, '', '',
+ 'provision_hold', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'pkgsvcnum',
'unique' => [ ['pkgpart', 'svcpart'] ],
'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' ],
'columnlabel', 'varchar', 'NULL', $char_d, '', '',
'columnvalue', 'varchar', 'NULL', 512, '', '',
'columnflag', 'char', 'NULL', 1, '', '',
+ 'required', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'columnnum',
'unique' => [ [ 'svcpart', 'columnname' ] ],
'index' => [ ['disabled'] ],
},
+ 'part_svc_link' => {
+ 'columns' => [
+ 'svclinknum', 'serial', '', '', '', '',
+ #'linkname', 'varchar', 'NULL', $char_d, '', '',
+ 'agentnum', 'int', 'NULL', '', '', '',
+ 'src_svcpart', 'int', '', '', '', '',
+ 'dst_svcpart', 'int', '', '', '', '',
+ 'link_type', 'varchar', '', $char_d, '', '',
+ 'disabled', 'char', 'NULL', 1, '', '',
+ ],
+ 'primary_key' => 'svclinknum',
+ 'unique' => [ ['agentnum','src_svcpart','dst_svcpart','link_type'] ],
+ 'index' => [ [ 'src_svcpart' ], [ 'src_svcpart', 'link_type' ], [ 'disabled' ] ],
+ 'foreign_keys' => [
+ { columns => [ 'src_svcpart' ],
+ table => 'part_svc',
+ references => [ 'svcpart' ]
+ },
+ { columns => [ 'dst_svcpart' ],
+ table => 'part_svc',
+ references => [ 'svcpart' ]
+ },
+ ],
+ },
+
+ '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' => [
'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
'custnum', 'int', 'NULL', '', '', '',
'secure', 'char', 'NULL', 1, '', '',
'priority', 'int', 'NULL', '', '', '',
+ 'usernum', 'int', 'NULL', '', '', '',
],
'primary_key' => 'jobnum',
'unique' => [],
{ columns => [ 'custnum' ],
table => 'cust_main',
},
+ { columns => [ 'usernum' ],
+ table => 'access_user',
+ },
],
},
],
},
+ 'export_cust_svc' => {
+ 'columns' => [
+ 'exportcustsvcnum', 'serial', '', '', '', '',
+ 'exportnum', 'int', '', '', '', '',
+ 'svcnum', 'int', '', '', '', '',
+ 'remoteid', 'varchar', '', 512, '', '',
+ ],
+ 'primary_key' => 'exportcustsvcnum',
+ 'unique' => [ [ 'exportnum', 'svcnum' ] ],
+ 'index' => [ [ 'exportnum', 'svcnum' ] ],
+ 'foreign_keys' => [
+ { columns => [ 'exportnum' ],
+ table => 'part_export',
+ },
+ { columns => [ 'svcnum' ],
+ table => 'cust_svc',
+ },
+ ],
+ },
+
'export_device' => {
'columns' => [
'exportdevicenum' => 'serial', '', '', '', '',
'exporttype', 'varchar', '', $char_d, '', '',
'nodomain', 'char', 'NULL', 1, '', '',
'default_machine','int', 'NULL', '', '', '',
+ 'no_suspend', 'char', 'NULL', 1, '', '',
+ # could also have 'no_insert', 'no_replace', etc.
],
'primary_key' => 'exportnum',
'unique' => [],
#'custnum', 'int', '', '', '', ''
'billpkgnum', 'int', '', '', '', '',
'taxnum', 'int', '', '', '', '',
+ 'taxtype', 'varchar', 'NULL', $char_d, '', '',
'year', 'int', 'NULL', '', '', '',
'month', 'int', 'NULL', '', '', '',
'creditbillpkgnum', 'int', 'NULL', '', '', '',
'unique' => [],
'index' => [ [ 'taxnum', 'year', 'month' ],
[ 'billpkgnum' ],
- [ 'taxnum' ],
+ [ 'taxnum', 'taxtype' ],
[ 'creditbillpkgnum' ],
],
'foreign_keys' => [
{ columns => [ 'billpkgnum' ],
table => 'cust_bill_pkg',
},
- { columns => [ 'taxnum' ],
- table => 'cust_main_county',
- },
{ columns => [ 'creditbillpkgnum' ],
table => 'cust_credit_bill_pkg',
},
#'custnum', 'int', '', '', '', ''
'billpkgnum', 'int', '', '', '', '',
'taxnum', 'int', '', '', '', '',
+ 'taxtype', 'varchar', 'NULL', $char_d, '', '',
'year', 'int', 'NULL', '', '', '',
'month', 'int', 'NULL', '', '', '',
'creditbillpkgnum', 'int', 'NULL', '', '', '',
'unique' => [],
'index' => [ [ 'taxnum', 'year', 'month' ],
[ 'billpkgnum' ],
- [ 'taxnum' ],
+ [ 'taxnum', 'taxtype' ],
[ 'creditbillpkgnum' ],
],
'foreign_keys' => [
'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', '', '', '',
+ 'margin', 'decimal', 'NULL', '', '', '',
+ 'image', 'blob', 'NULL', '', '', '',
+ 'west', 'decimal', 'NULL', '10,7', '', '',
+ 'east', 'decimal', 'NULL', '10,7', '', '',
+ 'south', 'decimal', 'NULL', '10,7', '', '',
+ 'north', 'decimal', 'NULL', '10,7', '', '',
+ ],
'primary_key' => 'sectornum',
'unique' => [ [ 'towernum', 'sectorname' ], [ 'ip_addr' ], ],
'index' => [ [ 'towernum' ] ],
'ocn', 'char', 'NULL', 4, '', '',
],
'primary_key' => 'prefixnum',
- 'unique' => [],
+ 'unique' => [ [ 'countrycode', 'npa', 'nxx' ] ],
'index' => [ [ 'countrycode' ], [ 'npa' ], [ 'regionnum' ] ],
'foreign_keys' => [
{ columns => [ 'regionnum' ],
'rated_ratedetailnum', 'int', 'NULL', '', '', '',
'rated_classnum', 'int', 'NULL', '', '', '',
'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', '', '', '',
'unique' => [],
'index' => [ [ 'calldate' ],
[ 'src' ], [ 'dst' ], [ 'dcontext' ], [ 'charged_party' ],
+ [ 'startdate' ], [ 'duration' ],
+ [ 'cdrtypenum' ], [ 'calltypenum' ],
[ 'lastapp' ],
['accountcode'], ['uniqueid'], ['carrierid'], ['cdrid'],
[ 'sessionnum' ], [ 'subscriber' ],
[ 'freesidestatus' ], [ 'freesiderewritestatus' ],
[ 'cdrbatch' ], [ 'cdrbatchnum' ],
[ 'src_ip_addr' ], [ 'dst_ip_addr' ], [ 'dst_term' ],
+ [ 'detailnum' ],
],
#no FKs on cdr table... choosing not to throw errors no matter what's
# thrown in here. better to have the data.
'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', '', '', '',
],
'index' => [],
},
+ 'access_user_log' => {
+ 'columns' => [
+ 'lognum', 'serial', '', '', '', '',
+ 'usernum', 'int', '', '', '', '',
+ 'path', 'varchar', '', 2*$char_d, '', '',
+ '_date', @date_type, '', '',
+ 'render_seconds', 'int', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'lognum',
+ 'unique' => [],
+ 'index' => [ ['usernum'], ['path'], ['_date'] ],
+ },
+
+ 'access_user_page_pref' => {
+ 'columns' => [
+ 'prefnum' => 'serial', '', '', '', '',
+ 'usernum' => 'int', '', '', '', '',
+ 'path' => 'text', '', '', '', '',
+ 'tablenum' => 'int', 'NULL', '', '', '',
+ '_date' => @date_type, '', '',
+ 'prefname' => 'varchar', '', $char_d, '', '',
+ 'prefvalue' => 'text', '', '', '', '',
+ ],
+ 'primary_key' => 'prefnum',
+ 'unique' => [ [ 'usernum', 'path', 'tablenum', 'prefname' ] ],
+ 'index' => [],
+ 'foreign_keys' => [
+ { columns => [ 'usernum' ],
+ table => 'access_user'
+ },
+ ],
+ },
+
'sched_item' => {
'columns' => [
'itemnum', 'serial', '', '', '', '',
'pbxsvc', 'int', 'NULL', '', '', '',
'domsvc', 'int', 'NULL', '', '', '',
'locationnum', 'int', 'NULL', '', '', '',
+ 'forward_svcnum', 'int', 'NULL', '', '', '',
'forwarddst', 'varchar', 'NULL', 15, '', '',
'email', 'varchar', 'NULL', 255, '', '',
'lnp_status', 'varchar', 'NULL', $char_d, '', '',
'lnp_other_provider', 'varchar', 'NULL', $char_d, '', '',
'lnp_other_provider_account', 'varchar', 'NULL', $char_d, '', '',
'lnp_reject_reason', 'varchar', 'NULL', $char_d, '', '',
+ 'lnp_portid', 'varchar', 'NULL', $char_d, '', '',
+ 'lnp_signature', 'char', 'NULL', 1, '', '',
+ 'lnp_bill', 'char', 'NULL', 1, '', '',
'sms_carrierid', 'int', 'NULL', '', '', '',
'sms_account', 'varchar', 'NULL', $char_d, '', '',
'max_simultaneous', 'int', 'NULL', '', '', '',
'devicepart', 'serial', '', '', '', '',
'devicename', 'varchar', '', $char_d, '', '',
'inventory_classnum', 'int', 'NULL', '', '', '',
+ 'title', 'varchar', 'NULL', $char_d, '', '',
],
'primary_key' => 'devicepart',
'unique' => [ [ 'devicename' ] ], #?
'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' => [],
'mime_type', 'varchar', '', $char_d, '', '',
'body', 'blob', 'NULL', '', '', '',
'disabled', 'char', 'NULL', 1, '', '',
+ # migrate these to msg_template_email
'from_addr', 'varchar', 'NULL', 255, '', '',
'bcc_addr', 'varchar', 'NULL', 255, '', '',
+ # change to not null on v5
+ 'msgclass', 'varchar', 'NULL', 16, '', '',
],
'primary_key' => 'msgnum',
'unique' => [ ],
],
},
+ 'msg_template_http' => {
+ 'columns' => [
+ 'num', 'serial', '', '', '', '',
+ 'msgnum', 'int', '', '', '', '',
+ 'prepare_url', 'varchar', 'NULL', 255, '', '',
+ 'send_url', 'varchar', 'NULL', 255, '', '',
+ 'username', 'varchar', 'NULL', $char_d, '', '',
+ 'password', 'varchar', 'NULL', $char_d, '', '',
+ 'content', 'text', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'num',
+ 'unique' => [ [ 'msgnum' ], ],
+ 'index' => [ ],
+ 'foreign_keys' => [
+ { columns => [ 'msgnum' ],
+ table => 'msg_template',
+ },
+ ],
+ },
+
'template_content' => {
'columns' => [
'contentnum', 'serial', '', '', '', '',
],
},
+ 'template_image' => {
+ 'columns' => [
+ 'imgnum', 'serial', '', '', '', '',
+ 'name', 'varchar', '', $char_d, '', '',
+ 'agentnum', 'int', 'NULL', '', '', '',
+ 'mime_type', 'varchar', '', $char_d, '', '',
+ 'base64', 'text', '', '', '', '',
+ ],
+ 'primary_key' => 'imgnum',
+ 'unique' => [ ],
+ 'index' => [ ['name'], ['agentnum'] ],
+ },
+
'cust_msg' => {
'columns' => [
'custmsgnum', 'serial', '', '', '', '',
'error', 'varchar', 'NULL', 255, '', '',
'status', 'varchar', '',$char_d, '', '',
'msgtype', 'varchar', 'NULL', 16, '', '',
+ 'preview', 'text', 'NULL', '', '', '',
],
'primary_key' => 'custmsgnum',
'unique' => [ ],
],
},
+ 'log_email' => {
+ 'columns' => [
+ 'logemailnum', 'serial', '', '', '', '',
+ 'context', 'varchar', 'NULL', $char_d, '', '',
+ 'min_level', 'int', 'NULL', '', '', '',
+ 'msgnum', 'int', '', '', '', '',
+ 'to_addr', 'varchar', 'NULL', 255, '', '',
+ 'context_height', 'int', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'logemailnum',
+ 'unique' => [],
+ 'index' => [ ['context'], ['min_level'] ],
+ 'foreign_keys' => [
+ { columns => [ 'msgnum' ],
+ table => 'msg_template',
+ references => [ 'msgnum' ],
+ },
+ ],
+ },
+
'svc_alarm' => {
'columns' => [
# name type null length default local
'vendor_order_status', 'varchar', 'NULL', $char_d, '', '',
'endpoint_ip_addr', 'varchar', 'NULL', 40, '', '',
'endpoint_mac_addr', 'varchar', 'NULL', 12, '', '',
+ 'internal_circuit_id', 'varchar', '', 64, '', '',
],
'primary_key' => 'svcnum',
'unique' => [],
],
},
+ 'svc_fiber' => {
+ 'columns' => [
+ 'svcnum', 'int', '', '', '', '',
+ 'oltnum', 'int', 'NULL', '', '', '',
+ 'shelf', 'int', 'NULL', '', '', '',
+ 'card', 'int', 'NULL', '', '', '',
+ 'olt_port', 'int', 'NULL', '', '', '',
+ 'ont_id', 'int', 'NULL', '', '', '',
+ 'ont_typenum', 'int', 'NULL', '', '', '',
+ 'ont_serial', 'varchar', 'NULL', $char_d, '', '',
+ 'ont_port', 'varchar', 'NULL', 16, '', '',
+ 'circuit_id', 'varchar', 'NULL', $char_d, '', '',
+ 'vlan', 'int', 'NULL', '', '', '',
+ 'signal', 'decimal', 'NULL', '10,2', '', '',
+ 'speed_up', 'int', 'NULL', '', '', '',
+ 'speed_down', 'int', 'NULL', '', '', '',
+ 'ont_install','varchar', 'NULL', $char_d, '', '',
+ ],
+ 'primary_key' => 'svcnum',
+ 'unique' => [ ],
+ 'index' => [ [ 'ont_serial' ] ],
+ 'foreign_keys' => [
+ { columns => [ 'svcnum' ],
+ table => 'cust_svc',
+ },
+ { columns => [ 'oltnum' ],
+ table => 'fiber_olt',
+ },
+ { columns => [ 'ont_typenum' ],
+ table => 'hardware_type',
+ references => [ 'typenum' ],
+ },
+ ],
+ },
+
+ 'fiber_olt' => {
+ 'columns' => [
+ 'oltnum', 'serial', '', '', '', '',
+ 'oltname', 'varchar', '', $char_d, '', '',
+ 'sitenum', 'int', 'NULL', '', '', '',
+ 'serial', 'varchar', '', $char_d, '', '',
+ 'disabled', 'char', 'NULL', 1, '', '',
+ ],
+ 'primary_key' => 'oltnum',
+ 'unique' => [ ],
+ 'index' => [ ],
+ 'foreign_keys' => [
+ { columns => [ 'sitenum' ],
+ table => 'olt_site',
+ },
+ ],
+ },
+
+ 'olt_site' => {
+ 'columns' => [
+ 'sitenum', 'serial', '', '', '', '',
+ 'market', 'varchar', '', $char_d, '', '',
+ 'site', 'varchar', '', $char_d, '', '',
+ ],
+ 'primary_key' => 'sitenum',
+ 'unique' => [ [ 'market', 'site' ] ],
+ 'index' => [ ],
+ },
+
+
+
+
+
'vend_main' => {
'columns' => [
'vendnum', 'serial', '', '', '', '',
'latexsmallfooter', 'text', 'NULL', '', '', '',
'latexreturnaddress', 'text', 'NULL', '', '', '',
'with_latexcoupon', 'char', 'NULL', '1', '', '',
+ 'htmlwatermark', 'text', 'NULL', '', '', '',
+ 'latexwatermark', 'text', 'NULL', '', '', '',
'lpr', 'varchar', 'NULL', $char_d, '', '',
],
'primary_key' => 'confnum',
'zonenum', 'serial', '', '', '', '',
'description', 'char', 'NULL', $char_d, '', '',
'agentnum', 'int', '', '', '', '',
+ 'censusyear', 'char', 'NULL', 4, '', '',
'dbaname', 'char', 'NULL', $char_d, '', '',
'zonetype', 'char', '', 1, '', '',
'technology', 'int', '', '', '', '',
'blocknum', 'serial', '', '', '', '',
'zonenum', 'int', '', '', '', '',
'censusblock', 'char', '', 15, '', '',
- 'censusyear', 'char', '', 4, '', '',
+ 'censusyear', 'char','NULL', 4, '', '',
],
'primary_key' => 'blocknum',
'unique' => [],
],
},
+ 'cacti_page' => {
+ 'columns' => [
+ 'cacti_pagenum', 'serial', '', '', '', '',
+ 'exportnum', 'int', 'NULL', '', '', '',
+ 'svcnum', 'int', 'NULL', '', '', '',
+ 'graphnum', 'int', 'NULL', '', '', '',
+ 'imported', @date_type, '', '',
+ 'content', 'text', 'NULL', '', '', '',
+ 'thumbnail', 'text', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'cacti_pagenum',
+ 'unique' => [ ],
+ 'index' => [ ['svcnum'], ['imported'] ],
+ 'foreign_keys' => [
+ { columns => [ 'svcnum' ],
+ table => 'cust_svc',
+ references => [ 'svcnum' ],
+ },
+ { columns => [ 'exportnum' ],
+ table => 'part_export',
+ references => [ 'exportnum' ],
+ },
+ ],
+ },
+
+ 'report_batch' => {
+ 'columns' => [
+ 'reportbatchnum', 'serial', '', '', '', '',
+ 'reportname', 'varchar', '', 255, '', '',
+ 'agentnum', 'int', 'NULL', '', '', '',
+ 'send_date', @date_type, '', '',
+ 'sdate', @date_type, '', '',
+ 'edate', @date_type, '', '',
+ 'usernum', 'int', 'NULL', '', '', '',
+ 'msgnum', 'int', 'NULL', '', '', '',
+ # add report params here as necessary
+ ],
+ 'primary_key' => 'reportbatchnum',
+ 'unique' => [],
+ 'index' => [],
+ 'foreign_keys' => [
+ { columns => [ 'agentnum' ],
+ table => 'agent',
+ references => [ 'agentnum' ],
+ },
+ { columns => [ 'usernum' ],
+ table => 'access_user',
+ references => [ 'usernum' ],
+ },
+ { columns => [ 'msgnum' ],
+ table => 'msg_template',
+ references => [ 'msgnum' ],
+ },
+ ],
+ },
+
+ 'password_history' => {
+ 'columns' => [
+ 'passwordnum', 'serial', '', '', '', '',
+ '_password', 'varchar', 'NULL', $char_d, '', '',
+ 'encryption_method', 'varchar', 'NULL', $char_d, '', '',
+ 'created', @date_type, '', '',
+ # each table that needs password history gets a column here, and
+ # an entry in foreign_keys.
+ 'svc_acct__svcnum', 'int', 'NULL', '', '', '',
+ 'svc_dsl__svcnum', 'int', 'NULL', '', '', '',
+ 'svc_alarm__svcnum', 'int', 'NULL', '', '', '',
+ 'agent__agentnum', 'int', 'NULL', '', '', '',
+ 'contact__contactnum', 'int', 'NULL', '', '', '',
+ 'access_user__usernum', 'int', 'NULL', '', '', '',
+ ],
+ 'primary_key' => 'passwordnum',
+ 'unique' => [],
+ 'index' => [],
+ 'foreign_keys' => [
+ { columns => [ 'svc_acct__svcnum' ],
+ table => 'svc_acct',
+ references => [ 'svcnum' ],
+ },
+ { columns => [ 'svc_dsl__svcnum' ],
+ table => 'svc_dsl',
+ references => [ 'svcnum' ],
+ },
+ { columns => [ 'svc_alarm__svcnum' ],
+ table => 'svc_alarm',
+ references => [ 'svcnum' ],
+ },
+ { columns => [ 'agent__agentnum' ],
+ table => 'agent',
+ references => [ 'agentnum' ],
+ },
+ { columns => [ 'contact__contactnum' ],
+ table => 'contact',
+ references => [ 'contactnum' ],
+ },
+ { columns => [ 'access_user__usernum' ],
+ table => 'access_user',
+ references => [ 'usernum' ],
+ },
+ ],
+ },
+ 'webservice_log' => {
+ 'columns' => [
+ 'webservicelognum', 'serial', '', '', '', '', #big? hubrus
+ 'svcnum', 'int', 'NULL', '', '', '', #just in case
+ 'custnum', 'int', '', '', '', '',
+ 'method', 'varchar', '', $char_d, '', '',
+ 'quantity', 'int', '', '', '', '', #i.e. pages
+ '_date', @date_type, '', '',
+ 'status', 'varchar', 'NULL', $char_d, '', '',
+ 'rated_price', 'decimal', 'NULL', '10,2', '', '',
+ ],
+ 'primary_key' => 'webservicelognum',
+ 'unique' => [],
+ 'index' => [ ['custnum'], ['status'] ],
+ 'foreign_keys' => [
+ { columns => [ 'custnum' ],
+ table => 'cust_main',
+ },
+ #no FK on svcnum... we don't want to purge these on
+ # service deletion
+ ],
+ },
+ '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',
+ },
+ ],
+ },
+ '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',
+ },
+ ],
+ },
# name type nullability length default local