head	1.9;
access;
symbols
	dlr:1.1.1
	HELM_PEER_PORT_BRANCH:1.1.1.1;
locks; strict;
comment	@# @;


1.9
date	2001.03.15.19.48.33;	author leonardr;	state dead;
branches;
next	1.8;

1.8
date	2001.03.15.19.47.07;	author leonardr;	state Exp;
branches;
next	1.7;

1.7
date	2001.03.15.19.39.22;	author dlr;	state dead;
branches;
next	1.6;

1.6
date	2001.03.09.01.24.23;	author leonardr;	state Exp;
branches;
next	1.5;

1.5
date	2001.03.09.00.36.40;	author dlr;	state dead;
branches;
next	1.4;

1.4
date	2001.03.08.03.23.06;	author leonardr;	state Exp;
branches;
next	1.3;

1.3
date	2001.02.24.19.32.44;	author dlr;	state Exp;
branches;
next	1.2;

1.2
date	2001.02.21.01.56.42;	author edk;	state Exp;
branches;
next	1.1;

1.1
date	2001.02.07.22.04.45;	author dlr;	state dead;
branches
	1.1.1.1
	1.1.2.1;
next	;

1.1.1.1
date	2001.02.21.00.36.29;	author dlr;	state Exp;
branches;
next	;

1.1.2.1
date	2001.02.07.22.04.45;	author dlr;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2001.02.09.18.53.40;	author dlr;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2001.02.09.23.26.43;	author dlr;	state Exp;
branches;
next	1.1.2.4;

1.1.2.4
date	2001.02.13.03.01.03;	author dlr;	state Exp;
branches;
next	1.1.2.5;

1.1.2.5
date	2001.02.18.03.56.36;	author jrobbins;	state Exp;
branches;
next	;


desc
@@


1.9
log
@Go away!
@
text
@
--------------------------------------------------------------------------
-- HELM_ACTION
--------------------------------------------------------------------------
drop table if exists HELM_ACTION;

CREATE TABLE HELM_ACTION
(
    ACTION_ID INTEGER NOT NULL AUTO_INCREMENT,
    NAME VARCHAR (99) NOT NULL,
    TYPE VARCHAR (7) default 'Host',
    TAKES_RESOURCE VARCHAR (1) default 'N' NOT NULL,
    AFFECTED_BY_PROJECT_LOCK VARCHAR (1) default 'N' NOT NULL,
    PRIMARY KEY(ACTION_ID),
    UNIQUE (NAME)
  
);

--------------------------------------------------------------------------
-- HELM_AUDIT_LOG_ENTRY
--------------------------------------------------------------------------
drop table if exists HELM_AUDIT_LOG_ENTRY;

CREATE TABLE HELM_AUDIT_LOG_ENTRY
(
    ENTRY_ID INTEGER NOT NULL AUTO_INCREMENT,
    TIMESTAMP TIMESTAMP,
    AFFECTED_TYPE VARCHAR (7) default 'Host' NOT NULL,
    AFFECTED_ID INTEGER NOT NULL,
    INITIATING_USER INTEGER NOT NULL,
    DESCRIPTION LONGTEXT,
    RATIONALE LONGTEXT,
    PRIMARY KEY(ENTRY_ID),
    FOREIGN KEY (INITIATING_USER) REFERENCES HELM_USER (USER_ID)
);

--------------------------------------------------------------------------
-- HELM_DOMAIN
--------------------------------------------------------------------------
drop table if exists HELM_DOMAIN;

CREATE TABLE HELM_DOMAIN
(
    DOMAIN_ID INTEGER NOT NULL AUTO_INCREMENT,
    NAME VARCHAR (255) NOT NULL,
    PRIMARY KEY(DOMAIN_ID),
    UNIQUE (NAME)
  
);

--------------------------------------------------------------------------
-- HELM_INVITATION
--------------------------------------------------------------------------
drop table if exists HELM_INVITATION;

CREATE TABLE HELM_INVITATION
(
    INVITATION_ID INTEGER NOT NULL AUTO_INCREMENT,
    TICKET VARCHAR (255) NOT NULL,
    PROJECT_ID INTEGER NOT NULL,
    INVITATION_DATE TIMESTAMP NOT NULL,
    PRIMARY KEY(INVITATION_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID)
);

--------------------------------------------------------------------------
-- HELM_MAILINGLIST
--------------------------------------------------------------------------
drop table if exists HELM_MAILINGLIST;

CREATE TABLE HELM_MAILINGLIST
(
    MAILINGLIST_ID INTEGER NOT NULL AUTO_INCREMENT,
    PROJECT_ID INTEGER NOT NULL,
    LIST_NAME VARCHAR (64) NOT NULL,
    TYPE VARCHAR (64) NOT NULL,
    IS_PRIVATE VARCHAR (1) default 'N' NOT NULL,
    DESCRIPTION LONGTEXT,
    PRIMARY KEY(MAILINGLIST_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID)
);

--------------------------------------------------------------------------
-- HELM_PROJECT
--------------------------------------------------------------------------
drop table if exists HELM_PROJECT;

CREATE TABLE HELM_PROJECT
(
    PROJECT_ID INTEGER NOT NULL AUTO_INCREMENT,
    DOMAIN_ID INTEGER NOT NULL,
    NAME VARCHAR (64) default '' NOT NULL,
    LICENSE VARCHAR (64),
    SHORT_DESCRIPTION VARCHAR (64),
    LONG_DESCRIPTION LONGTEXT,
    USE_INDEX VARCHAR (1) default 'N' NOT NULL,
    STATUS LONGTEXT default '',
    PROFILE VARCHAR (11) default 'development' NOT NULL,
    TYPE VARCHAR (8) default 'base' NOT NULL,
    ALIAS_URL VARCHAR (128),
    MEMBER_POLICY INTEGER NOT NULL,
    PROPOSED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER NOT NULL,
    IS_PROPRIETARY VARCHAR (1) default 'N' NOT NULL,
    LOCKED VARCHAR (1) default 'N' NOT NULL,
    PRIMARY KEY(PROJECT_ID),
    FOREIGN KEY (DOMAIN_ID) REFERENCES HELM_DOMAIN (DOMAIN_ID),
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

--------------------------------------------------------------------------
-- HELM_PROJECTDOCUMENT
--------------------------------------------------------------------------
drop table if exists HELM_PROJECTDOCUMENT;

CREATE TABLE HELM_PROJECTDOCUMENT
(
    DOCUMENT_ID INTEGER NOT NULL AUTO_INCREMENT,
    PROJECT_ID INTEGER NOT NULL,
    NAME VARCHAR (128) NOT NULL,
    DESCRIPTION LONGTEXT default '',
    TYPE VARCHAR (128) NOT NULL,
    FILE_NAME VARCHAR (128),
    IS_PUBLIC VARCHAR (1) default 'N' NOT NULL,
    MD5 VARCHAR (255),
    SIZE BIGINT NOT NULL,
    UPLOADED_DATE DATE,
    LOCATION VARCHAR (128),
    URL VARCHAR (128),
    TEXT VARCHAR (255),
    PROPOSED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    PRIMARY KEY(DOCUMENT_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

--------------------------------------------------------------------------
-- HELM_PROJECT_DOCUMENT_SECTION
--------------------------------------------------------------------------
drop table if exists HELM_PROJECT_DOCUMENT_SECTION;

CREATE TABLE HELM_PROJECT_DOCUMENT_SECTION
(
    DOCUMENT_ID INTEGER NOT NULL,
    SECTION_ID INTEGER NOT NULL,
    PRIMARY KEY(DOCUMENT_ID,SECTION_ID),
    FOREIGN KEY (DOCUMENT_ID) REFERENCES HELM_PROJECTDOCUMENT (DOCUMENT_ID),
    FOREIGN KEY (SECTION_ID) REFERENCES HELM_PROJECTSECTION (SECTION_ID)
);

--------------------------------------------------------------------------
-- HELM_PROJECTDOWNLOAD
--------------------------------------------------------------------------
drop table if exists HELM_PROJECTDOWNLOAD;

CREATE TABLE HELM_PROJECTDOWNLOAD
(
    DOWNLOAD_ID INTEGER NOT NULL AUTO_INCREMENT,
    PROJECT_ID INTEGER NOT NULL,
    FILE_NAME VARCHAR (128) NOT NULL,
    LOCATION VARCHAR (128) NOT NULL,
    PROPOSED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    IS_PUBLIC VARCHAR (1) default 'N' NOT NULL,
    DESCRIPTION LONGTEXT default '',
    UPLOADED_DATE DATE NOT NULL,
    SIZE BIGINT NOT NULL,
    MD5 VARCHAR (255),
    PRIMARY KEY(DOWNLOAD_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

--------------------------------------------------------------------------
-- HELM_PROJECT_PROJECTGROUP
--------------------------------------------------------------------------
drop table if exists HELM_PROJECT_PROJECTGROUP;

CREATE TABLE HELM_PROJECT_PROJECTGROUP
(
    PROJECT_ID INTEGER NOT NULL,
    PROJECT_GROUP_ID INTEGER NOT NULL,
    PRIMARY KEY(PROJECT_ID,PROJECT_GROUP_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (PROJECT_GROUP_ID) REFERENCES HELM_PROJECT (PROJECT_ID)
);

--------------------------------------------------------------------------
-- HELM_NEWSITEM
--------------------------------------------------------------------------
drop table if exists HELM_NEWSITEM;

CREATE TABLE HELM_NEWSITEM
(
    NEWS_ID INTEGER NOT NULL AUTO_INCREMENT,
    PROJECT_ID INTEGER NOT NULL,
    EVENT_DATE DATE,
    HEADLINE VARCHAR (128) NOT NULL,
    BODY LONGTEXT NOT NULL,
    PROPOSED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER NOT NULL,
    PUBLISH_DATE DATE,
    REMOVE_DATE DATE,
    PRIORITY INTEGER,
    PRIMARY KEY(NEWS_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

--------------------------------------------------------------------------
-- HELM_PROJECTSECTION
--------------------------------------------------------------------------
drop table if exists HELM_PROJECTSECTION;

CREATE TABLE HELM_PROJECTSECTION
(
    SECTION_ID INTEGER NOT NULL AUTO_INCREMENT,
    PARENT_ID INTEGER default NULL,
    PROJECT_ID INTEGER NOT NULL,
    NAME VARCHAR (128) NOT NULL,
    DESCRIPTION VARCHAR (255) default '',
    PROPOSED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    PRIMARY KEY(SECTION_ID),
    FOREIGN KEY (PARENT_ID) REFERENCES HELM_PROJECTSECTION (SECTION_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

--------------------------------------------------------------------------
-- HELM_RESOURCE
--------------------------------------------------------------------------
drop table if exists HELM_RESOURCE;

CREATE TABLE HELM_RESOURCE
(
    RESOURCE_ID INTEGER NOT NULL AUTO_INCREMENT,
    PATTERN VARCHAR (99) NOT NULL,
    DESCRIPTION VARCHAR (99) NOT NULL,
    PRIMARY KEY(RESOURCE_ID),
    UNIQUE (PATTERN)
  
);

--------------------------------------------------------------------------
-- HELM_ROLE
--------------------------------------------------------------------------
drop table if exists HELM_ROLE;

CREATE TABLE HELM_ROLE
(
    ROLE_ID INTEGER NOT NULL AUTO_INCREMENT,
    NAME VARCHAR (99) NOT NULL,
    TYPE VARCHAR (7) default 'Project' NOT NULL,
    DESCRIPTION LONGTEXT,
    DENOTES_OWNER VARCHAR (1) default 'N' NOT NULL,
    REQUESTABLE VARCHAR (1) default 'N' NOT NULL,
    PRIMARY KEY(ROLE_ID),
    UNIQUE (NAME)
  
);

--------------------------------------------------------------------------
-- HELM_ROLE_ACTION_RESOURCE
--------------------------------------------------------------------------
drop table if exists HELM_ROLE_ACTION_RESOURCE;

CREATE TABLE HELM_ROLE_ACTION_RESOURCE
(
    ROLE_ID INTEGER NOT NULL,
    ACTION_ID INTEGER NOT NULL,
    RESOURCE_ID INTEGER NOT NULL,
    PRIMARY KEY(ROLE_ID,ACTION_ID,RESOURCE_ID),
    FOREIGN KEY (ROLE_ID) REFERENCES HELM_ROLE (ROLE_ID),
    FOREIGN KEY (ACTION_ID) REFERENCES HELM_ACTION (ACTION_ID),
    FOREIGN KEY (RESOURCE_ID) REFERENCES HELM_RESOURCE (RESOURCE_ID)
);

--------------------------------------------------------------------------
-- HELM_TASK
--------------------------------------------------------------------------
drop table if exists HELM_TASK;

CREATE TABLE HELM_TASK
(
    TASK_ID INTEGER NOT NULL AUTO_INCREMENT,
    TIMESTAMP TIMESTAMP,
    ON_BEHALF_OF INTEGER NOT NULL,
    COMPONENT VARCHAR (255),
    AFFECTED_OBJECT_ID INTEGER,
    COMMAND LONGTEXT,
    ARGUMENTS LONGTEXT,
    PRIMARY KEY(TASK_ID),
    FOREIGN KEY (ON_BEHALF_OF) REFERENCES HELM_USER (USER_ID)
);

--------------------------------------------------------------------------
-- HELM_USER
--------------------------------------------------------------------------
drop table if exists HELM_USER;

CREATE TABLE HELM_USER
(
    USER_ID INTEGER NOT NULL AUTO_INCREMENT,
    DOMAIN_ID INTEGER NOT NULL,
    LOGIN_NAME VARCHAR (32) NOT NULL,
    PASSWORD VARCHAR (32),
    REAL_NAME VARCHAR (99) NOT NULL,
    ADDRESS1 VARCHAR (32),
    ADDRESS2 VARCHAR (32),
    CITY VARCHAR (32),
    STATE VARCHAR (32),
    POSTALCODE VARCHAR (32),
    COUNTRY VARCHAR (32),
    CITIZENSHIP VARCHAR (32),
    PHONE VARCHAR (32),
    ALTPHONE VARCHAR (32),
    FAX VARCHAR (32),
    CELL VARCHAR (32),
    PAGER VARCHAR (32),
    EMAIL VARCHAR (99),
    ORGANIZATION VARCHAR (99) default '',
    MODIFIED TIMESTAMP,
    CREATED TIMESTAMP,
    TYPE VARCHAR (6) default 'base' NOT NULL,
    PASSWORD_TICKET VARCHAR (255),
    PRIMARY KEY(USER_ID),
    FOREIGN KEY (DOMAIN_ID) REFERENCES HELM_DOMAIN (DOMAIN_ID),
    UNIQUE (LOGIN_NAME, DOMAIN_ID)
  
);

--------------------------------------------------------------------------
-- HELM_USER_USERGROUP
--------------------------------------------------------------------------
drop table if exists HELM_USER_USERGROUP;

CREATE TABLE HELM_USER_USERGROUP
(
    USER_ID INTEGER NOT NULL,
    USER_GROUP_ID INTEGER NOT NULL,
    PRIMARY KEY(USER_ID,USER_GROUP_ID),
    FOREIGN KEY (USER_ID) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (USER_GROUP_ID) REFERENCES HELM_USER (USER_ID)
);

--------------------------------------------------------------------------
-- HELM_USER_PROJECT_INTEREST
--------------------------------------------------------------------------
drop table if exists HELM_USER_PROJECT_INTEREST;

CREATE TABLE HELM_USER_PROJECT_INTEREST
(
    USER_ID INTEGER NOT NULL,
    PROJECT_ID INTEGER NOT NULL,
    PRIMARY KEY(USER_ID,PROJECT_ID),
    FOREIGN KEY (USER_ID) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID)
);

--------------------------------------------------------------------------
-- HELM_USER_ROLE_PROJECT
--------------------------------------------------------------------------
drop table if exists HELM_USER_ROLE_PROJECT;

CREATE TABLE HELM_USER_ROLE_PROJECT
(
    USER_ID INTEGER NOT NULL,
    ROLE_ID INTEGER NOT NULL,
    PROJECT_ID INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    PRIMARY KEY(USER_ID,ROLE_ID,PROJECT_ID),
    FOREIGN KEY (USER_ID) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (ROLE_ID) REFERENCES HELM_ROLE (ROLE_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

--------------------------------------------------------------------------
-- HELM_VC_MAP
--------------------------------------------------------------------------
drop table if exists HELM_VC_MAP;

CREATE TABLE HELM_VC_MAP
(
    MAP_ID INTEGER NOT NULL AUTO_INCREMENT,
    VIEW_ID INTEGER NOT NULL,
    REPOSITORY_DIR LONGTEXT NOT NULL,
    WORKING_DIR LONGTEXT,
    FILE_LIST LONGTEXT,
    PRIMARY KEY(MAP_ID),
    FOREIGN KEY (VIEW_ID) REFERENCES HELM_VC_VIEW (VIEW_ID)
);

--------------------------------------------------------------------------
-- HELM_VC_VIEW
--------------------------------------------------------------------------
drop table if exists HELM_VC_VIEW;

CREATE TABLE HELM_VC_VIEW
(
    VIEW_ID INTEGER NOT NULL AUTO_INCREMENT,
    DOMAIN_ID INTEGER NOT NULL,
    NAME LONGTEXT NOT NULL,
    PRIMARY KEY(VIEW_ID),
    FOREIGN KEY (DOMAIN_ID) REFERENCES HELM_DOMAIN (DOMAIN_ID)
);
@


1.8
log
@Got rid of all references to skins; they'll reappear in some form later on.
@
text
@@


1.7
log
@Goodbye, fair well, I hope never to see you again...
@
text
@a103 1
    SKIN_ID INTEGER,
d109 1
a109 2
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (SKIN_ID) REFERENCES HELM_SKIN (SKIN_ID)
a282 64
);

--------------------------------------------------------------------------
-- HELM_SKIN
--------------------------------------------------------------------------
drop table if exists HELM_SKIN;

CREATE TABLE HELM_SKIN
(
    SKIN_ID INTEGER NOT NULL AUTO_INCREMENT,
    BASE_SKIN INTEGER,
    NAME VARCHAR (127) NOT NULL,
    RESOURCE VARCHAR (255) NOT NULL,
    PRIMARY KEY(SKIN_ID),
    FOREIGN KEY (BASE_SKIN) REFERENCES HELM_SKIN (SKIN_ID),
    UNIQUE (NAME)
  
);

--------------------------------------------------------------------------
-- HELM_SKIN_STYLE_ELEMENT_VALUE
--------------------------------------------------------------------------
drop table if exists HELM_SKIN_STYLE_ELEMENT_VALUE;

CREATE TABLE HELM_SKIN_STYLE_ELEMENT_VALUE
(
    SKIN_ID INTEGER NOT NULL,
    STYLE_ID INTEGER NOT NULL,
    ELEMENT_ID INTEGER NOT NULL,
    VALUE VARCHAR (128) NOT NULL,
    PRIMARY KEY(SKIN_ID,STYLE_ID,ELEMENT_ID),
    FOREIGN KEY (SKIN_ID) REFERENCES HELM_SKIN (SKIN_ID),
    FOREIGN KEY (STYLE_ID) REFERENCES HELM_STYLE (STYLE_ID),
    FOREIGN KEY (ELEMENT_ID) REFERENCES HELM_STYLEELEMENT (ELEMENT_ID)
);

--------------------------------------------------------------------------
-- HELM_STYLE
--------------------------------------------------------------------------
drop table if exists HELM_STYLE;

CREATE TABLE HELM_STYLE
(
    STYLE_ID INTEGER NOT NULL AUTO_INCREMENT,
    NAME VARCHAR (127) NOT NULL,
    DESCRIPTION VARCHAR (255) NOT NULL,
    PRIMARY KEY(STYLE_ID),
    UNIQUE (NAME)
  
);

--------------------------------------------------------------------------
-- HELM_STYLEELEMENT
--------------------------------------------------------------------------
drop table if exists HELM_STYLEELEMENT;

CREATE TABLE HELM_STYLEELEMENT
(
    ELEMENT_ID INTEGER NOT NULL AUTO_INCREMENT,
    HTML_NAME VARCHAR (255),
    CSS_NAME VARCHAR (255),
    ASSOCIATED_HTML_TAG VARCHAR (20),
    DESCRIPTION VARCHAR (255),
    PRIMARY KEY(ELEMENT_ID)
@


1.6
log
@More renaming madness as the act of 'project disabling' becomes 'project locking'
@
text
@@


1.5
log
@Removing Torque-generated file.
@
text
@d13 1
a13 1
    AFFECTED_BY_PROJECT_DISABLE VARCHAR (1) default 'N' NOT NULL,
d106 1
a106 1
    ENABLED VARCHAR (1) default 'Y' NOT NULL,
@


1.4
log
@If we're going to store this in cvs, we might as well store the right version.
@
text
@@


1.3
log
@Latest Torque-generated SQL schema.
@
text
@a1 3

        
            
d12 2
a18 1
            
a36 1
            
a50 1
            
a65 1
            
a82 1
            
d106 1
a113 1
            
a141 1
            
a155 1
            
a179 1
            
a193 1
            
a216 1
            
a237 1
            
a252 1
            
a270 1
            
a286 1
            
a303 1
            
a320 1
            
a335 1
            
a350 1
            
a368 1
            
a404 1
            
a418 1
            
a432 1
            
a450 1
            
a466 1
            
a479 2

    
@


1.2
log
@add new files from the branch to the head (there should be only added
files, ie. no modified files).
@
text
@d36 1
a36 1
    FOREIGN KEY (INITIATING_USER) REFERENCES HELM_USER (USER_ID)  
d82 1
d103 1
a103 1
    STATUS LONGTEXT,
d134 4
a137 1
    LOCATION VARCHAR (128) NOT NULL,
d217 1
a217 1
    APPROVED_BY INTEGER,
d414 1
a414 1
    ORGANIZATION VARCHAR (99),
@


1.1
log
@file helm-schema.sql was initially added on branch HELM_PEER_PORT_BRANCH.
@
text
@d1 502
@


1.1.1.1
log
@Replacing the HEAD with the HELM_PEER_PORT_BRANCH.
@
text
@a0 502


        
            
--------------------------------------------------------------------------
-- HELM_ACTION
--------------------------------------------------------------------------
drop table if exists HELM_ACTION;

CREATE TABLE HELM_ACTION
(
    ACTION_ID INTEGER NOT NULL AUTO_INCREMENT,
    NAME VARCHAR (99) NOT NULL,
    TYPE VARCHAR (7) default 'Host',
    PRIMARY KEY(ACTION_ID),
    UNIQUE (NAME)
  
);

            
--------------------------------------------------------------------------
-- HELM_AUDIT_LOG_ENTRY
--------------------------------------------------------------------------
drop table if exists HELM_AUDIT_LOG_ENTRY;

CREATE TABLE HELM_AUDIT_LOG_ENTRY
(
    ENTRY_ID INTEGER NOT NULL AUTO_INCREMENT,
    TIMESTAMP TIMESTAMP,
    AFFECTED_TYPE VARCHAR (7) default 'Host' NOT NULL,
    AFFECTED_ID INTEGER NOT NULL,
    INITIATING_USER INTEGER NOT NULL,
    DESCRIPTION LONGTEXT,
    RATIONALE LONGTEXT,
    PRIMARY KEY(ENTRY_ID),
    FOREIGN KEY (INITIATING_USER) REFERENCES HELM_USER (USER_ID)  
);

            
--------------------------------------------------------------------------
-- HELM_DOMAIN
--------------------------------------------------------------------------
drop table if exists HELM_DOMAIN;

CREATE TABLE HELM_DOMAIN
(
    DOMAIN_ID INTEGER NOT NULL AUTO_INCREMENT,
    NAME VARCHAR (255) NOT NULL,
    PRIMARY KEY(DOMAIN_ID),
    UNIQUE (NAME)
  
);

            
--------------------------------------------------------------------------
-- HELM_INVITATION
--------------------------------------------------------------------------
drop table if exists HELM_INVITATION;

CREATE TABLE HELM_INVITATION
(
    INVITATION_ID INTEGER NOT NULL AUTO_INCREMENT,
    TICKET VARCHAR (255) NOT NULL,
    PROJECT_ID INTEGER NOT NULL,
    INVITATION_DATE TIMESTAMP NOT NULL,
    PRIMARY KEY(INVITATION_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID)
);

            
--------------------------------------------------------------------------
-- HELM_MAILINGLIST
--------------------------------------------------------------------------
drop table if exists HELM_MAILINGLIST;

CREATE TABLE HELM_MAILINGLIST
(
    MAILINGLIST_ID INTEGER NOT NULL AUTO_INCREMENT,
    PROJECT_ID INTEGER NOT NULL,
    LIST_NAME VARCHAR (64) NOT NULL,
    TYPE VARCHAR (64) NOT NULL,
    DESCRIPTION LONGTEXT,
    PRIMARY KEY(MAILINGLIST_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID)
);

            
--------------------------------------------------------------------------
-- HELM_PROJECT
--------------------------------------------------------------------------
drop table if exists HELM_PROJECT;

CREATE TABLE HELM_PROJECT
(
    PROJECT_ID INTEGER NOT NULL AUTO_INCREMENT,
    DOMAIN_ID INTEGER NOT NULL,
    NAME VARCHAR (64) default '' NOT NULL,
    LICENSE VARCHAR (64),
    SHORT_DESCRIPTION VARCHAR (64),
    LONG_DESCRIPTION LONGTEXT,
    USE_INDEX VARCHAR (1) default 'N' NOT NULL,
    STATUS LONGTEXT,
    PROFILE VARCHAR (11) default 'development' NOT NULL,
    TYPE VARCHAR (8) default 'base' NOT NULL,
    ALIAS_URL VARCHAR (128),
    MEMBER_POLICY INTEGER NOT NULL,
    PROPOSED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER NOT NULL,
    SKIN_ID INTEGER,
    IS_PROPRIETARY VARCHAR (1) default 'N' NOT NULL,
    PRIMARY KEY(PROJECT_ID),
    FOREIGN KEY (DOMAIN_ID) REFERENCES HELM_DOMAIN (DOMAIN_ID),
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (SKIN_ID) REFERENCES HELM_SKIN (SKIN_ID)
);

            
--------------------------------------------------------------------------
-- HELM_PROJECTDOCUMENT
--------------------------------------------------------------------------
drop table if exists HELM_PROJECTDOCUMENT;

CREATE TABLE HELM_PROJECTDOCUMENT
(
    DOCUMENT_ID INTEGER NOT NULL AUTO_INCREMENT,
    PROJECT_ID INTEGER NOT NULL,
    NAME VARCHAR (128) NOT NULL,
    DESCRIPTION LONGTEXT default '',
    TYPE VARCHAR (128) NOT NULL,
    FILE_NAME VARCHAR (128),
    IS_PUBLIC VARCHAR (1) default 'N' NOT NULL,
    LOCATION VARCHAR (128) NOT NULL,
    URL VARCHAR (128),
    TEXT VARCHAR (255),
    PROPOSED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    PRIMARY KEY(DOCUMENT_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_PROJECT_DOCUMENT_SECTION
--------------------------------------------------------------------------
drop table if exists HELM_PROJECT_DOCUMENT_SECTION;

CREATE TABLE HELM_PROJECT_DOCUMENT_SECTION
(
    DOCUMENT_ID INTEGER NOT NULL,
    SECTION_ID INTEGER NOT NULL,
    PRIMARY KEY(DOCUMENT_ID,SECTION_ID),
    FOREIGN KEY (DOCUMENT_ID) REFERENCES HELM_PROJECTDOCUMENT (DOCUMENT_ID),
    FOREIGN KEY (SECTION_ID) REFERENCES HELM_PROJECTSECTION (SECTION_ID)
);

            
--------------------------------------------------------------------------
-- HELM_PROJECTDOWNLOAD
--------------------------------------------------------------------------
drop table if exists HELM_PROJECTDOWNLOAD;

CREATE TABLE HELM_PROJECTDOWNLOAD
(
    DOWNLOAD_ID INTEGER NOT NULL AUTO_INCREMENT,
    PROJECT_ID INTEGER NOT NULL,
    FILE_NAME VARCHAR (128) NOT NULL,
    LOCATION VARCHAR (128) NOT NULL,
    PROPOSED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    IS_PUBLIC VARCHAR (1) default 'N' NOT NULL,
    DESCRIPTION LONGTEXT default '',
    UPLOADED_DATE DATE NOT NULL,
    SIZE BIGINT NOT NULL,
    MD5 VARCHAR (255),
    PRIMARY KEY(DOWNLOAD_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_PROJECT_PROJECTGROUP
--------------------------------------------------------------------------
drop table if exists HELM_PROJECT_PROJECTGROUP;

CREATE TABLE HELM_PROJECT_PROJECTGROUP
(
    PROJECT_ID INTEGER NOT NULL,
    PROJECT_GROUP_ID INTEGER NOT NULL,
    PRIMARY KEY(PROJECT_ID,PROJECT_GROUP_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (PROJECT_GROUP_ID) REFERENCES HELM_PROJECT (PROJECT_ID)
);

            
--------------------------------------------------------------------------
-- HELM_NEWSITEM
--------------------------------------------------------------------------
drop table if exists HELM_NEWSITEM;

CREATE TABLE HELM_NEWSITEM
(
    NEWS_ID INTEGER NOT NULL AUTO_INCREMENT,
    PROJECT_ID INTEGER NOT NULL,
    EVENT_DATE DATE,
    HEADLINE VARCHAR (128) NOT NULL,
    BODY LONGTEXT NOT NULL,
    PROPOSED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    PUBLISH_DATE DATE,
    REMOVE_DATE DATE,
    PRIORITY INTEGER,
    PRIMARY KEY(NEWS_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_PROJECTSECTION
--------------------------------------------------------------------------
drop table if exists HELM_PROJECTSECTION;

CREATE TABLE HELM_PROJECTSECTION
(
    SECTION_ID INTEGER NOT NULL AUTO_INCREMENT,
    PARENT_ID INTEGER default NULL,
    PROJECT_ID INTEGER NOT NULL,
    NAME VARCHAR (128) NOT NULL,
    DESCRIPTION VARCHAR (255) default '',
    PROPOSED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    PRIMARY KEY(SECTION_ID),
    FOREIGN KEY (PARENT_ID) REFERENCES HELM_PROJECTSECTION (SECTION_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_RESOURCE
--------------------------------------------------------------------------
drop table if exists HELM_RESOURCE;

CREATE TABLE HELM_RESOURCE
(
    RESOURCE_ID INTEGER NOT NULL AUTO_INCREMENT,
    PATTERN VARCHAR (99) NOT NULL,
    DESCRIPTION VARCHAR (99) NOT NULL,
    PRIMARY KEY(RESOURCE_ID),
    UNIQUE (PATTERN)
  
);

            
--------------------------------------------------------------------------
-- HELM_ROLE
--------------------------------------------------------------------------
drop table if exists HELM_ROLE;

CREATE TABLE HELM_ROLE
(
    ROLE_ID INTEGER NOT NULL AUTO_INCREMENT,
    NAME VARCHAR (99) NOT NULL,
    TYPE VARCHAR (7) default 'Project' NOT NULL,
    DESCRIPTION LONGTEXT,
    DENOTES_OWNER VARCHAR (1) default 'N' NOT NULL,
    REQUESTABLE VARCHAR (1) default 'N' NOT NULL,
    PRIMARY KEY(ROLE_ID),
    UNIQUE (NAME)
  
);

            
--------------------------------------------------------------------------
-- HELM_ROLE_ACTION_RESOURCE
--------------------------------------------------------------------------
drop table if exists HELM_ROLE_ACTION_RESOURCE;

CREATE TABLE HELM_ROLE_ACTION_RESOURCE
(
    ROLE_ID INTEGER NOT NULL,
    ACTION_ID INTEGER NOT NULL,
    RESOURCE_ID INTEGER NOT NULL,
    PRIMARY KEY(ROLE_ID,ACTION_ID,RESOURCE_ID),
    FOREIGN KEY (ROLE_ID) REFERENCES HELM_ROLE (ROLE_ID),
    FOREIGN KEY (ACTION_ID) REFERENCES HELM_ACTION (ACTION_ID),
    FOREIGN KEY (RESOURCE_ID) REFERENCES HELM_RESOURCE (RESOURCE_ID)
);

            
--------------------------------------------------------------------------
-- HELM_SKIN
--------------------------------------------------------------------------
drop table if exists HELM_SKIN;

CREATE TABLE HELM_SKIN
(
    SKIN_ID INTEGER NOT NULL AUTO_INCREMENT,
    BASE_SKIN INTEGER,
    NAME VARCHAR (127) NOT NULL,
    RESOURCE VARCHAR (255) NOT NULL,
    PRIMARY KEY(SKIN_ID),
    FOREIGN KEY (BASE_SKIN) REFERENCES HELM_SKIN (SKIN_ID),
    UNIQUE (NAME)
  
);

            
--------------------------------------------------------------------------
-- HELM_SKIN_STYLE_ELEMENT_VALUE
--------------------------------------------------------------------------
drop table if exists HELM_SKIN_STYLE_ELEMENT_VALUE;

CREATE TABLE HELM_SKIN_STYLE_ELEMENT_VALUE
(
    SKIN_ID INTEGER NOT NULL,
    STYLE_ID INTEGER NOT NULL,
    ELEMENT_ID INTEGER NOT NULL,
    VALUE VARCHAR (128) NOT NULL,
    PRIMARY KEY(SKIN_ID,STYLE_ID,ELEMENT_ID),
    FOREIGN KEY (SKIN_ID) REFERENCES HELM_SKIN (SKIN_ID),
    FOREIGN KEY (STYLE_ID) REFERENCES HELM_STYLE (STYLE_ID),
    FOREIGN KEY (ELEMENT_ID) REFERENCES HELM_STYLEELEMENT (ELEMENT_ID)
);

            
--------------------------------------------------------------------------
-- HELM_STYLE
--------------------------------------------------------------------------
drop table if exists HELM_STYLE;

CREATE TABLE HELM_STYLE
(
    STYLE_ID INTEGER NOT NULL AUTO_INCREMENT,
    NAME VARCHAR (127) NOT NULL,
    DESCRIPTION VARCHAR (255) NOT NULL,
    PRIMARY KEY(STYLE_ID),
    UNIQUE (NAME)
  
);

            
--------------------------------------------------------------------------
-- HELM_STYLEELEMENT
--------------------------------------------------------------------------
drop table if exists HELM_STYLEELEMENT;

CREATE TABLE HELM_STYLEELEMENT
(
    ELEMENT_ID INTEGER NOT NULL AUTO_INCREMENT,
    HTML_NAME VARCHAR (255),
    CSS_NAME VARCHAR (255),
    ASSOCIATED_HTML_TAG VARCHAR (20),
    DESCRIPTION VARCHAR (255),
    PRIMARY KEY(ELEMENT_ID)
);

            
--------------------------------------------------------------------------
-- HELM_TASK
--------------------------------------------------------------------------
drop table if exists HELM_TASK;

CREATE TABLE HELM_TASK
(
    TASK_ID INTEGER NOT NULL AUTO_INCREMENT,
    TIMESTAMP TIMESTAMP,
    ON_BEHALF_OF INTEGER NOT NULL,
    COMPONENT VARCHAR (255),
    AFFECTED_OBJECT_ID INTEGER,
    COMMAND LONGTEXT,
    ARGUMENTS LONGTEXT,
    PRIMARY KEY(TASK_ID),
    FOREIGN KEY (ON_BEHALF_OF) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_USER
--------------------------------------------------------------------------
drop table if exists HELM_USER;

CREATE TABLE HELM_USER
(
    USER_ID INTEGER NOT NULL AUTO_INCREMENT,
    DOMAIN_ID INTEGER NOT NULL,
    LOGIN_NAME VARCHAR (32) NOT NULL,
    PASSWORD VARCHAR (32),
    REAL_NAME VARCHAR (99) NOT NULL,
    ADDRESS1 VARCHAR (32),
    ADDRESS2 VARCHAR (32),
    CITY VARCHAR (32),
    STATE VARCHAR (32),
    POSTALCODE VARCHAR (32),
    COUNTRY VARCHAR (32),
    CITIZENSHIP VARCHAR (32),
    PHONE VARCHAR (32),
    ALTPHONE VARCHAR (32),
    FAX VARCHAR (32),
    CELL VARCHAR (32),
    PAGER VARCHAR (32),
    EMAIL VARCHAR (99),
    ORGANIZATION VARCHAR (99),
    MODIFIED TIMESTAMP,
    CREATED TIMESTAMP,
    TYPE VARCHAR (6) default 'base' NOT NULL,
    PASSWORD_TICKET VARCHAR (255),
    PRIMARY KEY(USER_ID),
    FOREIGN KEY (DOMAIN_ID) REFERENCES HELM_DOMAIN (DOMAIN_ID),
    UNIQUE (LOGIN_NAME, DOMAIN_ID)
  
);

            
--------------------------------------------------------------------------
-- HELM_USER_USERGROUP
--------------------------------------------------------------------------
drop table if exists HELM_USER_USERGROUP;

CREATE TABLE HELM_USER_USERGROUP
(
    USER_ID INTEGER NOT NULL,
    USER_GROUP_ID INTEGER NOT NULL,
    PRIMARY KEY(USER_ID,USER_GROUP_ID),
    FOREIGN KEY (USER_ID) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (USER_GROUP_ID) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_USER_PROJECT_INTEREST
--------------------------------------------------------------------------
drop table if exists HELM_USER_PROJECT_INTEREST;

CREATE TABLE HELM_USER_PROJECT_INTEREST
(
    USER_ID INTEGER NOT NULL,
    PROJECT_ID INTEGER NOT NULL,
    PRIMARY KEY(USER_ID,PROJECT_ID),
    FOREIGN KEY (USER_ID) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID)
);

            
--------------------------------------------------------------------------
-- HELM_USER_ROLE_PROJECT
--------------------------------------------------------------------------
drop table if exists HELM_USER_ROLE_PROJECT;

CREATE TABLE HELM_USER_ROLE_PROJECT
(
    USER_ID INTEGER NOT NULL,
    ROLE_ID INTEGER NOT NULL,
    PROJECT_ID INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    PRIMARY KEY(USER_ID,ROLE_ID,PROJECT_ID),
    FOREIGN KEY (USER_ID) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (ROLE_ID) REFERENCES HELM_ROLE (ROLE_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_VC_MAP
--------------------------------------------------------------------------
drop table if exists HELM_VC_MAP;

CREATE TABLE HELM_VC_MAP
(
    MAP_ID INTEGER NOT NULL AUTO_INCREMENT,
    VIEW_ID INTEGER NOT NULL,
    REPOSITORY_DIR LONGTEXT NOT NULL,
    WORKING_DIR LONGTEXT,
    FILE_LIST LONGTEXT,
    PRIMARY KEY(MAP_ID),
    FOREIGN KEY (VIEW_ID) REFERENCES HELM_VC_VIEW (VIEW_ID)
);

            
--------------------------------------------------------------------------
-- HELM_VC_VIEW
--------------------------------------------------------------------------
drop table if exists HELM_VC_VIEW;

CREATE TABLE HELM_VC_VIEW
(
    VIEW_ID INTEGER NOT NULL AUTO_INCREMENT,
    DOMAIN_ID INTEGER NOT NULL,
    NAME LONGTEXT NOT NULL,
    PRIMARY KEY(VIEW_ID),
    FOREIGN KEY (DOMAIN_ID) REFERENCES HELM_DOMAIN (DOMAIN_ID)
);

    
@


1.1.2.1
log
@Torque-generated SQL.
@
text
@a0 503


        
            
--------------------------------------------------------------------------
-- HELM_ACTION
--------------------------------------------------------------------------
drop table if exists HELM_ACTION;

CREATE TABLE HELM_ACTION
(
    ACTION_ID INTEGER NOT NULL AUTO_INCREMENT,
    NAME VARCHAR (99) NOT NULL,
    TYPE VARCHAR (7) default 'Host',
    PRIMARY KEY(ACTION_ID),
    UNIQUE (NAME)
  
);

            
--------------------------------------------------------------------------
-- HELM_AUDIT_LOG_ENTRY
--------------------------------------------------------------------------
drop table if exists HELM_AUDIT_LOG_ENTRY;

CREATE TABLE HELM_AUDIT_LOG_ENTRY
(
    ENTRY_ID INTEGER NOT NULL AUTO_INCREMENT,
    TIMESTAMP TIMESTAMP,
    AFFECTED_TYPE VARCHAR (7) default 'Host' NOT NULL,
    AFFECTED_ID INTEGER NOT NULL,
    INITIATING_USER INTEGER NOT NULL,
    DESCRIPTION LONGTEXT,
    RATIONALE LONGTEXT,
    PRIMARY KEY(ENTRY_ID),
    FOREIGN KEY (INITIATING_USER) REFERENCES HELM_USER (USER_ID),
    UNIQUE (AFFECTED_TYPE)
  
);

            
--------------------------------------------------------------------------
-- HELM_DOMAIN
--------------------------------------------------------------------------
drop table if exists HELM_DOMAIN;

CREATE TABLE HELM_DOMAIN
(
    DOMAIN_ID INTEGER NOT NULL AUTO_INCREMENT,
    NAME VARCHAR (255) NOT NULL,
    PRIMARY KEY(DOMAIN_ID),
    UNIQUE (NAME)
  
);

            
--------------------------------------------------------------------------
-- HELM_INVITATION
--------------------------------------------------------------------------
drop table if exists HELM_INVITATION;

CREATE TABLE HELM_INVITATION
(
    INVITATION_ID INTEGER NOT NULL AUTO_INCREMENT,
    TICKET VARCHAR (255) NOT NULL,
    PROJECT_ID INTEGER NOT NULL,
    INVITATION_DATE TIMESTAMP NOT NULL,
    PRIMARY KEY(INVITATION_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID)
);

            
--------------------------------------------------------------------------
-- HELM_MAILINGLIST
--------------------------------------------------------------------------
drop table if exists HELM_MAILINGLIST;

CREATE TABLE HELM_MAILINGLIST
(
    MAILINGLIST_ID INTEGER NOT NULL AUTO_INCREMENT,
    PROJECT_ID INTEGER NOT NULL,
    LIST_NAME VARCHAR (64) NOT NULL,
    TYPE VARCHAR (64) NOT NULL,
    DESCRIPTION LONGTEXT,
    PRIMARY KEY(MAILINGLIST_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID)
);

            
--------------------------------------------------------------------------
-- HELM_PROJECT
--------------------------------------------------------------------------
drop table if exists HELM_PROJECT;

CREATE TABLE HELM_PROJECT
(
    PROJECT_ID INTEGER NOT NULL AUTO_INCREMENT,
    DOMAIN_ID INTEGER NOT NULL,
    NAME VARCHAR (64) default '' NOT NULL,
    LICENSE VARCHAR (64),
    SHORT_DESCRIPTION VARCHAR (64),
    LONG_DESCRIPTION LONGTEXT,
    USE_INDEX VARCHAR (1) default 'false' NOT NULL,
    STATUS LONGTEXT,
    PROFILE VARCHAR (11) default 'development' NOT NULL,
    TYPE VARCHAR (8) default 'base' NOT NULL,
    ALIAS_URL VARCHAR (128),
    MEMBER_POLICY INTEGER NOT NULL,
    PROPOSED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER NOT NULL,
    SKIN_ID INTEGER,
    IS_PROPRIETARY VARCHAR (1) default 'false' NOT NULL,
    PRIMARY KEY(PROJECT_ID),
    FOREIGN KEY (DOMAIN_ID) REFERENCES HELM_DOMAIN (DOMAIN_ID),
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (SKIN_ID) REFERENCES HELM_SKIN (SKIN_ID)
);

            
--------------------------------------------------------------------------
-- HELM_PROJECTDOCUMENT
--------------------------------------------------------------------------
drop table if exists HELM_PROJECTDOCUMENT;

CREATE TABLE HELM_PROJECTDOCUMENT
(
    DOCUMENT_ID INTEGER NOT NULL AUTO_INCREMENT,
    PROJECT_ID INTEGER NOT NULL,
    NAME VARCHAR (128) NOT NULL,
    DESCRIPTION LONGTEXT default '',
    TYPE VARCHAR (128) NOT NULL,
    FILE_NAME VARCHAR (128),
    IS_PUBLIC VARCHAR (1) default 'false' NOT NULL,
    LOCATION VARCHAR (128) NOT NULL,
    URL VARCHAR (128),
    TEXT VARCHAR (255),
    SUGGESTED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    PRIMARY KEY(DOCUMENT_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (SUGGESTED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_PROJECT_DOCUMENT_SECTION
--------------------------------------------------------------------------
drop table if exists HELM_PROJECT_DOCUMENT_SECTION;

CREATE TABLE HELM_PROJECT_DOCUMENT_SECTION
(
    DOCUMENT_ID INTEGER NOT NULL,
    SECTION_ID INTEGER NOT NULL,
    PRIMARY KEY(DOCUMENT_ID,SECTION_ID),
    FOREIGN KEY (DOCUMENT_ID) REFERENCES HELM_PROJECTDOCUMENT (DOCUMENT_ID),
    FOREIGN KEY (SECTION_ID) REFERENCES HELM_PROJECTSECTION (SECTION_ID)
);

            
--------------------------------------------------------------------------
-- HELM_PROJECTDOWNLOAD
--------------------------------------------------------------------------
drop table if exists HELM_PROJECTDOWNLOAD;

CREATE TABLE HELM_PROJECTDOWNLOAD
(
    DOWNLOAD_ID INTEGER NOT NULL AUTO_INCREMENT,
    PROJECT_ID INTEGER NOT NULL,
    FILE_NAME VARCHAR (128) NOT NULL,
    LOCATION VARCHAR (128) NOT NULL,
    SUGGESTED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    IS_PUBLIC VARCHAR (1) default 'false' NOT NULL,
    DESCRIPTION LONGTEXT default '',
    UPLOADED_DATE DATE NOT NULL,
    SIZE BIGINT NOT NULL,
    MD5 VARCHAR (255),
    PRIMARY KEY(DOWNLOAD_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (SUGGESTED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_PROJECT_PROJECTGROUP
--------------------------------------------------------------------------
drop table if exists HELM_PROJECT_PROJECTGROUP;

CREATE TABLE HELM_PROJECT_PROJECTGROUP
(
    PROJECT_ID INTEGER NOT NULL,
    PROJECT_GROUP_ID INTEGER NOT NULL,
    PRIMARY KEY(PROJECT_ID,PROJECT_GROUP_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (PROJECT_GROUP_ID) REFERENCES HELM_PROJECT (PROJECT_ID)
);

            
--------------------------------------------------------------------------
-- HELM_PROJECTNEWS
--------------------------------------------------------------------------
drop table if exists HELM_PROJECTNEWS;

CREATE TABLE HELM_PROJECTNEWS
(
    NEWS_ID INTEGER NOT NULL AUTO_INCREMENT,
    PROJECT_ID INTEGER NOT NULL,
    EVENT_DATE DATE,
    HEADLINE VARCHAR (128) NOT NULL,
    BODY LONGTEXT NOT NULL,
    PROPOSED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    PUBLISH_ON DATE,
    REMOVE_ON DATE,
    PRIORITY INTEGER,
    PRIMARY KEY(NEWS_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_PROJECTSECTION
--------------------------------------------------------------------------
drop table if exists HELM_PROJECTSECTION;

CREATE TABLE HELM_PROJECTSECTION
(
    SECTION_ID INTEGER NOT NULL AUTO_INCREMENT,
    PARENT_ID INTEGER default NULL,
    PROJECT_ID INTEGER NOT NULL,
    NAME VARCHAR (128) NOT NULL,
    DESCRIPTION VARCHAR (255) default '',
    SUGGESTED_BY INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    PRIMARY KEY(SECTION_ID),
    FOREIGN KEY (PARENT_ID) REFERENCES HELM_PROJECTSECTION (SECTION_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (SUGGESTED_BY) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_RESOURCE
--------------------------------------------------------------------------
drop table if exists HELM_RESOURCE;

CREATE TABLE HELM_RESOURCE
(
    RESOURCE_ID INTEGER NOT NULL AUTO_INCREMENT,
    PATTERN VARCHAR (99) NOT NULL,
    DESCRIPTION VARCHAR (99) NOT NULL,
    PRIMARY KEY(RESOURCE_ID),
    UNIQUE (PATTERN)
  
);

            
--------------------------------------------------------------------------
-- HELM_ROLE
--------------------------------------------------------------------------
drop table if exists HELM_ROLE;

CREATE TABLE HELM_ROLE
(
    ROLE_ID INTEGER NOT NULL AUTO_INCREMENT,
    NAME VARCHAR (99) NOT NULL,
    TYPE VARCHAR (7) default 'Project' NOT NULL,
    DESCRIPTION LONGTEXT,
    REQUESTABLE VARCHAR (1) default 'false' NOT NULL,
    PRIMARY KEY(ROLE_ID),
    UNIQUE (NAME)
  
);

            
--------------------------------------------------------------------------
-- HELM_ROLE_ACTION_RESOURCE
--------------------------------------------------------------------------
drop table if exists HELM_ROLE_ACTION_RESOURCE;

CREATE TABLE HELM_ROLE_ACTION_RESOURCE
(
    ROLE_ID INTEGER NOT NULL,
    ACTION_ID INTEGER NOT NULL,
    RESOURCE_ID INTEGER NOT NULL,
    PRIMARY KEY(ROLE_ID,ACTION_ID,RESOURCE_ID),
    FOREIGN KEY (ROLE_ID) REFERENCES HELM_ROLE (ROLE_ID),
    FOREIGN KEY (ACTION_ID) REFERENCES HELM_ACTION (ACTION_ID),
    FOREIGN KEY (RESOURCE_ID) REFERENCES HELM_RESOURCE (RESOURCE_ID)
);

            
--------------------------------------------------------------------------
-- HELM_SKIN
--------------------------------------------------------------------------
drop table if exists HELM_SKIN;

CREATE TABLE HELM_SKIN
(
    SKIN_ID INTEGER NOT NULL AUTO_INCREMENT,
    BASE_SKIN INTEGER,
    NAME VARCHAR (127) NOT NULL,
    RESOURCE VARCHAR (255) NOT NULL,
    PRIMARY KEY(SKIN_ID),
    FOREIGN KEY (BASE_SKIN) REFERENCES HELM_SKIN (SKIN_ID),
    UNIQUE (NAME)
  
);

            
--------------------------------------------------------------------------
-- HELM_SKIN_STYLE_ELEMENT_VALUE
--------------------------------------------------------------------------
drop table if exists HELM_SKIN_STYLE_ELEMENT_VALUE;

CREATE TABLE HELM_SKIN_STYLE_ELEMENT_VALUE
(
    SKIN_ID INTEGER NOT NULL,
    STYLE_ID INTEGER NOT NULL,
    ELEMENT_ID INTEGER NOT NULL,
    VALUE VARCHAR (128) NOT NULL,
    PRIMARY KEY(SKIN_ID,STYLE_ID,ELEMENT_ID),
    FOREIGN KEY (SKIN_ID) REFERENCES HELM_SKIN (SKIN_ID),
    FOREIGN KEY (STYLE_ID) REFERENCES HELM_STYLE (STYLE_ID),
    FOREIGN KEY (ELEMENT_ID) REFERENCES HELM_STYLEELEMENT (ELEMENT_ID)
);

            
--------------------------------------------------------------------------
-- HELM_STYLE
--------------------------------------------------------------------------
drop table if exists HELM_STYLE;

CREATE TABLE HELM_STYLE
(
    STYLE_ID INTEGER NOT NULL AUTO_INCREMENT,
    NAME VARCHAR (127) NOT NULL,
    DESCRIPTION VARCHAR (255) NOT NULL,
    PRIMARY KEY(STYLE_ID),
    UNIQUE (NAME)
  
);

            
--------------------------------------------------------------------------
-- HELM_STYLEELEMENT
--------------------------------------------------------------------------
drop table if exists HELM_STYLEELEMENT;

CREATE TABLE HELM_STYLEELEMENT
(
    ELEMENT_ID INTEGER NOT NULL AUTO_INCREMENT,
    HTML_NAME VARCHAR (255),
    CSS_NAME VARCHAR (255),
    ASSOCIATED_HTML_TAG VARCHAR (20),
    DESCRIPTION VARCHAR (255),
    PRIMARY KEY(ELEMENT_ID)
);

            
--------------------------------------------------------------------------
-- HELM_TASK
--------------------------------------------------------------------------
drop table if exists HELM_TASK;

CREATE TABLE HELM_TASK
(
    TASK_ID INTEGER NOT NULL AUTO_INCREMENT,
    TIMESTAMP TIMESTAMP,
    ON_BEHALF_OF INTEGER NOT NULL,
    COMPONENT VARCHAR (255),
    AFFECTED_OBJECT_ID INTEGER,
    COMMAND LONGTEXT,
    ARGUMENTS LONGTEXT,
    PRIMARY KEY(TASK_ID),
    FOREIGN KEY (ON_BEHALF_OF) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_USER
--------------------------------------------------------------------------
drop table if exists HELM_USER;

CREATE TABLE HELM_USER
(
    USER_ID INTEGER NOT NULL AUTO_INCREMENT,
    DOMAIN_ID INTEGER NOT NULL,
    LOGIN_NAME VARCHAR (32) NOT NULL,
    PASSWORD VARCHAR (32),
    REAL_NAME VARCHAR (99) NOT NULL,
    ADDRESS1 VARCHAR (32),
    ADDRESS2 VARCHAR (32),
    CITY VARCHAR (32),
    STATE VARCHAR (32),
    POSTALCODE VARCHAR (32),
    COUNTRY VARCHAR (32),
    CITIZENSHIP VARCHAR (32),
    PHONE VARCHAR (32),
    ALTPHONE VARCHAR (32),
    FAX VARCHAR (32),
    CELL VARCHAR (32),
    PAGER VARCHAR (32),
    EMAIL VARCHAR (99),
    ORGANIZATION VARCHAR (99),
    MODIFIED TIMESTAMP,
    CREATED TIMESTAMP,
    TYPE VARCHAR (6) default 'base' NOT NULL,
    PASSWORD_TICKET VARCHAR (255),
    PRIMARY KEY(USER_ID),
    FOREIGN KEY (DOMAIN_ID) REFERENCES HELM_DOMAIN (DOMAIN_ID),
    UNIQUE (LOGIN_NAME, DOMAIN_ID)
  
);

            
--------------------------------------------------------------------------
-- HELM_USER_USERGROUP
--------------------------------------------------------------------------
drop table if exists HELM_USER_USERGROUP;

CREATE TABLE HELM_USER_USERGROUP
(
    USER_ID INTEGER NOT NULL,
    USER_GROUP_ID INTEGER NOT NULL,
    PRIMARY KEY(USER_ID,USER_GROUP_ID),
    FOREIGN KEY (USER_ID) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (USER_GROUP_ID) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_USER_PROJECT_INTEREST
--------------------------------------------------------------------------
drop table if exists HELM_USER_PROJECT_INTEREST;

CREATE TABLE HELM_USER_PROJECT_INTEREST
(
    USER_ID INTEGER NOT NULL,
    PROJECT_ID INTEGER NOT NULL,
    PRIMARY KEY(USER_ID,PROJECT_ID),
    FOREIGN KEY (USER_ID) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID)
);

            
--------------------------------------------------------------------------
-- HELM_USER_ROLE_PROJECT
--------------------------------------------------------------------------
drop table if exists HELM_USER_ROLE_PROJECT;

CREATE TABLE HELM_USER_ROLE_PROJECT
(
    USER_ID INTEGER NOT NULL,
    ROLE_ID INTEGER NOT NULL,
    PROJECT_ID INTEGER NOT NULL,
    APPROVED_BY INTEGER,
    PRIMARY KEY(USER_ID,ROLE_ID,PROJECT_ID),
    FOREIGN KEY (USER_ID) REFERENCES HELM_USER (USER_ID),
    FOREIGN KEY (ROLE_ID) REFERENCES HELM_ROLE (ROLE_ID),
    FOREIGN KEY (PROJECT_ID) REFERENCES HELM_PROJECT (PROJECT_ID),
    FOREIGN KEY (APPROVED_BY) REFERENCES HELM_USER (USER_ID)
);

            
--------------------------------------------------------------------------
-- HELM_VC_MAP
--------------------------------------------------------------------------
drop table if exists HELM_VC_MAP;

CREATE TABLE HELM_VC_MAP
(
    MAP_ID INTEGER NOT NULL AUTO_INCREMENT,
    VIEW_ID INTEGER NOT NULL,
    REPOSITORY_DIR LONGTEXT NOT NULL,
    WORKING_DIR LONGTEXT,
    FILE_LIST LONGTEXT,
    PRIMARY KEY(MAP_ID),
    FOREIGN KEY (VIEW_ID) REFERENCES HELM_VC_VIEW (VIEW_ID)
);

            
--------------------------------------------------------------------------
-- HELM_VC_VIEW
--------------------------------------------------------------------------
drop table if exists HELM_VC_VIEW;

CREATE TABLE HELM_VC_VIEW
(
    VIEW_ID INTEGER NOT NULL AUTO_INCREMENT,
    DOMAIN_ID INTEGER NOT NULL,
    NAME LONGTEXT NOT NULL,
    PRIMARY KEY(VIEW_ID,DOMAIN_ID),
    FOREIGN KEY (DOMAIN_ID) REFERENCES HELM_DOMAIN (DOMAIN_ID)
);

    
@


1.1.2.2
log
@Latest generated SQL schema from XML version.
@
text
@d103 1
a103 1
    USE_INDEX VARCHAR (1) default 'N' NOT NULL,
d112 1
a112 1
    IS_PROPRIETARY VARCHAR (1) default 'N' NOT NULL,
d134 1
a134 1
    IS_PUBLIC VARCHAR (1) default 'N' NOT NULL,
d175 1
a175 1
    IS_PUBLIC VARCHAR (1) default 'N' NOT NULL,
d275 1
a275 2
    DENOTES_OWNER VARCHAR (1) default 'N' NOT NULL,
    REQUESTABLE VARCHAR (1) default 'N' NOT NULL,
d499 1
a499 1
    PRIMARY KEY(VIEW_ID),
@


1.1.2.3
log
@New Torque-generated classes.  NewsItem replaces ProjectNews.
@
text
@d203 1
a203 1
-- HELM_NEWSITEM
d205 1
a205 1
drop table if exists HELM_NEWSITEM;
d207 1
a207 1
CREATE TABLE HELM_NEWSITEM
@


1.1.2.4
log
@Latest schema changes from Elicia and John.
@
text
@d138 1
a138 1
    PROPOSED_BY INTEGER NOT NULL,
d142 1
a142 1
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
d173 1
a173 1
    PROPOSED_BY INTEGER NOT NULL,
d182 1
a182 1
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
d216 2
a217 2
    PUBLISH_DATE DATE,
    REMOVE_DATE DATE,
d238 1
a238 1
    PROPOSED_BY INTEGER NOT NULL,
d243 1
a243 1
    FOREIGN KEY (PROPOSED_BY) REFERENCES HELM_USER (USER_ID),
@


1.1.2.5
log
@I dont think affected_type should be unique, this does not seem to match the schema in xml
@
text
@d36 3
a38 1
    FOREIGN KEY (INITIATING_USER) REFERENCES HELM_USER (USER_ID)  
@


