This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if not exists (select column_name from INFORMATION_SCHEMA.columns where TABLE_SCHEMA = 'dbo' and table_name = 'Deployment' and column_name = 'ChannelId') | |
BEGIN | |
ALTER TABLE dbo.Deployment ADD ChannelId nvarchar(50) NULL | |
END | |
GO | |
| |
-- Update column from json blob. Try to extract rather than joining on Release since it may have changed. | |
UPDATE dbo.Deployment | |
SET ChannelId = c.Id | |
FROM dbo.Deployment d INNER JOIN dbo.Channel c ON d.[JSON] LIKE '%"ChannelID":"' + c.Id + '"%' |