X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2FSchema.pm;h=c635ea0a00e8e3843773539df60f709fa42e0635;hb=3317a32f572a2e3605071410e7ddd8082e0b03ee;hp=54c84f75d18cbe9f653dd8fdd82862a3643b4e17;hpb=fc330b9dabbf5094f791c63e44a1e25aa206abb6;p=freeside.git diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index 54c84f75d..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) @@ -6352,7 +6369,7 @@ sub tables_hashref { 'mac_addr', 'varchar', 'NULL', 12, '', '', ], 'primary_key' => 'svcnum', - 'unique' => [], + 'unique' => [ ['serialnum'] , ['mac_addr'] ], 'index' => [], 'foreign_keys' => [ { columns => [ 'svcnum' ],