[dbo].[DocumentAutoDownloadRuleDetailMoveTypeGroup]
CREATE TABLE [dbo].[DocumentAutoDownloadRuleDetailMoveTypeGroup]
(
[DocumentAutoDownloadRuleDetailMoveTypeGroupID] [int] NOT NULL IDENTITY(1, 1),
[DocumentAutoDownloadRuleDetailFID] [int] NOT NULL,
[MoveTypeGroupFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DocumentAutoDownloadRuleDetailMoveTypeGroup] ADD CONSTRAINT [PK_DocumentAutoDownloadRuleDetailMoveTypeGroup] PRIMARY KEY CLUSTERED ([DocumentAutoDownloadRuleDetailMoveTypeGroupID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_DocumentAutoDownloadRuleDetailMoveTypeGroup_RuleDetail] ON [dbo].[DocumentAutoDownloadRuleDetailMoveTypeGroup] ([DocumentAutoDownloadRuleDetailFID], [MoveTypeGroupFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DocumentAutoDownloadRuleDetailMoveTypeGroup_MoveTypeGroup] ON [dbo].[DocumentAutoDownloadRuleDetailMoveTypeGroup] ([MoveTypeGroupFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DocumentAutoDownloadRuleDetailMoveTypeGroup] ADD CONSTRAINT [FK_DocumentAutoDownloadRuleDetailMoveTypeGroup_DocumentAutoDownloadRuleDetail] FOREIGN KEY ([DocumentAutoDownloadRuleDetailFID]) REFERENCES [dbo].[DocumentAutoDownloadRuleDetail] ([DocumentAutoDownloadRuleDetailID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[DocumentAutoDownloadRuleDetailMoveTypeGroup] ADD CONSTRAINT [FK_DocumentAutoDownloadRuleDetailMoveTypeGroup_MoveTypeGroup] FOREIGN KEY ([MoveTypeGroupFID]) REFERENCES [dbo].[MoveTypeGroups] ([MTGroupPriKey]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[DocumentAutoDownloadRuleDetailMoveTypeGroup] TO [MssExec]
GRANT INSERT ON [dbo].[DocumentAutoDownloadRuleDetailMoveTypeGroup] TO [MssExec]
GRANT DELETE ON [dbo].[DocumentAutoDownloadRuleDetailMoveTypeGroup] TO [MssExec]
GRANT UPDATE ON [dbo].[DocumentAutoDownloadRuleDetailMoveTypeGroup] TO [MssExec]
GO