UPDATE [AlertType]
   SET [IsSelfHealable] = 1
 WHERE [AlertTypeID] in (301, 303, 304, 305) -- AvVirusDefinitionOutOfDate, AvDisabled, AvDeviceRestartRequired, AvVirusScanOverdue
GO

INSERT INTO [AlertAttributeType]
            ([AlertTypeID]
            ,[AttributeName]
            ,[DataType]
            ,[KeyIndex])
SELECT 303, 'Enabled', 'bool',null
WHERE NOT EXISTS (select AlertAttributeTypeID from AlertAttributeType WHERE AlertTypeID = 303 AND AttributeName = 'Enabled')

GO

INSERT INTO [AlertAttributeType]
            ([AlertTypeID]
            ,[AttributeName]
            ,[DataType]
            ,[KeyIndex])
SELECT 304, 'ScanFinishedTimestampUtc', 'DateTime', null
WHERE NOT EXISTS (select AlertAttributeTypeID from AlertAttributeType WHERE AlertTypeID = 304 and AttributeName = 'ScanFinishedTimestampUtc')
GO

INSERT INTO [AlertAttributeType]
            ([AlertTypeID]
            ,[AttributeName]
            ,[DataType]
            ,[KeyIndex])
SELECT 301, 'OutOfDate', 'bool', null
WHERE NOT EXISTS (select AlertAttributeTypeID from AlertAttributeType WHERE AlertTypeID = 301 and AttributeName = 'OutOfDate')
GO