summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2011-06-21 02:55:43 +0000
committerivan <ivan>2011-06-21 02:55:43 +0000
commitca12a227e21d6d2597f2dce860604aea02257621 (patch)
treedb8425ba0f2f0490d9a2c3b0358a981a47067153
parent09779e4d81c50373238b08818ef1731c5447784f (diff)
remove unnecessary/bloating indices on h_cust_event, RT#13337
-rw-r--r--FS/FS/Schema.pm62
1 files changed, 35 insertions, 27 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 978a9bff6..65ec2a8b7 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",