[dbo].[SafetySystemPersonnelEventLog]
CREATE TABLE [dbo].[SafetySystemPersonnelEventLog]
(
[SafetySystemPersonnelEventLogID] [int] NOT NULL IDENTITY(1, 1),
[SysUserFID] [int] NOT NULL,
[SafetySystemPersonnelEventTypeFID] [int] NOT NULL,
[CreatedBySysUserFID] [int] NOT NULL,
[CreatedDate] [datetime] NOT NULL,
[EventDate] [datetime] NOT NULL,
[Description] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[SafetySystemPersonnelEventLog] ADD CONSTRAINT [PK_SafetySystemPersonnelEventLog] PRIMARY KEY NONCLUSTERED ([SafetySystemPersonnelEventLogID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_SafetySystemPersonnelEventLog_CreatedBySysUser] ON [dbo].[SafetySystemPersonnelEventLog] ([CreatedBySysUserFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_SafetySystemPersonnelEventLog_SysUser] ON [dbo].[SafetySystemPersonnelEventLog] ([SysUserFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SafetySystemPersonnelEventLog] ADD CONSTRAINT [FK_SafetySystemPersonnelEventLog_CreatedBySysUser] FOREIGN KEY ([CreatedBySysUserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[SafetySystemPersonnelEventLog] ADD CONSTRAINT [FK_SafetySystemPersonnelEventLog_SafetySystemPersonnelEventType] FOREIGN KEY ([SafetySystemPersonnelEventTypeFID]) REFERENCES [dbo].[SafetySystemPersonnelEventType] ([SafetySystemPersonnelEventTypeID])
GO
ALTER TABLE [dbo].[SafetySystemPersonnelEventLog] ADD CONSTRAINT [FK_SafetySystemPersonnelEventLog_SysUser] FOREIGN KEY ([SysUserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[SafetySystemPersonnelEventLog] TO [MssExec]
GRANT INSERT ON [dbo].[SafetySystemPersonnelEventLog] TO [MssExec]
GRANT DELETE ON [dbo].[SafetySystemPersonnelEventLog] TO [MssExec]
GRANT UPDATE ON [dbo].[SafetySystemPersonnelEventLog] TO [MssExec]
GO