 
 SET IMPLICIT_TRANSACTIONS ON
 
-IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'CSM_APPLICATION') DROP TABLE CSM_APPLICATION;
+--IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'CSM_APPLICATION') DROP TABLE CSM_APPLICATION;
 CREATE TABLE  CSM_APPLICATION  (
    APPLICATION_ID  numeric(20) NOT NULL  identity,
    APPLICATION_NAME  varchar(255) NOT NULL default '',

   APPLICATION_ID  numeric(20) NOT NULL default '0',
   ACTIVE_FLAG  numeric(1,0) NOT NULL default '0',
   UPDATE_DATE  smalldatetime NOT NULL default '2005-01-01',
  PRIMARY KEY  ( ROLE_ID ),
CONSTRAINT UQ_ROLE_ROLE_NAME UNIQUE (APPLICATION_ID , ROLE_NAME)

)  

/* Dumping data for table csm_role*/

SET IDENTITY_INSERT dbo.CSM_ROLE ON
INSERT INTO CSM_ROLE (ROLE_ID,ROLE_NAME,ROLE_DESCRIPTION,APPLICATION_ID,ACTIVE_FLAG,UPDATE_DATE) VALUES (1,'Administrator','Role for Administrator',1,0,0000-00-00);
INSERT INTO CSM_ROLE (ROLE_ID,ROLE_NAME,ROLE_DESCRIPTION,APPLICATION_ID,ACTIVE_FLAG,UPDATE_DATE) VALUES (2,'Supervisor','Role for Supervisor',1,0,0000-00-00);
INSERT INTO CSM_ROLE (ROLE_ID,ROLE_NAME,ROLE_DESCRIPTION,APPLICATION_ID,ACTIVE_FLAG,UPDATE_DATE) VALUES (3,'Technician','Role for Technician',1,0,0000-00-00);

INSERT into CSM_PROTECTION_ELEMENT (PROTECTION_ELEMENT_ID,PROTECTION_ELEMENT_NAME,PROTECTION_ELEMENT_DESCRIPTION,OBJECT_ID,ATTRIBUTE,PROTECTION_ELEMENT_TYPE,APPLICATION_ID,UPDATE_DATE) select max(PROTECTION_ELEMENT_ID)+1,'Consent Tier Status','Consent Tier Status Object','edu.wustl.catissuecore.domain.ConsentTierStatus',NULL,NULL,1,'2006-11-27' from CSM_PROTECTION_ELEMENT;

INSERT into CSM_PROTECTION_ELEMENT (PROTECTION_ELEMENT_ID,PROTECTION_ELEMENT_NAME,PROTECTION_ELEMENT_DESCRIPTION,OBJECT_ID,ATTRIBUTE,PROTECTION_ELEMENT_TYPE,APPLICATION_ID,UPDATE_DATE)  select max(PROTECTION_ELEMENT_ID)+1,'ReturnEventParameters','ReturnEventParameters Class','edu.wustl.catissuecore.domain.ReturnEventParameters',NULL,NULL,1,'2007-01-17' from CSM_PROTECTION_ELEMENT;
SET IDENTITY_INSERT CSM_PROTECTION_ELEMENT OFF
/* done */

--IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'CSM_PROTECTION_GROUP ') DROP TABLE CSM_PROTECTION_GROUP ;
CREATE TABLE  CSM_PROTECTION_GROUP  (
   PROTECTION_GROUP_ID  numeric(20) NOT NULL  identity,
   PROTECTION_GROUP_NAME  varchar(100) NOT NULL default '',
