[dbo].[DocumentAutoUploadRuleDetailShipmentType]
CREATE TABLE [dbo].[DocumentAutoUploadRuleDetailShipmentType]
(
[DocumentAutoUploadRuleDetailShipmentTypeID] [int] NOT NULL IDENTITY(1, 1),
[DocumentAutoUploadRuleDetailFID] [int] NOT NULL,
[ShipmentTypeFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DocumentAutoUploadRuleDetailShipmentType] ADD CONSTRAINT [PK_DocumentAutoUploadRuleDetailShipmentType] PRIMARY KEY CLUSTERED ([DocumentAutoUploadRuleDetailShipmentTypeID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_DocumentAutoUploadRuleDetailShipmentType_RuleDetail] ON [dbo].[DocumentAutoUploadRuleDetailShipmentType] ([DocumentAutoUploadRuleDetailFID], [ShipmentTypeFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DocumentAutoUploadRuleDetailShipmentType_ShipmentType] ON [dbo].[DocumentAutoUploadRuleDetailShipmentType] ([ShipmentTypeFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DocumentAutoUploadRuleDetailShipmentType] ADD CONSTRAINT [FK_DocumentAutoUploadRuleDetailShipmentType_DocumentAutoUploadRuleDetail] FOREIGN KEY ([DocumentAutoUploadRuleDetailFID]) REFERENCES [dbo].[DocumentAutoUploadRuleDetail] ([DocumentAutoUploadRuleDetailID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[DocumentAutoUploadRuleDetailShipmentType] ADD CONSTRAINT [FK_DocumentAutoUploadRuleDetailShipmentType_ShipmentType] FOREIGN KEY ([ShipmentTypeFID]) REFERENCES [dbo].[ShipmentType] ([ShipmentTypeID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[DocumentAutoUploadRuleDetailShipmentType] TO [MssExec]
GRANT INSERT ON [dbo].[DocumentAutoUploadRuleDetailShipmentType] TO [MssExec]
GRANT DELETE ON [dbo].[DocumentAutoUploadRuleDetailShipmentType] TO [MssExec]
GRANT UPDATE ON [dbo].[DocumentAutoUploadRuleDetailShipmentType] TO [MssExec]
GO