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

alter table CMDATA drop constraint PK_CMDATA

rename table CMDATA to CMDATA_OLD

create table CMDATA (
	CMID			integer not null ,
	CONTENTTYPE		varchar (256),
	DATASIZE		bigint,
	DATACOMP		decimal(1, 0) default 0 not null,
	DATAPROP		blob(1G), 
	constraint PK_CMDATA2 primary key (CMID)
) IN CMSCRIPT_CREATE_IN;

CREATE  UNIQUE  INDEX PK_CMDATA2 ON CMDATA (CMID) USING STOGROUP CMSCRIPT_STOGROUP;

CREATE AUXILIARY TABLE CMATB109
   IN CMSCRIPT_DATABASE.CMSCRIPT_CS_IDCML109
   STORES CMDATA
   COLUMN DATAPROP;

CREATE  UNIQUE  INDEX CMIDX109 ON CMATB109 USING STOGROUP CMSCRIPT_STOGROUP;

insert into CMDATA select * from CMDATA_OLD

drop table CMDATA_OLD

alter table CMOBJPROPS64 drop constraint PK_CMOBJPROPS64

rename table CMOBJPROPS64 to CMOBJPROPS64_OLD

CREATE table CMOBJPROPS64 (
	CMID			integer not null,
	CONTENTTYPE		varchar (256),
	DATASIZE		bigint,
	DATACOMP		decimal(1, 0) default 0 not null,
	DATAPROP		blob(1G), 
	constraint PK_CMOBJPROPS64B primary key (CMID)
)IN CMSCRIPT_CREATE_IN;

CREATE  UNIQUE  INDEX PK_CMOBJPROPS64B ON CMOBJPROPS64 (CMID) USING STOGROUP CMSCRIPT_STOGROUP;

CREATE AUXILIARY TABLE CMATB110
   IN CMSCRIPT_DATABASE.CMSCRIPT_CS_IDCML110
   STORES CMOBJPROPS64
   COLUMN DATAPROP;
 
CREATE  UNIQUE  INDEX CMIDX110 ON CMATB110 USING STOGROUP CMSCRIPT_STOGROUP;

insert into CMOBJPROPS64 select * from CMOBJPROPS64_OLD

drop table CMOBJPROPS64_OLD