X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=e5f9c05d1e0be4f9151f07ab3646d3dd7e27e9b9;hb=7a8867ad490e465c138859e9d8b3eb81b9b587c9;hp=c635ea0a00e8e3843773539df60f709fa42e0635;hpb=3317a32f572a2e3605071410e7ddd8082e0b03ee;p=freeside.git diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index c635ea0a0..e5f9c05d1 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -254,11 +254,11 @@ sub dbdef_dist { # necessary because of the evil OR username for older data, be really nice if everything was just migrated to usernum and we could drop username # This will not be helpful to mysql, but postgres smartly does a bitmap across both indexes, mysql will just use one - $h_indices{"h_${table}_username"} = + $h_indices{"h_${table}_user"} = DBIx::DBSchema::Index->new({ - 'name' => "h_${table}_username", + 'name' => "h_${table}_user", 'unique' => 0, - 'columns' => [ 'history_username'], + 'columns' => [ 'history_user'], }); } @@ -691,6 +691,8 @@ sub tables_hashref { 'statementnum', 'int', 'NULL', '', '', '', #invoice aggregate statements 'agent_invid', 'int', 'NULL', '', '', '', #(varchar?) importing legacy 'promised_date', @date_type, '', '', + + 'pending', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'invnum', 'unique' => [ [ 'custnum', 'agent_invid' ] ], #agentnum? huh @@ -1026,7 +1028,8 @@ sub tables_hashref { 'cust_bill_pkg_detail' => { 'columns' => [ - 'detailnum', 'serial', '', '', '', '', + 'detailnum', 'serial', '', '', '', '', + # bigserial? this table will eventually be as big as cdr... 'billpkgnum', 'int', 'NULL', '', '', '', # should not be nullable 'pkgnum', 'int', 'NULL', '', '', '', # deprecated 'invnum', 'int', 'NULL', '', '', '', # deprecated @@ -1038,7 +1041,7 @@ sub tables_hashref { 'accountcode', 'varchar', 'NULL', 20, '', '', 'startdate', @date_type, '', '', 'regionname', 'varchar', 'NULL', $char_d, '', '', - 'detail', 'varchar', '', 255, '', '', + 'detail', 'varchar', '', 255, '', '', ], 'primary_key' => 'detailnum', 'unique' => [], @@ -1625,6 +1628,7 @@ sub tables_hashref { 'message_noemail', 'char', 'NULL', 1, '', '', 'bill_locationnum', 'int', 'NULL', '', '', '', 'ship_locationnum', 'int', 'NULL', '', '', '', + 'taxstatusnum', 'char', 'NULL', 32, '', '', ], 'primary_key' => 'custnum', 'unique' => [ [ 'agentnum', 'agent_custid' ] ], @@ -1811,10 +1815,11 @@ sub tables_hashref { 'add_date', @date_type, '', '', 'disabled', 'char', 'NULL', 1, '', '', 'custnum', 'int', 'NULL', '', '', '', + 'refnum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'prospectnum', 'unique' => [], - 'index' => [ [ 'company' ], [ 'agentnum' ], [ 'disabled' ] ], + 'index' => [ ['company'], ['agentnum'], ['disabled'], ['refnum'] ], 'foreign_keys' => [ { columns => [ 'agentnum' ], table => 'agent', @@ -1822,6 +1827,9 @@ sub tables_hashref { { columns => [ 'custnum' ], table => 'cust_main', }, + { columns => [ 'refnum' ], + table => 'part_referral', + }, ], }, @@ -1906,6 +1914,7 @@ sub tables_hashref { 'locationnum', 'serial', '', '', '', '', 'prospectnum', 'int', 'NULL', '', '', '', 'custnum', 'int', 'NULL', '', '', '', + 'locationname', 'varchar', 'NULL', $char_d, '', '', 'address1', 'varchar', '', $char_d, '', '', 'address2', 'varchar', 'NULL', $char_d, '', '', 'city', 'varchar', '', $char_d, '', '', @@ -1924,6 +1933,7 @@ sub tables_hashref { 'location_type', 'varchar', 'NULL', 20, '', '', 'location_number', 'varchar', 'NULL', 20, '', '', 'location_kind', 'char', 'NULL', 1, '', '', + 'incorporated', 'char', 'NULL', 1, '', '', 'disabled', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'locationnum', @@ -2153,7 +2163,7 @@ sub tables_hashref { 'geocode', 'varchar', 'NULL', $char_d, '', '',#cch provides 10 char 'data_vendor', 'varchar', 'NULL', $char_d, '', '',#auto update source 'location', 'varchar', 'NULL', $char_d, '', '',#provided by tax authority - 'taxclassnum', 'int', '', '', '', '', + 'taxclassnum', 'int', 'NULL', '', '', '', 'effective_date', @date_type, '', '', 'tax', @taxrate_type, '', '', # tax % 'excessrate', @taxrate_typen, '', '', # second tax % @@ -2197,6 +2207,7 @@ sub tables_hashref { 'city', 'varchar', 'NULL', $char_d, '', '', 'county', 'varchar', 'NULL', $char_d, '', '', 'state', 'char', 'NULL', 2, '', '', + 'country', 'char', 'NULL', 2, '', '', 'disabled', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'taxratelocationnum', @@ -2211,8 +2222,11 @@ sub tables_hashref { 'city', 'varchar', 'NULL', $char_d, '', '', 'postalcity', 'varchar', 'NULL', $char_d, '', '', 'county', 'varchar', 'NULL', $char_d, '', '', - 'zip', 'char', '', 5, '', '', + 'zip', 'char', 'NULL', 5, '', '', 'state', 'char', '', 2, '', '', + 'country', 'char', 'NULL', 2, '', '', # should not actually be NULL, but cch... + 'ziphi', 'char', 'NULL', 10, '', '', + 'ziplo', 'char', 'NULL', 10, '', '', 'plus4hi', 'char', 'NULL', 4, '', '', 'plus4lo', 'char', 'NULL', 4, '', '', 'default_location','char', 'NULL', 1, '', '', # Y = default for zip @@ -2221,7 +2235,7 @@ sub tables_hashref { ], 'primary_key' => 'custlocationnum', 'unique' => [], - 'index' => [ [ 'zip', 'plus4lo', 'plus4hi' ] ], + 'index' => [ [ 'zip', 'plus4lo', 'plus4hi', 'ziphi', 'ziplo' ] ], }, 'tax_class' => { @@ -2236,6 +2250,18 @@ sub tables_hashref { 'index' => [], }, + 'tax_status' => { + 'columns' => [ + 'taxstatusnum', 'serial', '', '', '', '', + 'data_vendor', 'varchar', 'NULL', $char_d, '', '', + 'taxstatus', 'varchar', '', $char_d, '', '', + 'description', 'varchar', '', $char_d, '', '', + ], + 'primary_key' => 'taxstatusnum', + 'unique' => [ [ 'data_vendor', 'taxstatus' ] ], + 'index' => [], + }, + 'cust_pay_pending' => { 'columns' => [ 'paypendingnum', 'serial', '', '', '', '', @@ -2266,7 +2292,7 @@ sub tables_hashref { ], 'primary_key' => 'paypendingnum', 'unique' => [ [ 'payunique' ] ], - 'index' => [ [ 'custnum' ], [ 'status' ], ], + 'index' => [ [ 'custnum' ], [ 'status' ], ['paynum'], ['void_paynum'], ['jobnum'], ], 'foreign_keys' => [ { columns => [ 'custnum' ], table => 'cust_main', @@ -3048,6 +3074,7 @@ sub tables_hashref { 'successor', 'int', 'NULL', '', '', '', 'family_pkgpart','int', 'NULL', '', '', '', 'delay_start', 'int', 'NULL', '', '', '', + 'start_on_hold', 'char', 'NULL', 1, '', '', 'agent_pkgpartid', 'varchar', 'NULL', 20, '', '', ], 'primary_key' => 'pkgpart', @@ -3306,6 +3333,7 @@ sub tables_hashref { 'data_vendor', 'varchar', 'NULL', $char_d, '', '', 'taxproduct', 'varchar', '', $char_d, '', '', 'description', 'varchar', '', 3*$char_d, '', '', + 'note', 'text', 'NULL', '', '', '', ], 'primary_key' => 'taxproductnum', 'unique' => [ [ 'data_vendor', 'taxproduct' ] ], @@ -4146,9 +4174,9 @@ sub tables_hashref { [ 'job' ], [ 'svcnum' ], [ 'custnum' ], [ 'status' ], ], 'foreign_keys' => [ - { columns => [ 'svcnum' ], - table => 'cust_svc', - }, +# { columns => [ 'svcnum' ], +# table => 'cust_svc', +# }, { columns => [ 'custnum' ], table => 'cust_main', }, @@ -4803,9 +4831,10 @@ sub tables_hashref { 'rate' => { 'columns' => [ - 'ratenum', 'serial', '', '', '', '', - 'ratename', 'varchar', '', $char_d, '', '', - 'agentnum', 'int', 'NULL', '', '', '', + 'ratenum', 'serial', '', '', '', '', + 'ratename', 'varchar', '',$char_d, '', '', + 'agentnum', 'int', 'NULL', '', '', '', + 'default_detailnum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'ratenum', 'unique' => [], @@ -4822,7 +4851,7 @@ sub tables_hashref { 'ratedetailnum', 'serial', '', '', '', '', 'ratenum', 'int', '', '', '', '', 'orig_regionnum', 'int', 'NULL', '', '', '', - 'dest_regionnum', 'int', '', '', '', '', + 'dest_regionnum', 'int', 'NULL', '', '', '', 'min_included', 'int', '', '', '', '', 'conn_charge', 'decimal', '', '10,4', '0.0000', '', 'conn_cost', 'decimal', '', '10,4', '0.0000', '', @@ -4834,6 +4863,8 @@ sub tables_hashref { 'classnum', 'int', 'NULL', '', '', '', 'cdrtypenum', 'int', 'NULL', '', '', '', 'region_group', 'char', 'NULL', 1, '', '', + 'upstream_mult_charge', 'decimal', '', '10,4', '0.0000', '', + 'upstream_mult_cost', 'decimal', '', '10,4', '0.0000', '', ], 'primary_key' => 'ratedetailnum', 'unique' => [ [ 'ratenum', 'orig_regionnum', 'dest_regionnum' ] ], @@ -5276,6 +5307,9 @@ sub tables_hashref { #new 'cdrbatchnum', 'int', 'NULL', '', '', '', + # FK to cust_bill_pkg_detail; having a value here absolutely means + # that the CDR appears on an invoice + 'detailnum', 'bigint', 'NULL', '', '', '', ], 'primary_key' => 'acctid', 'unique' => [], @@ -6279,13 +6313,17 @@ sub tables_hashref { 'svc_alarm' => { 'columns' => [ - 'svcnum', 'int', '', '', '', '', - 'alarmsystemnum', 'int', '', '', '', '', - 'alarmtypenum', 'int', '', '', '', '', - 'alarmstationnum', 'int', '', '', '', '', - 'acctnum', 'varchar', '', $char_d, '', '', - '_password', 'varchar', '', $char_d, '', '', - 'location', 'varchar', 'NULL', $char_d, '', '', +# name type null length default local + 'svcnum', 'int', '', '', '', '', + 'alarmsystemnum', 'int', '', '', '', '', + 'alarmtypenum', 'int', '', '', '', '', + 'alarmstationnum', 'int', '', '', '', '', + 'acctnum', 'varchar', '', $char_d, '', '', + '_password', 'varchar', '', $char_d, '', '', + 'location', 'varchar', 'NULL', $char_d, '', '', + 'cs_receiver', 'int', 'NULL', '', '', '', + 'cs_phonenum', 'varchar', 'NULL', $char_d, '', '', + 'serialnum', 'varchar', 'NULL', $char_d, '', '', #installer (rep) ], 'primary_key' => 'svcnum',