head	1.2;
access;
symbols;
locks; strict;
comment	@# @;


1.2
date	2001.05.02.20.55.52;	author dlr;	state dead;
branches;
next	1.1;

1.1
date	2001.05.01.21.47.22;	author leonardr;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Deprecated by more general attribute tables.
@
text
@#Create attributes for roles.
drop table if exists HELM_ROLE_ATTRIBUTE_VALUE;

CREATE TABLE HELM_ROLE_ATTRIBUTE_VALUE
(
    ROLE_ID INTEGER NOT NULL,
    ATTRIBUTE_ID INTEGER NOT NULL,
    VALUE LONGTEXT NOT NULL,
    PRIMARY KEY(ROLE_ID,ATTRIBUTE_ID),
    INDEX(ATTRIBUTE_ID),
    FOREIGN KEY (ROLE_ID) REFERENCES HELM_ROLE (ROLE_ID),
    FOREIGN KEY (ATTRIBUTE_ID) REFERENCES HELM_ROLE_ATTRIBUTE (ATTRIBUTE_ID)
);

#Move attributes out of HELM_ROLE columns and into the attribute
#table. Then delete the columns.  
insert into HELM_ROLE_ATTRIBUTE_VALUE
 select HELM_ROLE.ROLE_ID, HELM_ROLE_ATTRIBUTE.ATTRIBUTE_ID, "Y" 
 from HELM_ROLE, HELM_ROLE_ATTRIBUTE
 where 
   (HELM_ROLE_ATTRIBUTE.NAME="requestable" and HELM_ROLE.REQUESTABLE = "Y")
 or
   (HELM_ROLE_ATTRIBUTE.NAME="denotesOwnership" and HELM_ROLE.DENOTES_OWNER = "Y")
;

insert into HELM_ROLE_ATTRIBUTE_VALUE
 select HELM_ROLE.ROLE_ID, HELM_ROLE_ATTRIBUTE.ATTRIBUTE_ID, "Y" 
 from HELM_ROLE, HELM_ROLE_ATTRIBUTE
 where 
   (HELM_ROLE_ATTRIBUTE.NAME="grantOnProjectCreation" and HELM_ROLE.NAME = "Project Owner")
;

#alter table HELM_ROLE drop REQUESTABLE;
#alter table HELM_ROLE drop DENOTES_OWNER;@


1.1
log
@Big architecture and schema change: booleans in the HELM_ROLE table have been replaced by entries in the HELM_ROLE_ATTRIBUTE_VALUE table. Also, a new attribute has been added which controls which roles a user gets upon creation of a project.
@
text
@@

