if exists(select top 1 1 from sys.columns where name = 'ExternalId' and object_id = object_id('BotSession'))
begin
alter table BotSession alter column ExternalId varchar(100) not null
end