[dbo].[MobileCrewTimeAudit]
CREATE TABLE [dbo].[MobileCrewTimeAudit]
(
[MobileCrewTimeAuditID] [bigint] NOT NULL IDENTITY(1, 1),
[MobileCrewTimeFID] [bigint] NOT NULL,
[Action] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SubmitterFID] [int] NOT NULL,
[Source] [varchar] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[TimeUtc] [datetime] NOT NULL,
[TimeZone] [smallint] NOT NULL,
[StartTimeUtc] [datetime] NULL,
[StartTimeZone] [smallint] NULL,
[EndTimeUtc] [datetime] NULL,
[EndTimeZone] [smallint] NULL,
[IsOverTime] [bit] NULL,
[Comment] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[GpsLatitudeIn] [float] NULL,
[GpsLongitudeIn] [float] NULL,
[GpsLatitudeOut] [float] NULL,
[GpsLongitudeOut] [float] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MobileCrewTimeAudit] ADD CONSTRAINT [PK_MobileCrewTimeAudit] PRIMARY KEY CLUSTERED ([MobileCrewTimeAuditID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_MobileCrewTimeAudit_MobileCrewTimeFID] ON [dbo].[MobileCrewTimeAudit] ([MobileCrewTimeFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_MobileCrewTimeAudit_SubmitterFID] ON [dbo].[MobileCrewTimeAudit] ([SubmitterFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MobileCrewTimeAudit] ADD CONSTRAINT [FK_MobileCrewTimeAudit_MobileCrewTimeFID] FOREIGN KEY ([MobileCrewTimeFID]) REFERENCES [dbo].[MobileCrewTime] ([MobileCrewTimeID])
GO
ALTER TABLE [dbo].[MobileCrewTimeAudit] ADD CONSTRAINT [FK_MobileCrewTimeAudit_SubmitterFID] FOREIGN KEY ([SubmitterFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[MobileCrewTimeAudit] TO [MssExec]
GRANT INSERT ON [dbo].[MobileCrewTimeAudit] TO [MssExec]
GRANT DELETE ON [dbo].[MobileCrewTimeAudit] TO [MssExec]
GRANT UPDATE ON [dbo].[MobileCrewTimeAudit] TO [MssExec]
GO