IF NOT EXISTS(
    SELECT *
    FROM sys.columns 
    WHERE Name      = N'ExternalSharing'
      AND Object_ID = Object_ID(N'SiteRepositoryConfig'))
BEGIN
	ALTER TABLE [dbo].[SiteRepositoryConfig] ADD ExternalSharing int Not null default(1)
END

IF NOT EXISTS(
    SELECT *
    FROM sys.columns 
    WHERE Name      = N'AddDefaultAssociatedGroups'
      AND Object_ID = Object_ID(N'BA_SiteType'))
BEGIN
	ALTER TABLE [dbo].[BA_SiteType] ADD AddDefaultAssociatedGroups BIT NOT NULL DEFAULT 0;
END;

IF NOT EXISTS(
    SELECT *
    FROM sys.columns 
    WHERE Name      = N'CreateDefaultAssociatedGroups'
      AND Object_ID = Object_ID(N'BA_SiteType'))
BEGIN
	ALTER TABLE [dbo].[BA_SiteType] ADD CreateDefaultAssociatedGroups BIT NOT NULL DEFAULT 1;
END;
