

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


-------------------------------------------------------------------------------
-- NC305_UPDATE_SYBASE.SQL	       *DO NOT EDIT*		Data Store Version: 305		 
-------------------------------------------------------------------------------

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

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

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

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

DROP TABLE NC_TASK_QUEUE
go

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

CREATE TABLE NC_TASK_QUEUE (
	TASK_ID 			CHAR(20) NOT NULL,
	SERVICE_NAME 		NVARCHAR(40) ,
	SERVER_GROUP 		NVARCHAR(40) ,
	DATE_ENTERED 		NUMERIC NOT NULL,
	TASK 				IMAGE ,
	STATUS 				INTEGER NOT NULL,
	PRIORITY 			INTEGER NOT NULL,
	RESTART_ID          CHAR(20),
	SDS_INSTANCE_ID 	CHAR (32) ,
	HISTORY_STORE_ID 	CHAR (34))
go

CREATE TABLE NC_TASK_PROPERTY (
	TASK_ID 			CHAR (20) NOT NULL,
	PROP_NAME			CHAR (20),
	PROP_VALUE			NVARCHAR(2000))
go

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

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

CREATE INDEX X_NC_TSK_Q_SLTR ON NC_TASK_QUEUE (
	RESTART_ID)
go

CREATE INDEX IX_TSE_ST_MAP ON NC_TSE_STATE_MAP (
	PARENT_ID, SEQ)
go

CREATE INDEX IX_NC_TSK_Q_SLTR ON NC_TASK_QUEUE (
	STATUS, SERVICE_NAME, SERVER_GROUP, DATE_ENTERED)
go

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

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

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

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

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

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

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