CREATE TABLE [dbo].[SAConfigVolumeMap]
(
[ConfigVolumeMapID] [int] NOT NULL IDENTITY(1, 1),
[ConfigQuoteID] [int] NOT NULL,
[ConfigPrinterID] [int] NULL,
[DetailID] [int] NULL,
[CurrentTCODetailID] [int] NULL,
[ConfigVolumeMapDeviceID] [int] NOT NULL,
[MappedBlackVolume] [int] NULL,
[MappedColorVolume] [int] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SAConfigVolumeMap] ADD CONSTRAINT [PK_SAConfigVolumeMap] PRIMARY KEY CLUSTERED ([ConfigVolumeMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SAConfigVolumeMap] ADD CONSTRAINT [FK_SAConfigVolumeMap_ConfigPrinterID_SAConfigPrinterDetails] FOREIGN KEY ([ConfigPrinterID], [DetailID]) REFERENCES [dbo].[SAConfigPrinterDetails] ([ConfigPrinterID], [DetailID])
GO
ALTER TABLE [dbo].[SAConfigVolumeMap] ADD CONSTRAINT [FK_SAConfigVolumeMap_ConfigQuoteID_SAConfigQuotes] FOREIGN KEY ([ConfigQuoteID]) REFERENCES [dbo].[SAConfigQuotes] ([ConfigQuoteID])
GO
ALTER TABLE [dbo].[SAConfigVolumeMap] ADD CONSTRAINT [FK_SAConfigVolumeMap_ConfigVolumeMapDeviceID_SAConfigVolumeMapDevices] FOREIGN KEY ([ConfigVolumeMapDeviceID]) REFERENCES [dbo].[SAConfigVolumeMapDevices] ([ConfigVolumeMapDeviceID])
GO
ALTER TABLE [dbo].[SAConfigVolumeMap] ADD CONSTRAINT [FK_SAConfigVolumeMap_CurrentTCODetailID_SAConfigCurrentTCODetails] FOREIGN KEY ([CurrentTCODetailID]) REFERENCES [dbo].[SAConfigCurrentTCODetails] ([CurrentTCODetailID])
GO