X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FSchema.pm;h=bac52ce7b0ec3208df5d7a606c6f1bee4ff2c24a;hb=5f7fe6b10990eee2d1e8a9608cfd2bb656912477;hp=808006a9b5360226f9c74dfbe896185d2a9cfe8f;hpb=ef398b33e062bbb7a89c527bf4b34d62414c372c;p=freeside.git diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 808006a9b..bac52ce7b 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -193,34 +193,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", @@ -1447,6 +1455,8 @@ sub tables_hashref { 'reason', 'varchar', '', $char_d, '', '', 'payby', 'char', '', 4, '', '', # CARD/BILL/COMP, should # be index into payby + 'recur_show_zero', 'char', 'NULL', 1, '', '', + 'setup_show_zero', 'char', 'NULL', 1, '', '', # table eventually 'payinfo', 'varchar', 'NULL', 512, '', '', #see cust_main above 'paymask', 'varchar', 'NULL', $char_d, '', '', @@ -1630,6 +1640,7 @@ sub tables_hashref { 'pkgpart', 'int', '', '', '', '', 'svcpart', 'int', '', '', '', '', 'quantity', 'int', '', '', '', '', + 'setup_show_zero', 'char', 'NULL', 1, '', '', 'primary_svc','char', 'NULL', 1, '', '', 'hidden', 'char', 'NULL', 1, '', '', ], @@ -2500,6 +2511,7 @@ sub tables_hashref { 'classname', 'varchar', '', $char_d, '', '', 'categorynum', 'int', 'NULL', '', '', '', 'disabled', 'char', 'NULL', 1, '', '', + 'fcc_ds0s', 'int', 'NULL', '', '', '', ], 'primary_key' => 'classnum', 'unique' => [], @@ -2875,6 +2887,7 @@ sub tables_hashref { [ 'exportnum', 'countrycode', 'npa', 'nxx', 'station' ], # # [ 'svcnum' ], [ 'availbatch' ], + [ 'latanum' ], ], }, @@ -2882,6 +2895,7 @@ sub tables_hashref { 'columns' => [ 'latanum', 'int', '', '', '', '', 'description', 'varchar', '', $char_d, '', '', + 'have_usage', 'int', 'NULL', '', '', '', ], 'primary_key' => 'latanum', 'unique' => [], @@ -3138,6 +3152,15 @@ sub tables_hashref { 'index' => [], #recnum }, + 'svc_port' => { + 'columns' => [ + 'svcnum', 'int', '', '', '', '', + ], + 'primary_key' => 'svcnum', + 'unique' => [], + 'index' => [], #recnum + }, + 'areacode' => { 'columns' => [ 'areanum', 'serial', '', '', '', '', @@ -3151,42 +3174,6 @@ sub tables_hashref { 'index' => [], }, - 'nms_device' => { - 'columns' => [ - 'nms_devicenum', 'serial', '', '', '', '', - #'agentnum', 'int', 'NULL', '', '', '', - 'devicename', 'varchar', '', $char_d, '', '', - 'ip', 'varchar', '', 15, '', '', - 'protocol', 'varchar', '', $char_d, '', '', -# 'last', 'int', '', '', '', '', - ], - 'primary_key' => 'nms_devicenum', - 'unique' => [], - 'index' => [], - }, - - 'nms_deviceport' => { - 'columns' => [ - 'portnum', 'serial', '', '', '', '', - 'nms_devicenum', 'int', '', '', '', '', - 'deviceport', 'int', '', '', '', '', - #'ip', 'varchar', 'NULL', 15, '', '', - 'svcnum', 'int', 'NULL', '', '', '', - ], - 'primary_key' => 'portnum', - 'unique' => [ [ 'nms_devicenum', 'deviceport' ] ], - 'index' => [ [ 'svcnum' ] ], - }, - - 'svc_port' => { - 'columns' => [ - 'svcnum', 'int', '', '', '', '', - ], - 'primary_key' => 'svcnum', - 'unique' => [], - 'index' => [], #recnum - }, - # name type nullability length default local