﻿CREATE TABLE [dbo].[WorkOrderComponent_Hist]
(
	[UniqueID] BIGINT NOT NULL,
	[WorkOrderNumber] BIGINT NOT NULL, 
    [LotNumber] VARCHAR(30) NOT NULL, 
	[BranchCode] VARCHAR(12) NULL,
    [ShortItemNumber] BIGINT NOT NULL,
	[Quantity] DECIMAL(15,2) NOT NULL,
	[LastUpdateDT] DATETIME NOT NULL, 
    CONSTRAINT [PK_WorkOrderComponent_Hist] PRIMARY KEY CLUSTERED([UniqueID])
)
GO

CREATE INDEX [IX_WorkOrderComponent_Hist_WorkOrderNumber] ON [dbo].[WorkOrderComponent_Hist] ([WorkOrderNumber])
GO

CREATE INDEX [IX_WorkOrderComponent_Hist_LotLookup] ON [dbo].[WorkOrderComponent_Hist] ([LotNumber], [ShortItemNumber], [BranchCode])
GO