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


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


desc
@@


1.1
log
@Moved stuff from 1.1.0 migration directory to 1.2.0 directory to reflect actual future versioning.
@
text
@# -----------------------------------------------------------------------
# HELM_ATTRIBUTE_VALUE
# -----------------------------------------------------------------------
drop table if exists HELM_ATTRIBUTE_VALUE;

CREATE TABLE HELM_ATTRIBUTE_VALUE
(
    ENTITY_ID INTEGER NOT NULL,
    ATTRIBUTE_ID INTEGER NOT NULL,
    VALUE MEDIUMTEXT default '' NOT NULL,
    PRIMARY KEY(ENTITY_ID,ATTRIBUTE_ID),
    INDEX(ATTRIBUTE_ID),
    FOREIGN KEY (ATTRIBUTE_ID) REFERENCES HELM_ATTRIBUTE (ATTRIBUTE_ID)
);

#
# Populate role attribute values.
#
DROP TABLE IF EXISTS xxxx_populate_AttributeValue;
CREATE TABLE xxxx_populate_AttributeValue
(
  ENTITY     varchar(255) NOT NULL,
  ROLE       varchar(255) NOT NULL,
  ATTRIBUTE  varchar(255) NOT NULL,
  VALUE      varchar(255) NOT NULL
);

INSERT INTO xxxx_populate_AttributeValue 
     (ROLE, ATTRIBUTE, VALUE) 
VALUES
  ("Observer", "requestable", "Y")
 ,("Developer", "requestable", "Y")
 ,("Content Developer", "requestable", "Y")
 ,("Project Owner", "requestable", "Y")

 ,("Project Owner", "denotesOwnership", "Y")
 ,("Domain Admin", "denotesOwnership", "Y")
 ,("Host Admin", "denotesOwnership", "Y")

 ,("Project Owner", "grantOnProjectCreation", "Y")

 ,("Anonymous Guest", "blockRecursionIntoPrivateProjects", "Y")
 ,("Click-through Viewer", "blockRecursionIntoPrivateProjects", "Y")
 ,("Registered User", "blockRecursionIntoPrivateProjects", "Y")
;

INSERT INTO HELM_ATTRIBUTE_VALUE
 SELECT HELM_ROLE.ROLE_ID, HELM_ATTRIBUTE.ATTRIBUTE_ID, VALUE
  FROM xxxx_populate_AttributeValue, HELM_ROLE, HELM_ATTRIBUTE
   where HELM_ROLE.NAME = xxxx_populate_AttributeValue.ROLE
     and HELM_ATTRIBUTE.ENTITY_TYPE = 'Role'
     and HELM_ATTRIBUTE.NAME = xxxx_populate_AttributeValue.ATTRIBUTE
;
 
DROP TABLE xxxx_populate_AttributeValue;


#
# Populate host attribute values.
INSERT INTO HELM_ATTRIBUTE_VALUE (ATTRIBUTE_ID, ENTITY_ID, VALUE)
 SELECT ATTRIBUTE_ID,
        PROJECT_ID,
        DEFAULT_VALUE
  FROM HELM_ATTRIBUTE, HELM_PROJECT where HELM_PROJECT.TYPE='host' and
	HELM_ATTRIBUTE.ENTITY_TYPE='Host'
;
@
