[dbo].[OutgoingEmailSuccess]
CREATE TABLE [dbo].[OutgoingEmailSuccess]
(
[OutgoingEmailSuccessID] [int] NOT NULL IDENTITY(1, 1),
[OutgoingEmailFID] [int] NOT NULL,
[EnqueuedAt] [datetimeoffset] NOT NULL,
[SentAt] [datetimeoffset] NOT NULL,
[CompletedAt] [datetimeoffset] NOT NULL,
[RequestTraceId] [varchar] (64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OutgoingEmailSuccess] ADD CONSTRAINT [PK_OutgoingEmailSuccess] PRIMARY KEY CLUSTERED ([OutgoingEmailSuccessID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OutgoingEmailSuccess_OutgoingEmailFID] ON [dbo].[OutgoingEmailSuccess] ([OutgoingEmailFID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OutgoingEmailBatchSuccess_RequestTraceId] ON [dbo].[OutgoingEmailSuccess] ([RequestTraceId]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OutgoingEmailSuccess] ADD CONSTRAINT [FK_OutgoingEmailSuccess_OutgoingEmail] FOREIGN KEY ([OutgoingEmailFID]) REFERENCES [dbo].[OutgoingEmail] ([OutgoingEmailID]) ON DELETE CASCADE
GO
GRANT SELECT ON [dbo].[OutgoingEmailSuccess] TO [MssExec]
GRANT INSERT ON [dbo].[OutgoingEmailSuccess] TO [MssExec]
GRANT DELETE ON [dbo].[OutgoingEmailSuccess] TO [MssExec]
GRANT UPDATE ON [dbo].[OutgoingEmailSuccess] TO [MssExec]
GO