-- Licensed Materials - Property of IBM
--
-- BI and PM: CM
--
-- (C) Copyright IBM Corp. 2008, 2009
--
-- US Government Users Restricted Rights - Use, duplication or disclosure
-- restricted by GSA ADP Schedule Contract with IBM Corp.

-- Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
-- Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).


alter table CMOBJPROPS26 add DELIVOPTIONS clob(1M)

insert into CMOBJPROPS26(CMID) SELECT CMID FROM CMOBJECTS WHERE (CLASSID = 17 OR CLASSID = 39 OR CLASSID = 55 OR CLASSID = 57)  AND (CMID NOT IN (SELECT CMID FROM CMOBJPROPS26))

!RunCMScript CMUpgradeScript_transient_1.xml

!RunCMScript CMUpgradeScript_transient_2.xml

!RunCMScript CMUpgradeScript_cognos_roles1_add.xml

!RunCMScript CMUpgradeScript_cognos_roles1_update.xml

create table CMOBJPROPS30 (
	CMID            integer not null,
	HANDLE          varchar(255),
	BINDING         clob(1M),
	REGISTRATION    clob(64K),
	SERVICEDESCR    clob(1M),
	LAYOUT          clob(1M),
	CONTEXT         clob(64K),
	constraint PK_CMOBJPROPS30 primary key (CMID)
)

insert into CMOBJPROPS30(CMID) SELECT CMID FROM CMOBJECTS WHERE CLASSID=5
	
!RunCMScript CMUpgradeScript_portal_1.xml

!RunCMScript CMUpgradeScript_portal_2.xml

alter table CMOBJPROPS5 add column DETAILTIME timestamp add column DETAIL clob(1M)

insert into CMOBJPROPS5(CMID) SELECT CMID FROM CMOBJECTS WHERE CLASSID=78

CREATE TABLE CMOBJPROPS28 (
	CMID            integer not null,
	EVENTKEY        clob (4000),
	EVENTTYPES      clob (4000),
	constraint PK_CMOBJPROPS28 primary key (CMID) 
)

insert into CMOBJPROPS11(CMID) SELECT CMID FROM CMOBJECTS WHERE CLASSID=78

insert into CMOBJPROPS26(CMID) select CMID from CMOBJECTS WHERE (CLASSID=5 OR CLASSID=50 OR CLASSID=52 OR CLASSID=95 OR CLASSID=96 OR CLASSID=97)

!MigrateRetentionsForHistory

!RunCMScript CMUpgradeScript_adminFolder_add.xml

!RunCMScript CMUpgradeScript_adminFolder_update.xml
