[dbo].[SakariConversation]
CREATE TABLE [dbo].[SakariConversation]
(
[SakariConversationID] [int] NOT NULL IDENTITY(1, 1),
[SakariAccountFID] [int] NOT NULL,
[SakariContactFID] [int] NOT NULL,
[ConversationID] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ClosesAt] [datetimeoffset] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SakariConversation] ADD CONSTRAINT [PK_SakariConversationID] PRIMARY KEY CLUSTERED ([SakariConversationID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SakariConversation] ADD CONSTRAINT [IX_SakariConversation_SakariAccountFID_ConversationID] UNIQUE NONCLUSTERED ([SakariAccountFID], [ConversationID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SakariConversation] ADD CONSTRAINT [FK_SakariConversation_SakariAccount] FOREIGN KEY ([SakariAccountFID]) REFERENCES [dbo].[SakariAccount] ([SakariAccountID])
GO
ALTER TABLE [dbo].[SakariConversation] ADD CONSTRAINT [FK_SakariConversation_SakariContactFID] FOREIGN KEY ([SakariContactFID]) REFERENCES [dbo].[SakariContact] ([SakariContactID])
GO
GRANT SELECT ON [dbo].[SakariConversation] TO [MssExec]
GRANT INSERT ON [dbo].[SakariConversation] TO [MssExec]
GRANT DELETE ON [dbo].[SakariConversation] TO [MssExec]
GRANT UPDATE ON [dbo].[SakariConversation] TO [MssExec]
GO