From b1bd88daea1dde6de9e6a8688c6190cdc0b5c617 Mon Sep 17 00:00:00 2001
From: Russ Allbery <eagle@eyrie.org>
Date: Tue, 15 Jul 2014 20:29:19 -0700
Subject: Record the ACL name in the acl_history table

Store the current name of the ACL with each history row, and index
the name.  This will eventually allow retrieval of history by name
for ACLs that have been deleted, although the rest of the code is
not yet in place.

The initial creation and membership of the ADMIN ACL during database
initialization or reinitialization is no longer recorded in the
acl_history table, since otherwise it produces errors due to the
missing ah_name field when building the database with schema 0.07.
There should be some better solution to this, but this will be okay
for the time being.

Change-Id: I015a00c972e0c2730c3d449952fcfe9b79c6e54f
Reviewed-on: https://gerrit.stanford.edu/1553
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
---
 perl/sql/Wallet-Schema-0.09-MySQL.sql | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'perl/sql/Wallet-Schema-0.09-MySQL.sql')

diff --git a/perl/sql/Wallet-Schema-0.09-MySQL.sql b/perl/sql/Wallet-Schema-0.09-MySQL.sql
index 86eeec4..200b941 100644
--- a/perl/sql/Wallet-Schema-0.09-MySQL.sql
+++ b/perl/sql/Wallet-Schema-0.09-MySQL.sql
@@ -1,6 +1,6 @@
 -- 
 -- Created by SQL::Translator::Producer::MySQL
--- Created on Fri Jul 11 19:17:16 2014
+-- Created on Tue Jul 15 17:41:01 2014
 -- 
 SET foreign_key_checks=0;
 
@@ -12,6 +12,7 @@ DROP TABLE IF EXISTS `acl_history`;
 CREATE TABLE `acl_history` (
   `ah_id` integer NOT NULL auto_increment,
   `ah_acl` integer NOT NULL,
+  `ah_name` varchar(255) NULL,
   `ah_action` varchar(16) NOT NULL,
   `ah_scheme` varchar(32) NULL,
   `ah_identifier` varchar(255) NULL,
@@ -19,6 +20,7 @@ CREATE TABLE `acl_history` (
   `ah_from` varchar(255) NOT NULL,
   `ah_on` datetime NOT NULL,
   INDEX `acl_history_idx_ah_acl` (`ah_acl`),
+  INDEX `acl_history_idx_ah_name` (`ah_name`),
   PRIMARY KEY (`ah_id`)
 );
 
-- 
cgit v1.2.3

