-- 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 ntext 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           int NOT NULL,
	EVENTKEY       ntext NULL,
	EVENTTYPES     ntext 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            integer not null,
	HANDLE          nvarchar (255) NULL,
	BINDING         ntext NULL,
	REGISTRATION    ntext NULL,
	SERVICEDESCR    ntext NULL,
	LAYOUT          ntext NULL,
	CONTEXT         ntext 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 datetime null, DETAIL ntext 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
