[dbo].[SafetySystemEquipmentEventLog]
CREATE TABLE [dbo].[SafetySystemEquipmentEventLog]
(
[SafetySystemEquipmentEventLogID] [int] NOT NULL IDENTITY(1, 1),
[EquipFID] [int] NOT NULL,
[SafetySystemEquipmentEventTypeFID] [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].[SafetySystemEquipmentEventLog] ADD CONSTRAINT [PK_SafetySystemEquipmentEventLog] PRIMARY KEY NONCLUSTERED ([SafetySystemEquipmentEventLogID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_SafetySystemEquipmentEventLog_CreatedBySysUserFID] ON [dbo].[SafetySystemEquipmentEventLog] ([CreatedBySysUserFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_SafetySystemEquipmentEventLog_Equip] ON [dbo].[SafetySystemEquipmentEventLog] ([EquipFID]) WITH (FILLFACTOR=80) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SafetySystemEquipmentEventLog] ADD CONSTRAINT [FK_SafetySystemEquipmentEventLog_CreatedBySysUser] FOREIGN KEY ([CreatedBySysUserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
ALTER TABLE [dbo].[SafetySystemEquipmentEventLog] ADD CONSTRAINT [FK_SafetySystemEquipmentEventLog_Equip] FOREIGN KEY ([EquipFID]) REFERENCES [dbo].[Equip] ([PriKey])
GO
ALTER TABLE [dbo].[SafetySystemEquipmentEventLog] ADD CONSTRAINT [FK_SafetySystemEquipmentEventLog_SafetySystemEquipmentEventType] FOREIGN KEY ([SafetySystemEquipmentEventTypeFID]) REFERENCES [dbo].[SafetySystemEquipmentEventType] ([SafetySystemEquipmentEventTypeID])
GO
GRANT SELECT ON [dbo].[SafetySystemEquipmentEventLog] TO [MssExec]
GRANT INSERT ON [dbo].[SafetySystemEquipmentEventLog] TO [MssExec]
GRANT DELETE ON [dbo].[SafetySystemEquipmentEventLog] TO [MssExec]
GRANT UPDATE ON [dbo].[SafetySystemEquipmentEventLog] TO [MssExec]
GO