[dbo].[AdminProfileDetail]
CREATE TABLE [dbo].[AdminProfileDetail]
(
[AdminProfileDetailID] [int] NOT NULL IDENTITY(1, 1),
[AdminProfileFID] [int] NOT NULL,
[AdminRoleFID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AdminProfileDetail] ADD CONSTRAINT [PK_AdminProfileDetail] PRIMARY KEY CLUSTERED ([AdminProfileDetailID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AdminProfileDetail] ADD CONSTRAINT [IX_AdminProfileDetail_AdminProfileFID_AdminRoleFID] UNIQUE NONCLUSTERED ([AdminProfileFID], [AdminRoleFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AdminProfileDetail] ADD CONSTRAINT [FK_AdminProfileDetail_AdminProfile] FOREIGN KEY ([AdminProfileFID]) REFERENCES [dbo].[AdminProfile] ([AdminProfileID])
GO
ALTER TABLE [dbo].[AdminProfileDetail] ADD CONSTRAINT [FK_AdminProfileDetail_AdminRole] FOREIGN KEY ([AdminRoleFID]) REFERENCES [dbo].[AdminRole] ([AdminRoleID])
GO
GRANT SELECT ON [dbo].[AdminProfileDetail] TO [MssExec]
GRANT INSERT ON [dbo].[AdminProfileDetail] TO [MssExec]
GRANT DELETE ON [dbo].[AdminProfileDetail] TO [MssExec]
GRANT UPDATE ON [dbo].[AdminProfileDetail] TO [MssExec]
GO
EXEC sp_addextendedproperty N'MS_Description', N'The primary key.', 'SCHEMA', N'dbo', 'TABLE', N'AdminProfileDetail', 'COLUMN', N'AdminProfileDetailID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The administration profile this detail is mapped to.', 'SCHEMA', N'dbo', 'TABLE', N'AdminProfileDetail', 'COLUMN', N'AdminProfileFID'
GO
EXEC sp_addextendedproperty N'MS_Description', N'The administration role this profile is allowed to perform.', 'SCHEMA', N'dbo', 'TABLE', N'AdminProfileDetail', 'COLUMN', N'AdminRoleFID'
GO