summaryrefslogtreecommitdiff
path: root/perl/Wallet/Schema/Result/AclHistory.pm
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2014-07-11 19:26:46 -0700
committerRuss Allbery <rra@stanford.edu>2014-07-11 22:38:17 -0700
commitf1b9938282d80179dc793aadeb123fb7cbed2e45 (patch)
tree364c834daed3daa1857feb41f8a8357ed29365e5 /perl/Wallet/Schema/Result/AclHistory.pm
parent02a629dcc319e418b2f4185acb5bfb22bc86b3eb (diff)
Clean up foreign keys and indices for history tables
Previous versions had erroneous foreign key constraints between the object history table and the objects table. Remove those constraints, and an incorrect linkage in the schema for the ACL history, and add indices for the object type, name, and ACL instead. Change-Id: Ie0ff2448caa82c7a533a1b9ff5c13029bb6ae4ef Reviewed-on: https://gerrit.stanford.edu/1526 Reviewed-by: Russ Allbery <rra@stanford.edu> Tested-by: Russ Allbery <rra@stanford.edu>
Diffstat (limited to 'perl/Wallet/Schema/Result/AclHistory.pm')
-rw-r--r--perl/Wallet/Schema/Result/AclHistory.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/perl/Wallet/Schema/Result/AclHistory.pm b/perl/Wallet/Schema/Result/AclHistory.pm
index d3ef901..11593b7 100644
--- a/perl/Wallet/Schema/Result/AclHistory.pm
+++ b/perl/Wallet/Schema/Result/AclHistory.pm
@@ -1,7 +1,7 @@
# Wallet schema for ACL history.
#
# Written by Jon Robertson <jonrober@stanford.edu>
-# Copyright 2012, 2013
+# Copyright 2012, 2013, 2014
# The Board of Trustees of the Leland Stanford Junior University
#
# See LICENSE for licensing terms.
@@ -103,10 +103,11 @@ __PACKAGE__->add_columns(
);
__PACKAGE__->set_primary_key("ah_id");
-__PACKAGE__->might_have(
- 'acls',
- 'Wallet::Schema::Result::Acl',
- { 'foreign.ac_id' => 'self.ah_id' },
- );
+# Add an index on the ACL.
+sub sqlt_deploy_hook {
+ my ($self, $sqlt_table) = @_;
+ my $name = 'acl_history_idx_ah_acl';
+ $sqlt_table->add_index (name => $name, fields => [qw(ah_acl)]);
+}
1;