USE [master]
GO
/****** Object:  Database [TestIF]    Script Date: 9/26/2012 7:47:26 PM ******/
CREATE DATABASE [TestIF]
 CONTAINMENT = NONE
 ON  PRIMARY 
( NAME = N'TestIF', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\TestIF.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'TestIF_log', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\TestIF_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [TestIF] SET COMPATIBILITY_LEVEL = 110
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [TestIF].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [TestIF] SET ANSI_NULL_DEFAULT OFF 
GO
ALTER DATABASE [TestIF] SET ANSI_NULLS OFF 
GO
ALTER DATABASE [TestIF] SET ANSI_PADDING OFF 
GO
ALTER DATABASE [TestIF] SET ANSI_WARNINGS OFF 
GO
ALTER DATABASE [TestIF] SET ARITHABORT OFF 
GO
ALTER DATABASE [TestIF] SET AUTO_CLOSE OFF 
GO
ALTER DATABASE [TestIF] SET AUTO_CREATE_STATISTICS ON 
GO
ALTER DATABASE [TestIF] SET AUTO_SHRINK OFF 
GO
ALTER DATABASE [TestIF] SET AUTO_UPDATE_STATISTICS ON 
GO
ALTER DATABASE [TestIF] SET CURSOR_CLOSE_ON_COMMIT OFF 
GO
ALTER DATABASE [TestIF] SET CURSOR_DEFAULT  GLOBAL 
GO
ALTER DATABASE [TestIF] SET CONCAT_NULL_YIELDS_NULL OFF 
GO
ALTER DATABASE [TestIF] SET NUMERIC_ROUNDABORT OFF 
GO
ALTER DATABASE [TestIF] SET QUOTED_IDENTIFIER OFF 
GO
ALTER DATABASE [TestIF] SET RECURSIVE_TRIGGERS OFF 
GO
ALTER DATABASE [TestIF] SET  DISABLE_BROKER 
GO
ALTER DATABASE [TestIF] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
GO
ALTER DATABASE [TestIF] SET DATE_CORRELATION_OPTIMIZATION OFF 
GO
ALTER DATABASE [TestIF] SET TRUSTWORTHY OFF 
GO
ALTER DATABASE [TestIF] SET ALLOW_SNAPSHOT_ISOLATION OFF 
GO
ALTER DATABASE [TestIF] SET PARAMETERIZATION SIMPLE 
GO
ALTER DATABASE [TestIF] SET READ_COMMITTED_SNAPSHOT OFF 
GO
ALTER DATABASE [TestIF] SET HONOR_BROKER_PRIORITY OFF 
GO
ALTER DATABASE [TestIF] SET RECOVERY SIMPLE 
GO
ALTER DATABASE [TestIF] SET  MULTI_USER 
GO
ALTER DATABASE [TestIF] SET PAGE_VERIFY CHECKSUM  
GO
ALTER DATABASE [TestIF] SET DB_CHAINING OFF 
GO
ALTER DATABASE [TestIF] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
GO
ALTER DATABASE [TestIF] SET TARGET_RECOVERY_TIME = 0 SECONDS 
GO
USE [TestIF]
GO
/****** Object:  Table [dbo].[ArgumentValueListId]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ArgumentValueListId](
	[ArgumentValueListId] [nvarchar](50) NOT NULL,
	[listOrder] [nvarchar](50) NOT NULL,
	[relatedArgumentValueId] [nvarchar](50) NOT NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[AttributeDefinition]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AttributeDefinition](
	[attributeDefinitionId] [nvarchar](50) NOT NULL,
	[longName] [ntext] NOT NULL,
	[description] [ntext] NOT NULL,
	[dateLastUpdated] [datetime] NOT NULL,
	[alternativeID] [ntext] NOT NULL,
	[attributeType] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_Attribute] PRIMARY KEY CLUSTERED 
(
	[attributeDefinitionId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** Object:  Table [dbo].[AttributeDefinitionComposite]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AttributeDefinitionComposite](
	[attributeDefinitionId] [nvarchar](50) NOT NULL,
	[listOrder] [int] NOT NULL,
	[compositeAttributeDefinitionId] [nvarchar](50) NOT NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[AttributeValue]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AttributeValue](
	[attributeValueId] [nvarchar](50) NOT NULL,
	[attributeDefinitionId] [nvarchar](50) NOT NULL,
	[name] [ntext] NULL,
	[description] [ntext] NULL,
	[dateLastUpdated] [datetime] NOT NULL,
	[mimeType] [nvarchar](50) NOT NULL,
	[externalReference] [nvarchar](max) NULL,
	[binaryToTextEncodingType] [nvarchar](50) NOT NULL,
	[theValue] [nvarchar](max) NULL,
 CONSTRAINT [PK_AttributeValue] PRIMARY KEY CLUSTERED 
(
	[attributeValueId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** Object:  Table [dbo].[AttributeValueComposite]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AttributeValueComposite](
	[attributeValueID] [nvarchar](50) NOT NULL,
	[CompositeAttributeDefinitionId] [nvarchar](50) NULL,
	[compositAttributeValueID] [nvarchar](50) NOT NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[Enumerations]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Enumerations](
	[enumerationName] [nvarchar](50) NOT NULL,
	[enumerationValue] [ntext] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** Object:  Table [dbo].[ExpectedResultListId]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ExpectedResultListId](
	[expecteResultListId] [nvarchar](50) NOT NULL,
	[listOrder] [nvarchar](50) NOT NULL,
	[relatedExpectedResultId] [nvarchar](50) NOT NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[ListItems]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ListItems](
	[testObjectListID] [nvarchar](50) NOT NULL,
	[listOrder] [int] NOT NULL,
	[relatedTestObjectID] [nvarchar](50) NOT NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[SequenceStep]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SequenceStep](
	[sequenceStepId] [nvarchar](50) NOT NULL,
	[testObjectId] [nvarchar](50) NOT NULL,
	[relatedArgumentValueListId] [nvarchar](50) NOT NULL,
	[relatedExpectedResultListId] [nvarchar](50) NOT NULL,
	[errorImpact] [nvarchar](50) NOT NULL,
	[nextTestSequenceListID] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_SequenceStep] PRIMARY KEY CLUSTERED 
(
	[sequenceStepId] 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
/****** Object:  Table [dbo].[SequenceStepArgumentList]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[SequenceStepArgumentList](
	[sequenceStepArgumentListID] [nvarchar](50) NOT NULL,
	[listOrder] [int] NOT NULL,
	[relatedArgumentValueID] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_SequenceStepArgumentList] PRIMARY KEY CLUSTERED 
(
	[sequenceStepArgumentListID] 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
/****** Object:  Table [dbo].[TestIFHeader]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TestIFHeader](
	[title] [nvarchar](50) NOT NULL,
	[comment] [text] NULL,
	[dateCreated] [datetime] NOT NULL,
	[testIFID] [nvarchar](50) NOT NULL,
	[repositoryId] [nvarchar](50) NOT NULL,
	[testIFVersion] [nvarchar](50) NOT NULL,
	[sourceToolID] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_TestIFHeader] PRIMARY KEY CLUSTERED 
(
	[testIFID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** Object:  Table [dbo].[TestObject]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TestObject](
	[testObjectId] [nvarchar](50) NOT NULL,
	[longName] [nvarchar](50) NOT NULL,
	[description] [text] NOT NULL,
	[dateLastUpdated] [datetime] NOT NULL,
	[testObjectType] [nvarchar](50) NOT NULL,
	[alternativeID] [nvarchar](50) NULL,
 CONSTRAINT [PK_TestObjects] PRIMARY KEY CLUSTERED 
(
	[testObjectId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** Object:  Table [dbo].[TestObjectAttributeValueListItems]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TestObjectAttributeValueListItems](
	[testObjectID] [nvarchar](50) NOT NULL,
	[listOrder] [int] NOT NULL,
	[attributeValueId] [nvarchar](50) NOT NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[TestObjectList]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TestObjectList](
	[testObjectListID] [nvarchar](50) NOT NULL,
	[longName] [text] NOT NULL,
	[description] [text] NOT NULL,
	[dateLastUpdated] [datetime] NOT NULL,
	[TestObjectID] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_TestObjectList] PRIMARY KEY CLUSTERED 
(
	[testObjectListID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** Object:  Table [dbo].[TestRun]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TestRun](
	[testRuntId] [nvarchar](50) NOT NULL,
	[longName] [nvarchar](50) NOT NULL,
	[description] [text] NOT NULL,
	[dateLastUpdated] [datetime] NOT NULL,
	[alternativeID] [nvarchar](50) NULL,
	[startTestObject] [nvarchar](50) NOT NULL,
	[runStartTime] [datetime] NOT NULL,
	[runCompleteTime] [datetime] NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** Object:  Table [dbo].[TestSequence]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TestSequence](
	[testSequenceId] [nvarchar](50) NOT NULL,
	[name] [nvarchar](50) NOT NULL,
	[description] [text] NOT NULL,
	[dateLastUpdated] [datetime] NOT NULL,
	[testObjectID] [nvarchar](50) NOT NULL,
	[firstTestSequencedListID] [nvarchar](50) NOT NULL,
 CONSTRAINT [PK_TestSequence] PRIMARY KEY CLUSTERED 
(
	[testSequenceId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** Object:  Table [dbo].[TestSequenceList]    Script Date: 9/26/2012 7:47:26 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[TestSequenceList](
	[testSequenceListId] [nvarchar](50) NOT NULL,
	[sequenceStepID] [nvarchar](50) NOT NULL,
	[listOrder] [int] NOT NULL,
 CONSTRAINT [PK_TestSequenceListItems_1] PRIMARY KEY CLUSTERED 
(
	[testSequenceListId] 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
SET ANSI_PADDING ON

GO
/****** Object:  Index [IX_TestSequenceListItems]    Script Date: 9/26/2012 7:47:26 PM ******/
CREATE NONCLUSTERED INDEX [IX_TestSequenceListItems] ON [dbo].[TestSequenceList]
(
	[sequenceStepID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AttributeDefinition] ADD  CONSTRAINT [DF_AttributeDefinition_dateLastUpdated]  DEFAULT ('9/20/2012 12:00:00') FOR [dateLastUpdated]
GO
ALTER TABLE [dbo].[AttributeDefinition] ADD  CONSTRAINT [DF_AttributeDefinition_alternativeID]  DEFAULT (N'na') FOR [alternativeID]
GO
ALTER TABLE [dbo].[AttributeDefinition] ADD  CONSTRAINT [DF_AttributeDefinition_attributeType]  DEFAULT (N'string') FOR [attributeType]
GO
ALTER TABLE [dbo].[AttributeValue] ADD  CONSTRAINT [DF_AttributeValue_attributeValueId]  DEFAULT (N'org.omg.av.') FOR [attributeValueId]
GO
ALTER TABLE [dbo].[AttributeValue] ADD  CONSTRAINT [DF_AttributeValue_description]  DEFAULT (N'na') FOR [description]
GO
ALTER TABLE [dbo].[AttributeValue] ADD  CONSTRAINT [DF_AttributeValue_dateLastUpdated]  DEFAULT (getdate()) FOR [dateLastUpdated]
GO
ALTER TABLE [dbo].[AttributeValue] ADD  CONSTRAINT [DF_AttributeValue_mimeType]  DEFAULT (N'string') FOR [mimeType]
GO
ALTER TABLE [dbo].[AttributeValue] ADD  CONSTRAINT [DF_AttributeValue_binaryToTextEncodingType]  DEFAULT (N'Base 64') FOR [binaryToTextEncodingType]
GO
ALTER TABLE [dbo].[ArgumentValueListId]  WITH CHECK ADD  CONSTRAINT [FK_ArgumentValueListId_AttributeValue] FOREIGN KEY([ArgumentValueListId])
REFERENCES [dbo].[AttributeValue] ([attributeValueId])
GO
ALTER TABLE [dbo].[ArgumentValueListId] CHECK CONSTRAINT [FK_ArgumentValueListId_AttributeValue]
GO
ALTER TABLE [dbo].[ArgumentValueListId]  WITH CHECK ADD  CONSTRAINT [FK_ArgumentValueListId_SequenceStep] FOREIGN KEY([ArgumentValueListId])
REFERENCES [dbo].[SequenceStep] ([sequenceStepId])
GO
ALTER TABLE [dbo].[ArgumentValueListId] CHECK CONSTRAINT [FK_ArgumentValueListId_SequenceStep]
GO
ALTER TABLE [dbo].[AttributeDefinitionComposite]  WITH CHECK ADD  CONSTRAINT [FK_AttributeDefinitionComposite_AttributeDefinition] FOREIGN KEY([attributeDefinitionId])
REFERENCES [dbo].[AttributeDefinition] ([attributeDefinitionId])
GO
ALTER TABLE [dbo].[AttributeDefinitionComposite] CHECK CONSTRAINT [FK_AttributeDefinitionComposite_AttributeDefinition]
GO
ALTER TABLE [dbo].[AttributeDefinitionComposite]  WITH CHECK ADD  CONSTRAINT [FK_AttributeDefinitionComposite_AttributeDefinition1] FOREIGN KEY([compositeAttributeDefinitionId])
REFERENCES [dbo].[AttributeDefinition] ([attributeDefinitionId])
GO
ALTER TABLE [dbo].[AttributeDefinitionComposite] CHECK CONSTRAINT [FK_AttributeDefinitionComposite_AttributeDefinition1]
GO
ALTER TABLE [dbo].[AttributeValue]  WITH CHECK ADD  CONSTRAINT [FK_AttributeValue_Attribute] FOREIGN KEY([attributeDefinitionId])
REFERENCES [dbo].[AttributeDefinition] ([attributeDefinitionId])
GO
ALTER TABLE [dbo].[AttributeValue] CHECK CONSTRAINT [FK_AttributeValue_Attribute]
GO
ALTER TABLE [dbo].[AttributeValueComposite]  WITH CHECK ADD  CONSTRAINT [FK_AttributeValueComposite_AttributeDefinition] FOREIGN KEY([CompositeAttributeDefinitionId])
REFERENCES [dbo].[AttributeDefinition] ([attributeDefinitionId])
GO
ALTER TABLE [dbo].[AttributeValueComposite] CHECK CONSTRAINT [FK_AttributeValueComposite_AttributeDefinition]
GO
ALTER TABLE [dbo].[AttributeValueComposite]  WITH CHECK ADD  CONSTRAINT [FK_AttributeValueComposite_AttributeValue] FOREIGN KEY([attributeValueID])
REFERENCES [dbo].[AttributeValue] ([attributeValueId])
GO
ALTER TABLE [dbo].[AttributeValueComposite] CHECK CONSTRAINT [FK_AttributeValueComposite_AttributeValue]
GO
ALTER TABLE [dbo].[AttributeValueComposite]  WITH CHECK ADD  CONSTRAINT [FK_AttributeValueComposite_AttributeValue1] FOREIGN KEY([compositAttributeValueID])
REFERENCES [dbo].[AttributeValue] ([attributeValueId])
GO
ALTER TABLE [dbo].[AttributeValueComposite] CHECK CONSTRAINT [FK_AttributeValueComposite_AttributeValue1]
GO
ALTER TABLE [dbo].[ExpectedResultListId]  WITH CHECK ADD  CONSTRAINT [FK_ExpectedResultIdList_AttributeValue] FOREIGN KEY([relatedExpectedResultId])
REFERENCES [dbo].[AttributeValue] ([attributeValueId])
GO
ALTER TABLE [dbo].[ExpectedResultListId] CHECK CONSTRAINT [FK_ExpectedResultIdList_AttributeValue]
GO
ALTER TABLE [dbo].[ExpectedResultListId]  WITH CHECK ADD  CONSTRAINT [FK_ExpectedResultIdList_SequenceStep] FOREIGN KEY([expecteResultListId])
REFERENCES [dbo].[SequenceStep] ([sequenceStepId])
GO
ALTER TABLE [dbo].[ExpectedResultListId] CHECK CONSTRAINT [FK_ExpectedResultIdList_SequenceStep]
GO
ALTER TABLE [dbo].[ListItems]  WITH CHECK ADD  CONSTRAINT [FK_TestObjectListItems_TestObjectList] FOREIGN KEY([testObjectListID])
REFERENCES [dbo].[TestObjectList] ([testObjectListID])
GO
ALTER TABLE [dbo].[ListItems] CHECK CONSTRAINT [FK_TestObjectListItems_TestObjectList]
GO
ALTER TABLE [dbo].[ListItems]  WITH CHECK ADD  CONSTRAINT [FK_TestObjectListItems_TestObjects1] FOREIGN KEY([relatedTestObjectID])
REFERENCES [dbo].[TestObject] ([testObjectId])
GO
ALTER TABLE [dbo].[ListItems] CHECK CONSTRAINT [FK_TestObjectListItems_TestObjects1]
GO
ALTER TABLE [dbo].[SequenceStep]  WITH CHECK ADD  CONSTRAINT [FK_SequenceStep_SequenceStepArgumentList] FOREIGN KEY([relatedArgumentValueListId])
REFERENCES [dbo].[SequenceStepArgumentList] ([sequenceStepArgumentListID])
GO
ALTER TABLE [dbo].[SequenceStep] CHECK CONSTRAINT [FK_SequenceStep_SequenceStepArgumentList]
GO
ALTER TABLE [dbo].[SequenceStep]  WITH CHECK ADD  CONSTRAINT [FK_SequenceStep_TestObjects] FOREIGN KEY([testObjectId])
REFERENCES [dbo].[TestObject] ([testObjectId])
GO
ALTER TABLE [dbo].[SequenceStep] CHECK CONSTRAINT [FK_SequenceStep_TestObjects]
GO
ALTER TABLE [dbo].[SequenceStep]  WITH CHECK ADD  CONSTRAINT [FK_SequenceStep_TestSequenceList] FOREIGN KEY([nextTestSequenceListID])
REFERENCES [dbo].[TestSequenceList] ([testSequenceListId])
GO
ALTER TABLE [dbo].[SequenceStep] CHECK CONSTRAINT [FK_SequenceStep_TestSequenceList]
GO
ALTER TABLE [dbo].[TestObjectAttributeValueListItems]  WITH CHECK ADD  CONSTRAINT [FK_TestObjectAttributeValueListItems_AttributeValue] FOREIGN KEY([attributeValueId])
REFERENCES [dbo].[AttributeValue] ([attributeValueId])
GO
ALTER TABLE [dbo].[TestObjectAttributeValueListItems] CHECK CONSTRAINT [FK_TestObjectAttributeValueListItems_AttributeValue]
GO
ALTER TABLE [dbo].[TestObjectAttributeValueListItems]  WITH CHECK ADD  CONSTRAINT [FK_TestObjectAttributeValueListItems_TestObjects] FOREIGN KEY([testObjectID])
REFERENCES [dbo].[TestObject] ([testObjectId])
GO
ALTER TABLE [dbo].[TestObjectAttributeValueListItems] CHECK CONSTRAINT [FK_TestObjectAttributeValueListItems_TestObjects]
GO
ALTER TABLE [dbo].[TestObjectList]  WITH CHECK ADD  CONSTRAINT [FK_TestObjectList_TestObjects] FOREIGN KEY([TestObjectID])
REFERENCES [dbo].[TestObject] ([testObjectId])
GO
ALTER TABLE [dbo].[TestObjectList] CHECK CONSTRAINT [FK_TestObjectList_TestObjects]
GO
ALTER TABLE [dbo].[TestSequence]  WITH CHECK ADD  CONSTRAINT [FK_TestSequence_TestObjects] FOREIGN KEY([testObjectID])
REFERENCES [dbo].[TestObject] ([testObjectId])
GO
ALTER TABLE [dbo].[TestSequence] CHECK CONSTRAINT [FK_TestSequence_TestObjects]
GO
ALTER TABLE [dbo].[TestSequence]  WITH CHECK ADD  CONSTRAINT [FK_TestSequence_TestSequenceList] FOREIGN KEY([firstTestSequencedListID])
REFERENCES [dbo].[TestSequenceList] ([testSequenceListId])
GO
ALTER TABLE [dbo].[TestSequence] CHECK CONSTRAINT [FK_TestSequence_TestSequenceList]
GO
ALTER TABLE [dbo].[TestSequenceList]  WITH CHECK ADD  CONSTRAINT [FK_TestSequenceList_SequenceStep] FOREIGN KEY([sequenceStepID])
REFERENCES [dbo].[SequenceStep] ([sequenceStepId])
GO
ALTER TABLE [dbo].[TestSequenceList] CHECK CONSTRAINT [FK_TestSequenceList_SequenceStep]
GO
USE [master]
GO
ALTER DATABASE [TestIF] SET  READ_WRITE 
GO
