summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-09-02 10:21:15 -0700
committerIvan Kohler <ivan@freeside.biz>2014-09-02 10:21:15 -0700
commit05056204cf2fb1b216480bf242e9fdc00a3148f6 (patch)
tree664591b3a3899f0d3a5184ab0eb9afe31148bb47
parentb95c330fd8e0acde52b6743274fa003f821a84ef (diff)
parent3317a32f572a2e3605071410e7ddd8082e0b03ee (diff)
Merge branch 'h_cust_main_index_fix' of https://github.com/Jayceh/Freeside
-rw-r--r--FS/FS/Schema.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 2aba2eab5..c635ea0a0 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -243,6 +243,23 @@ sub dbdef_dist {
],
});
+ #necessary for queries that want to look at *who* made changes
+ $h_indices{"h_${table}_usernum"} =
+ DBIx::DBSchema::Index->new({
+ 'name' => "h_${table}_usernum",
+ 'unique' => 0,
+ 'columns' => [ 'history_usernum'],
+ });
+
+ # necessary because of the evil OR username for older data, be really nice if everything was just migrated to usernum and we could drop username
+ # This will not be helpful to mysql, but postgres smartly does a bitmap across both indexes, mysql will just use one
+
+ $h_indices{"h_${table}_username"} =
+ DBIx::DBSchema::Index->new({
+ 'name' => "h_${table}_username",
+ 'unique' => 0,
+ 'columns' => [ 'history_username'],
+ });
}
my $primary_key_col = $tableobj->column($tableobj->primary_key)