X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=bf84f0b2bc5f1f7be794b479a882514c72703ff2;hp=3e2bb7673b57a07e6bf3e6164058182da01e261f;hb=3545cf7c664f5cd24a5c4e9cf8c7ef368ac51f1f;hpb=e774555a6ae69da65e7774c701232fdf9dd052b1 diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 3e2bb7673..bf84f0b2b 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -197,34 +197,42 @@ sub dbdef_dist { my $tableobj = $dbdef->table($table) or die "unknown table $table"; - my %indices = $tableobj->indices; + my %h_indices = (); + + unless ( $table eq 'cust_event' ) { #others? + + my %indices = $tableobj->indices; - my %h_indices = map { - ( "h_$_" => - DBIx::DBSchema::Index->new({ - 'name' => 'h_'. $indices{$_}->name, - 'unique' => 0, - 'columns' => [ @{$indices{$_}->columns} ], - }) - ); - } - keys %indices; - - $h_indices{"h_${table}_srckey"} = DBIx::DBSchema::Index->new({ - 'name' => "h_${table}_srckey", - 'unique' => 0, - 'columns' => [ 'history_action', #right? - $tableobj->primary_key, - ], - }); - - $h_indices{"h_${table}_srckey2"} = DBIx::DBSchema::Index->new({ - 'name' => "h_${table}_srckey2", - 'unique' => 0, - 'columns' => [ 'history_date', - $tableobj->primary_key, - ], - }); + %h_indices = map { + ( "h_$_" => + DBIx::DBSchema::Index->new({ + 'name' => 'h_'. $indices{$_}->name, + 'unique' => 0, + 'columns' => [ @{$indices{$_}->columns} ], + }) + ); + } + keys %indices; + + $h_indices{"h_${table}_srckey"} = + DBIx::DBSchema::Index->new({ + 'name' => "h_${table}_srckey", + 'unique' => 0, + 'columns' => [ 'history_action', #right? + $tableobj->primary_key, + ], + }); + + $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", @@ -1409,8 +1417,8 @@ sub tables_hashref { 'fcc477map' => { 'columns' => [ - 'formkey', 'varchar', '', '', '', '', - 'formvalue', 'text', 'NULL', '', '', '', + 'formkey', 'varchar', '', 255, '', '', + 'formvalue', 'text', 'NULL', '', '', '', ], 'primary_key' => 'formkey', 'unique' => [], @@ -1436,6 +1444,7 @@ sub tables_hashref { 'cancel', @date_type, '', '', 'expire', @date_type, '', '', 'contract_end', @date_type, '', '', + 'dundate', @date_type, '', '', 'change_date', @date_type, '', '', 'change_pkgnum', 'int', 'NULL', '', '', '', 'change_pkgpart', 'int', 'NULL', '', '', '', @@ -1452,7 +1461,7 @@ sub tables_hashref { [ 'usernum' ], [ 'agent_pkgid' ], ['order_date'], [ 'start_date' ], ['setup'], ['bill'], ['last_bill'], ['susp'], ['adjourn'], ['cancel'], - ['expire'], ['contract_end'], ['change_date'], + ['expire'], ['contract_end'], ['change_date'], ['no_auto'], ], }, @@ -1626,12 +1635,13 @@ sub tables_hashref { 'credit_weight', 'real', 'NULL', '', '', '', 'agentnum', 'int', 'NULL', '', '', '', 'fcc_ds0s', 'int', 'NULL', '', '', '', - 'no_auto', 'char', 'NULL', 1, '', '', + 'no_auto', 'char', 'NULL', 1, '', '', + 'recur_show_zero', 'char', 'NULL', 1, '', '', ], 'primary_key' => 'pkgpart', 'unique' => [], 'index' => [ [ 'promo_code' ], [ 'disabled' ], [ 'classnum' ], - [ 'agentnum' ], + [ 'agentnum' ], ['no_auto'], ], }, @@ -2327,17 +2337,29 @@ sub tables_hashref { 'columns' => [ 'usergroupnum', 'serial', '', '', '', '', 'svcnum', 'int', '', '', '', '', - 'groupname', 'varchar', '', $char_d, '', '', + 'groupname', 'varchar', 'NULL', $char_d, '', '', + 'groupnum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'usergroupnum', 'unique' => [], 'index' => [ [ 'svcnum' ], [ 'groupname' ] ], }, + + 'radius_group' => { + 'columns' => [ + 'groupnum', 'serial', '', '', '', '', + 'groupname', 'varchar', '', $char_d, '', '', + 'description', 'varchar', 'NULL', $char_d, '', '', + ], + 'primary_key' => 'groupnum', + 'unique' => [ ['groupname'] ], + 'index' => [], + }, 'msgcat' => { 'columns' => [ 'msgnum', 'serial', '', '', '', '', - 'msgcode', 'varchar', '', $char_d, '', '', + 'msgcode', 'varchar', '', 255, '', '', 'locale', 'varchar', '', 16, '', '', 'msg', 'text', '', '', '', '', ], @@ -2593,6 +2615,9 @@ sub tables_hashref { 'countrycode', 'varchar', '', 3, '', '', 'npa', 'varchar', 'NULL', 10, '', '', #actually the whole prefix 'nxx', 'varchar', 'NULL', 3, '', '', #actually not used + 'latanum', 'int', 'NULL', '', '', '', + 'state', 'char', 'NULL', 2, '', '', + 'ocn', 'char', 'NULL', 4, '', '', ], 'primary_key' => 'prefixnum', 'unique' => [], @@ -2755,6 +2780,7 @@ sub tables_hashref { 'classname', 'varchar', '', $char_d, '', '', 'categorynum', 'int', 'NULL', '', '', '', 'disabled', 'char', 'NULL', 1, '', '', + 'fcc_ds0s', 'int', 'NULL', '', '', '', ], 'primary_key' => 'classnum', 'unique' => [], @@ -2817,7 +2843,7 @@ sub tables_hashref { 'charged_party', 'varchar', 'NULL', $char_d, '', '', 'upstream_currency', 'char', 'NULL', 3, '', '', - 'upstream_price', 'decimal', 'NULL', '10,2', '', '', + 'upstream_price', 'decimal', 'NULL', '10,4', '', '', 'upstream_rateplanid', 'int', 'NULL', '', '', '', #? # how it was rated internally... @@ -2868,7 +2894,8 @@ sub tables_hashref { 'unique' => [], 'index' => [ [ 'calldate' ], [ 'src' ], [ 'dst' ], [ 'dcontext' ], [ 'charged_party' ], - [ 'accountcode' ], [ 'carrierid' ], [ 'cdrid' ], + [ 'lastapp' ], + ['accountcode'], ['uniqueid'], ['carrierid'], ['cdrid'], [ 'sessionnum' ], [ 'subscriber' ], [ 'freesidestatus' ], [ 'freesiderewritestatus' ], [ 'cdrbatch' ], [ 'cdrbatchnum' ], @@ -3130,6 +3157,7 @@ sub tables_hashref { [ 'exportnum', 'countrycode', 'npa', 'nxx', 'station' ], # # [ 'svcnum' ], [ 'availbatch' ], + [ 'latanum' ], ], }, @@ -3137,6 +3165,7 @@ sub tables_hashref { 'columns' => [ 'latanum', 'int', '', '', '', '', 'description', 'varchar', '', $char_d, '', '', + 'have_usage', 'int', 'NULL', '', '', '', ], 'primary_key' => 'latanum', 'unique' => [], @@ -3183,6 +3212,7 @@ sub tables_hashref { 'ratecenternum', 'int', 'NULL', '', '', '', 'state', 'char', 'NULL', 2, '', '', 'quantity', 'int', '', '', '', '', + 'custnum', 'int', 'NULL', '', '', '', ], 'primary_key' => 'orderitemnum', 'unique' => [], @@ -3353,6 +3383,24 @@ sub tables_hashref { 'index' => [ ['agentnum'], ] }, + 'cust_msg' => { + 'columns' => [ + 'custmsgnum', 'serial', '', '', '', '', + 'custnum', 'int', '', '', '', '', + 'msgnum', 'int', 'NULL', '', '', '', + '_date', @date_type, '', '', + 'env_from', 'varchar', 'NULL', 255, '', '', + 'env_to', 'varchar', 'NULL', 255, '', '', + 'header', 'blob', 'NULL', '', '', '', + 'body', 'blob', 'NULL', '', '', '', + 'error', 'varchar', 'NULL', 255, '', '', + 'status', 'varchar', '',$char_d, '', '', + ], + 'primary_key' => 'custmsgnum', + 'unique' => [ ], + 'index' => [ ['custnum'], ], + }, + 'svc_cert' => { 'columns' => [ 'svcnum', 'int', '', '', '', '',