From 43fd7cb9bca3b7521d2729d0e81fbc66c788212c Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Tue, 28 Aug 2007 18:19:22 +0000 Subject: Use acl_entries, not acl_entry, for the ACL table to match the pluralization of other table names. Add indexes and uniqueness constraints and fix the object_history primary key. --- docs/design-schema | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/design-schema b/docs/design-schema index 648c367..8e04f49 100644 --- a/docs/design-schema +++ b/docs/design-schema @@ -35,7 +35,9 @@ Object Metadata ob_downloaded_by varchar(255) default null, ob_downloaded_from varchar(255) default null, ob_downloaded_on datetime default null, - primary key (ob_name, ob_type)); + primary key (ob_name, ob_type), + index (ob_owner), + index (ob_expires)); Object names are not globally unique but only unique within their type, so the table has a joint primary key. I haven't yet decided @@ -47,12 +49,13 @@ Object Metadata create table acls (ac_id integer auto_increment primary key, - ac_name varchar(255) not null); + ac_name varchar(255) not null, + unique index (ac_name)); This just keeps track of unique ACL identifiers. The data is then stored in: - create table acl_entry + create table acl_entries (ae_id integer not null references acls(ac_id), ae_scheme varchar(32) @@ -91,7 +94,7 @@ Object Metadata oh_by varchar(255) not null, oh_from varchar(255) not hull, oh_on datetime not null, - primary key (oh_object, oh_type)); + index (oh_object, oh_type)); For a change of type create, get, store, or destroy, only the action and the trace records (by, from, and on) are stored. For changes to @@ -114,7 +117,8 @@ Object Metadata ah_identifier varchar(255), ah_by varchar(255) not null, ah_from varchar(255) not null, - ah_on datetime not null); + ah_on datetime not null, + index (ah_acl)); For a change of type create or destroy, only the action and the trace records (by, from, and on) are stored. For a change to the lines of -- cgit v1.2.3