[dbo].[DocumentAutoUploadRuleDetailMoveTypeGroup]
CREATE TABLE [dbo].[DocumentAutoUploadRuleDetailMoveTypeGroup]
(
[DocumentAutoUploadRuleDetailMoveTypeGroupID] [int] NOT NULL IDENTITY(1, 1),
[DocumentAutoUploadRuleDetailFID] [int] NOT NULL,
[MoveTypeGroupFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DocumentAutoUploadRuleDetailMoveTypeGroup] ADD CONSTRAINT [PK_DocumentAutoUploadRuleDetailMoveTypeGroup] PRIMARY KEY CLUSTERED ([DocumentAutoUploadRuleDetailMoveTypeGroupID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_DocumentAutoUploadRuleDetailMoveTypeGroup_RuleDetail] ON [dbo].[DocumentAutoUploadRuleDetailMoveTypeGroup] ([DocumentAutoUploadRuleDetailFID], [MoveTypeGroupFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_DocumentAutoUploadRuleDetailMoveTypeGroup_MoveTypeGroup] ON [dbo].[DocumentAutoUploadRuleDetailMoveTypeGroup] ([MoveTypeGroupFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DocumentAutoUploadRuleDetailMoveTypeGroup] ADD CONSTRAINT [FK_DocumentAutoUploadRuleDetailMoveTypeGroup_DocumentAutoUploadRuleDetail] FOREIGN KEY ([DocumentAutoUploadRuleDetailFID]) REFERENCES [dbo].[DocumentAutoUploadRuleDetail] ([DocumentAutoUploadRuleDetailID]) ON DELETE CASCADE
GO
ALTER TABLE [dbo].[DocumentAutoUploadRuleDetailMoveTypeGroup] ADD CONSTRAINT [FK_DocumentAutoUploadRuleDetailMoveTypeGroup_MoveTypeGroup] FOREIGN KEY ([MoveTypeGroupFID]) REFERENCES [dbo].[MoveTypeGroups] ([MTGroupPriKey]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[DocumentAutoUploadRuleDetailMoveTypeGroup] TO [MssExec]
GRANT INSERT ON [dbo].[DocumentAutoUploadRuleDetailMoveTypeGroup] TO [MssExec]
GRANT DELETE ON [dbo].[DocumentAutoUploadRuleDetailMoveTypeGroup] TO [MssExec]
GRANT UPDATE ON [dbo].[DocumentAutoUploadRuleDetailMoveTypeGroup] TO [MssExec]
GO