SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF (NOT EXISTS (SELECT * 
                 FROM INFORMATION_SCHEMA.TABLES 
                 WHERE TABLE_SCHEMA = 'dbo' 
                 AND  TABLE_NAME = 'publ_PurchaseOrderStockPickQuoteItemFinal'))
BEGIN
	CREATE TABLE [dbo].[publ_PurchaseOrderStockPickQuoteItemFinal](
		[id] [int] IDENTITY(1,1) NOT NULL,
		[purchaseOrderId] [int] NOT NULL,
		[quoteItemFinalId] [int] NOT NULL,
		[available] INT NULL,
		[picked] INT NULL,
		[outstanding] INT NULL,
		[locationBin] [nvarchar](100) NOT NULL,
	 CONSTRAINT [PK_publ_PurchaseOrderStockPickQuoteItemFinal] 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]
END