if not exists(SELECT 1 FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME='FK_Role_Group_Roles')
	ALTER TABLE [dbo].[Role_Group] ADD CONSTRAINT [FK_Role_Group_Roles] FOREIGN KEY ([Role_Id]) REFERENCES [dbo].[Roles] ([Id])

if not exists(SELECT 1 FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME='FK_Roles_NotificationProfile')
	ALTER TABLE [dbo].[Roles] ADD CONSTRAINT [FK_Roles_NotificationProfile] FOREIGN KEY ([NotificationProfile]) REFERENCES [dbo].[CD_NotificationProfiles] ([ProfileId])

if not exists(SELECT 1 FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME='FK_CD_Panel_Common_Label_CD_Language')
	ALTER TABLE dbo.CD_Panel_Common_Label ADD CONSTRAINT [FK_CD_Panel_Common_Label_CD_Language] FOREIGN KEY ([Language_Code]) REFERENCES [dbo].[CD_Language] ([LanguageCode])

if not exists(SELECT 1 FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME='FK_LanguageCode')
	ALTER TABLE dbo.CD_NotificationMessages WITH NOCHECK ADD CONSTRAINT [FK_LanguageCode] FOREIGN KEY ([LanguageCode]) REFERENCES [dbo].[CD_Language] ([LanguageCode])

if not exists(SELECT 1 FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME='FK_NotificationFormats_LanguageCode')
	ALTER TABLE [dbo].[CD_NotificationFormats] WITH NOCHECK ADD CONSTRAINT [FK_NotificationFormats_LanguageCode] FOREIGN KEY ([LanguageCode]) REFERENCES [dbo].[CD_Language] ([LanguageCode])

if not exists(SELECT 1 FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME='FK_CD_Device_Type_Codes_CD_Language_Codes')
	ALTER TABLE dbo.CD_Device_Type ADD CONSTRAINT [FK_CD_Device_Type_Codes_CD_Language_Codes] FOREIGN KEY ([Language_Code]) REFERENCES [dbo].[CD_Language] ([LanguageCode])

if not exists(SELECT 1 FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME='FK_CD_Communication_Channel_CD_Language')
	ALTER TABLE [dbo].[CD_Communication_Channel] WITH NOCHECK ADD CONSTRAINT [FK_CD_Communication_Channel_CD_Language] FOREIGN KEY ([Language_Code]) REFERENCES [dbo].[CD_Language] ([LanguageCode])

if not exists(SELECT 1 FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME='FK_CD_Panel_Status_CD_Language_Codes')
	ALTER TABLE [dbo].[CD_Panel_Status] WITH NOCHECK ADD CONSTRAINT [FK_CD_Panel_Status_CD_Language_Codes] FOREIGN KEY ([Language_Code]) REFERENCES [dbo].[CD_Language] ([LanguageCode])

if not exists(SELECT 1 FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME='FK_CD_Panel_Type_CD_Language_Codes')
	ALTER TABLE [dbo].[CD_Panel_Type] WITH NOCHECK ADD CONSTRAINT [FK_CD_Panel_Type_CD_Language_Codes] FOREIGN KEY ([Language_Code]) REFERENCES [dbo].[CD_Language] ([LanguageCode])

