-- 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 CMOBJECTS ADD COLUMN TENANTID INTEGER DEFAULT 0 NOT NULL;

CREATE TABLE CMTENANTID (
	TENANTID		INTEGER NOT NULL,
	TENANTNAME		VARCHAR(255) NOT NULL,
	CONSTRAINT PK_CMTENANTID PRIMARY KEY (TENANTID),
	CONSTRAINT UN_CMTENANTID_TENANTNAME UNIQUE (TENANTNAME)
)IN CMSCRIPT_CREATE_IN;

CREATE UNIQUE INDEX PK_CMTENANTID ON CMTENANTID (TENANTID) USING STOGROUP CMSCRIPT_STOGROUP;

CREATE UNIQUE INDEX UN_CMTENANTID_TENANTNAME ON CMTENANTID (TENANTNAME) USING STOGROUP CMSCRIPT_STOGROUP;

INSERT INTO CMTENANTID (TENANTID,TENANTNAME) VALUES (0,'');


