add a key on ( history_action, $primary_key ) to the h_ tables. this should speed...
[freeside.git] / FS / FS / Schema.pm
index 2666c53..9e7b07f 100644 (file)
@@ -192,6 +192,14 @@ sub dbdef_dist {
                         }
                         keys %indices;
 
+    $h_indices{"h_${table}_srckey"} = DBIx::DBSchema::Index->new({
+                                        'name'    => "h_${table}_srckey",
+                                        'unique'  => 0,
+                                        'columns' => [ 'history_action', #right?
+                                                       $tableobj->primary_key,
+                                                     ],
+                                      });
+
     my $h_tableobj = DBIx::DBSchema::Table->new( {
       'name'          => "h_$table",
       'primary_key'   => 'historynum',
@@ -481,6 +489,7 @@ sub tables_hashref {
       'columns' => [
         'billpkgnum', 'serial', '', '', '', '', 
         'pkgnum',  'int', '', '', '', '', 
+        'pkgpart_override',  'int', 'NULL', '', '', '', 
         'invnum',  'int', '', '', '', '', 
         'setup',   @money_type, '', '', 
         'recur',   @money_type, '', '', 
@@ -498,6 +507,7 @@ sub tables_hashref {
         'detailnum', 'serial', '', '', '', '', 
         'pkgnum',  'int', '', '', '', '', 
         'invnum',  'int', '', '', '', '', 
+        'format',  'char', 'NULL', 1, '', '',
         'detail',  'varchar', '', $char_d, '', '', 
       ],
       'primary_key' => 'detailnum',