[dbo].[SakariContactSysuserMap]
CREATE TABLE [dbo].[SakariContactSysuserMap]
(
[SakariContactSysuserMapID] [int] NOT NULL IDENTITY(1, 1),
[SysuserFID] [int] NOT NULL,
[SakariContactFID] [int] NOT NULL,
[LastReadAt] [datetimeoffset] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SakariContactSysuserMap] ADD CONSTRAINT [PK_SakariContactSysuserMapID] PRIMARY KEY NONCLUSTERED ([SakariContactSysuserMapID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SakariContactSysuserMap] ADD CONSTRAINT [IX_SakariContactSysuserMap_SysuserFID_SakariContactFID] UNIQUE CLUSTERED ([SysuserFID], [SakariContactFID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SakariContactSysuserMap] ADD CONSTRAINT [FK_SakariContactSysuserMap_SakariContact] FOREIGN KEY ([SakariContactFID]) REFERENCES [dbo].[SakariContact] ([SakariContactID])
GO
ALTER TABLE [dbo].[SakariContactSysuserMap] ADD CONSTRAINT [FK_SakariContactSysuserMap_Sysuser] FOREIGN KEY ([SysuserFID]) REFERENCES [dbo].[Sysuser] ([SysUserID])
GO
GRANT SELECT ON [dbo].[SakariContactSysuserMap] TO [MssExec]
GRANT INSERT ON [dbo].[SakariContactSysuserMap] TO [MssExec]
GRANT DELETE ON [dbo].[SakariContactSysuserMap] TO [MssExec]
GRANT UPDATE ON [dbo].[SakariContactSysuserMap] TO [MssExec]
GO