CREATE TABLE [dbo].[ReportingUser]
(
[ReportingUserID] [int] NOT NULL IDENTITY(1, 1),
[SysUserFID] [int] NOT NULL,
[hReportsUserId] [int] NULL,
[hReportsRoleId] [int] NOT NULL,
[UseMoversSuiteCredentials] [bit] NOT NULL CONSTRAINT [DF_ReportingUser_UseMoversSuiteCredentials] DEFAULT ((1)),
[IsSuperUser] [bit] NOT NULL CONSTRAINT [DF_ReportingUser_IsSuperUser] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReportingUser] ADD CONSTRAINT [CK_ReportingUser_hReportsRoleId] CHECK (([hReportsRoleId]>(0)))
GO
ALTER TABLE [dbo].[ReportingUser] ADD CONSTRAINT [PK_ReportingUser] PRIMARY KEY CLUSTERED ([ReportingUserID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReportingUser] ADD CONSTRAINT [IX_ReportingUser_SysUserID] UNIQUE NONCLUSTERED ([SysUserFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[ReportingUser] ADD CONSTRAINT [FK_ReportingUser_SysUser] FOREIGN KEY ([SysUserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[ReportingUser] TO [MssExec]
GRANT INSERT ON [dbo].[ReportingUser] TO [MssExec]
GRANT DELETE ON [dbo].[ReportingUser] TO [MssExec]
GRANT UPDATE ON [dbo].[ReportingUser] TO [MssExec]
GO