USE [EnVisage]
GO

IF  EXISTS (SELECT * FROM sys.tables where name='StrategicGoal2Project')
set noexec on

CREATE TABLE [dbo].[StrategicGoal2Project](
	[Id] [uniqueidentifier] NOT NULL,
	[ProjectId] [uniqueidentifier] NOT NULL,
	[StrategicGoalId] [uniqueidentifier] NOT NULL,
 CONSTRAINT [PK_StrategicGoal2Project] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[StrategicGoal2Project]  WITH CHECK ADD  CONSTRAINT [FK_StrategicGoal2Project_Project] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[Project] ([Id])
GO

ALTER TABLE [dbo].[StrategicGoal2Project] CHECK CONSTRAINT [FK_StrategicGoal2Project_Project]
GO

ALTER TABLE [dbo].[StrategicGoal2Project]  WITH CHECK ADD  CONSTRAINT [FK_StrategicGoal2Project_StrategicGoal] FOREIGN KEY([StrategicGoalId])
REFERENCES [dbo].[StrategicGoal] ([Id])
GO

ALTER TABLE [dbo].[StrategicGoal2Project] CHECK CONSTRAINT [FK_StrategicGoal2Project_StrategicGoal]
GO


