CREATE TABLE [dbo].[SakariContact]
(
[SakariContactID] [int] NOT NULL IDENTITY(1, 1),
[SakariAccountFID] [int] NOT NULL,
[ContactName] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[ContactID] [varchar] (32) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[PhoneNumber] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[LastUpdatedAt] [datetimeoffset] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SakariContact] ADD CONSTRAINT [PK_SakariContact] PRIMARY KEY CLUSTERED ([SakariContactID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_SakariContact_SakariAccountFID_ContactID] ON [dbo].[SakariContact] ([SakariAccountFID], [ContactID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_SakariContact_SakariAccountFID_PhoneNumber] ON [dbo].[SakariContact] ([SakariAccountFID], [PhoneNumber]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[SakariContact] ADD CONSTRAINT [FK_SakariContact_SakariAccount] FOREIGN KEY ([SakariAccountFID]) REFERENCES [dbo].[SakariAccount] ([SakariAccountID])
GO
GRANT SELECT ON [dbo].[SakariContact] TO [MssExec]
GRANT INSERT ON [dbo].[SakariContact] TO [MssExec]
GRANT DELETE ON [dbo].[SakariContact] TO [MssExec]
GRANT UPDATE ON [dbo].[SakariContact] TO [MssExec]
GO