[freeside-commits] freeside/FS/FS Schema.pm,1.239.2.46,1.239.2.47

Ivan,,, ivan at wavetail.420.am
Mon Jun 20 19:55:50 PDT 2011


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv6544

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	Schema.pm 
Log Message:
remove unnecessary/bloating indices on h_cust_event, RT#13337

Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.239.2.46
retrieving revision 1.239.2.47
diff -u -w -d -r1.239.2.46 -r1.239.2.47
--- Schema.pm	12 Jun 2011 05:58:56 -0000	1.239.2.46
+++ Schema.pm	21 Jun 2011 02:55:47 -0000	1.239.2.47
@@ -193,9 +193,13 @@
     my $tableobj = $dbdef->table($table)
       or die "unknown table $table";
 
+    my %h_indices = ();
+
+    unless ( $table eq 'cust_event' ) { #others?
+
     my %indices = $tableobj->indices;
     
-    my %h_indices = map { 
+      %h_indices = map { 
                           ( "h_$_" =>
                               DBIx::DBSchema::Index->new({
                                 'name'    => 'h_'. $indices{$_}->name,
@@ -206,7 +210,8 @@
                         }
                         keys %indices;
 
-    $h_indices{"h_${table}_srckey"} = DBIx::DBSchema::Index->new({
+      $h_indices{"h_${table}_srckey"} =
+        DBIx::DBSchema::Index->new({
                                         'name'    => "h_${table}_srckey",
                                         'unique'  => 0,
                                         'columns' => [ 'history_action', #right?
@@ -214,7 +219,8 @@
                                                      ],
                                       });
 
-    $h_indices{"h_${table}_srckey2"} = DBIx::DBSchema::Index->new({
+      $h_indices{"h_${table}_srckey2"} =
+         DBIx::DBSchema::Index->new({
                                          'name'    => "h_${table}_srckey2",
                                          'unique'  => 0,
                                          'columns' => [ 'history_date',
@@ -222,6 +228,8 @@
                                                       ],
                                        });
 
+    }
+
     my $h_tableobj = DBIx::DBSchema::Table->new( {
       'name'          => "h_$table",
       'primary_key'   => 'historynum',



More information about the freeside-commits mailing list