-- 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 null

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))

CREATE TABLE CMOBJPROPS28 (
	CMID            number(10) not null,
	EVENTKEY        clob NULL,
	EVENTTYPES      clob NULL,
	constraint PK_CMOBJPROPS28 primary key (CMID) 
)

!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            number(10) NOT NULL ,
	HANDLE          varchar2(255) NULL,
	BINDING         clob NULL,
	REGISTRATION    clob NULL,
	SERVICEDESCR    clob NULL,
	LAYOUT          clob NULL,
	CONTEXT         clob NULL,
	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 (DETAILTIME date null, DETAIL clob null)

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

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