trade space for time
[freeside.git] / FS / FS / Schema.pm
index 0d08aba..b3cce9a 100644 (file)
@@ -200,6 +200,14 @@ sub dbdef_dist {
                                                      ],
                                       });
 
+    $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",
       'primary_key'   => 'historynum',
@@ -519,7 +527,23 @@ sub tables_hashref {
       ],
       'primary_key' => 'detailnum',
       'unique' => [],
-      'index' => [ [ 'billpkgnum' ], [ 'pkgnum', 'invnum' ] ],
+      'index' => [ [ 'billpkgnum' ], [ 'classnum' ], [ 'pkgnum', 'invnum' ] ],
+    },
+
+    'cust_bill_pkg_display' => {
+      'columns' => [
+        'billpkgdisplaynum', 'serial', '', '', '', '', 
+        'billpkgnum', 'int', '', '', '', '', 
+        'section',  'varchar', 'NULL', $char_d, '', '', 
+        #'unitsetup', @money_typen, '', '',     #override the linked real one?
+        #'unitrecur', @money_typen, '', '',     #this too?
+        'post_total', 'char', 'NULL', 1, '', '',
+        'type',       'char', 'NULL', 1, '', '',
+        'summary',    'char', 'NULL', 1, '', '',
+      ],
+      'primary_key' => 'billpkgdisplaynum',
+      'unique' => [],
+      'index' => [ ['billpkgnum'], ],
     },
 
     'cust_credit' => {
@@ -2096,10 +2120,19 @@ sub tables_hashref {
         'state',       'char', 'NULL',  2, '', '', 
         'npa',         'char',     '',  3, '', '', 
         'nxx',         'char', 'NULL',  3, '', '', 
+        'station',     'char', 'NULL',  4, '', '',
+        'svcnum',      'int',     'NULL',      '', '', '',
+        'availbatch', 'varchar', 'NULL', $char_d, '', '',
       ],
       'primary_key' => 'availnum',
       'unique' => [],
-      'index'  => [ [ 'exportnum', 'countrycode', 'state' ] ],
+      'index'  => [ [ 'exportnum', 'countrycode', 'state' ],     #npa search
+                    [ 'exportnum', 'countrycode', 'npa' ],       #nxx search
+                    [ 'exportnum', 'countrycode', 'npa', 'nxx' ],#station search
+                    [ 'exportnum', 'countrycode', 'npa', 'nxx', 'station' ], # #
+                    [ 'svcnum' ],
+                    [ 'availbatch' ],
+                  ],
     },
 
     'reason_type' => {