

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


-------------------------------------------------------------------------------
-- NC313_UPDATE_MS.SQL	       *DO NOT EDIT*		Data Store Version: 313		 
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$100-- backup create begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$110-- backup inserts begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$130-- views drop begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$140-- tables drop begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$200-- recreate tables begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$202-- primary keys add begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$203-- alter tables begin
-------------------------------------------------------------------------------

ALTER TABLE NC_TASK_HISTORY_DETAIL DROP CONSTRAINT PN_TASK_HD
go

ALTER TABLE NC_TASK_HISTORY_DETAIL ALTER COLUMN TASK_ID CHAR(45) NOT NULL
go

ALTER TABLE NC_TASK_HISTORY_DETAIL ADD CONSTRAINT PN_TASK_HD PRIMARY KEY (TASK_ID,SUB_INDEX)
go

ALTER TABLE NC_TSE_STATE_MAP DROP CONSTRAINT PN_TSE_STATE_MAP
go

ALTER TABLE NC_TSE_STATE_MAP ALTER COLUMN TASK_ID  CHAR(45) NOT NULL
go

ALTER TABLE NC_TSE_STATE_MAP ADD CONSTRAINT PN_TSE_STATE_MAP PRIMARY KEY (TASK_ID)
go

DROP INDEX NC_TSE_STATE_MAP.IX_NC_TSE_STATE_MAP 
go

ALTER TABLE NC_TSE_STATE_MAP ALTER COLUMN PARENT_ID  CHAR(45)
go

CREATE INDEX IX_NC_TSE_STATE_MAP ON NC_TSE_STATE_MAP (PARENT_ID, SEQ)
go

DROP INDEX NC_TASK_QUEUE.X_NC_TASK_QUEUE_SLTR
go

ALTER TABLE NC_TASK_QUEUE DROP CONSTRAINT PN_TASK_QUEUE
go

ALTER TABLE NC_TASK_QUEUE ALTER COLUMN TASK_ID  CHAR(45) NOT NULL
go

ALTER TABLE NC_TASK_QUEUE ALTER COLUMN RESTART_ID CHAR(45) 
go

ALTER TABLE NC_TASK_QUEUE ADD CONSTRAINT PN_TASK_QUEUE PRIMARY KEY (TASK_ID)
go

CREATE INDEX X_NC_TASK_QUEUE_SLTR ON NC_TASK_QUEUE (RESTART_ID)
go

ALTER TABLE NC_TASK_PROPERTY DROP CONSTRAINT PN_TASK_PROPERTY
go

ALTER TABLE NC_TASK_PROPERTY ALTER COLUMN TASK_ID CHAR(45) NOT NULL
go

ALTER TABLE NC_TASK_PROPERTY ALTER COLUMN PROP_NAME CHAR(45) NOT NULL
go

ALTER TABLE NC_TASK_PROPERTY ADD CONSTRAINT PN_TASK_PROPERTY PRIMARY KEY (TASK_ID, PROP_NAME)
go

-------------------------------------------------------------------------------
--$210-- views create begin
-------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$220-- server data inserts begin
-------------------------------------------------------------------------------

INSERT INTO NC_DB_VERSION (DB_VERSION_ID,BUILD) VALUES(313,'build no.')
go

 -------------------------------------------------------------------------------
 --$230-- restore inserts begin
 -------------------------------------------------------------------------------

 -------------------------------------------------------------------------------
 --$250-- backup drop begin
 -------------------------------------------------------------------------------

-------------------------------------------------------------------------------
--$260-- end sql by function
-------------------------------------------------------------------------------
--	END NC313_UPDATE_MS.SQL			*	DO NOT EDIT	 * 		 
-------------------------------------------------------------------------------
