--****************************************************************************************************
--*
--*	This script will update PS10 cube tables to PS11 web tables.
--*
--*	Privileges needed: member of db_owner or db_ddladmin
--*
--****************************************************************************************************

--****************************************************************************************************
--*		MSP_CUBE_RESOURCES
--****************************************************************************************************

ALTER TABLE dbo.MSP_CUBE_RESOURCES ADD
    	RES_IS_ACTIVE nvarchar(255) NULL
GO

--****************************************************************************************************
--*		MSP_CUBE_TIME_BY_DAY
--****************************************************************************************************

ALTER TABLE dbo.MSP_CUBE_TIME_BY_DAY ALTER COLUMN
    	TIME_QTR nvarchar(32)
GO

--****************************************************************************************************
--*		MSP_CUBE_ASSN_BOOKING
--****************************************************************************************************

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_ASSN_BOOKING') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_ASSN_BOOKING 
GO

CREATE TABLE dbo.MSP_CUBE_ASSN_BOOKING 
(
        ASSN_BOOKING_TYPE smallint NOT NULL,
        ASSN_BOOKING_DESC nvarchar(255) NOT NULL 
)
-- ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

--****************************************************************************************************
--*		MSP_CUBE_ASSN_FACT
--****************************************************************************************************

ALTER TABLE dbo.MSP_CUBE_ASSN_FACT ADD
	ASSN_BOOKING_TYPE smallint NULL DEFAULT 0,
        ASSN_ACTUALWORK_PROTECTED float NULL,
        ASSN_ACTUALOVERTIMEWORK_PROTECTED float NULL
GO

--****************************************************************************************************
--*		MSP_CUBE_RESERVED_CACHED_REDIRECTION_ASSN_CODE
--****************************************************************************************************

IF EXISTS (SELECT * from dbo.sysobjects WHERE id = object_id(N'dbo.MSP_CUBE_RESERVED_CACHED_REDIRECTION_ASSN_CODE') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE dbo.MSP_CUBE_RESERVED_CACHED_REDIRECTION_ASSN_CODE 
GO

CREATE TABLE dbo.MSP_CUBE_RESERVED_CACHED_REDIRECTION_ASSN_CODE
(
	AssnOutlineCodeIndex              int NOT NULL,
	ViewAssnEntOutlineCodeValue       int NOT NULL,
	CubeAssnEntOutlineCodeValue       int NOT NULL,
	CONSTRAINT PK_MSP_CUBE_RESERVED_CACHED_REDIRECTION_ASSN_CODE PRIMARY KEY CLUSTERED (AssnOutlineCodeIndex,ViewAssnEntOutlineCodeValue)
)
-- ON [PRIMARY]
GO



-- End of script