alter table AutomatedTaskPackage
	add constraint PK_AutomatedTaskPackage primary key clustered (AutomatedTaskPackageRevisionGuid)
		

alter table AutomatedTaskPackageNode add 
	constraint PK_AutomatedTaskPackageNode primary key clustered ( AutomatedTaskPackageNodeGuid)
go

alter table AutomatedTaskPackageNotification
	add constraint 
        PK_AutomatedTaskPackageNotification primary key clustered ( AutomatedTaskPackageNotificationGuid)
go

alter table AutomatedTaskPackageAction
	add constraint 
        PK_AutomatedTaskPackageAction primary key clustered ( AutomatedTaskPackageActionGuid)
go

alter table AutomatedTaskPackageScriptParameter add
    constraint PK_AutomatedTaskPackageScriptParameter primary key clustered (AutomatedTaskID, AutomatedTaskPackageNodeGuid,ScriptParameterKey)
go







/* add a new column ScriptRevisionGuid into Script table and mark it as unique */
alter table Script add ScriptRevisionGuid uniqueidentifier   not null 
	constraint ScriptRevisionGuid_Script_DF default(newid())    
	constraint AK_Script_ScriptRevisionGuid  UNIQUE 
go


/*
Adding ScriptName column to the Script table
Needed for Auto task Package execution alert
*/

ALTER TABLE Script
ADD [ScriptName] [nvarchar](50) NULL
GO
