﻿CREATE TABLE [dbo].[mfr__contacts] (
    [Id]           BIGINT          NOT NULL,
    [CustomValues] NVARCHAR (MAX)  NOT NULL,
    [FirstName]    NVARCHAR (255)  NULL,
    [LastName]     NVARCHAR (255)  NULL,
    [Email]        NVARCHAR (255)  NULL,
    [JobTitle]     NVARCHAR (255)  NULL,
    [MobilePhone]  NVARCHAR (255)  NULL,
    [Telephone]    NVARCHAR (255)  NULL,
    [Fax]          NVARCHAR (255)  NULL,
    [Note]         NVARCHAR (1000) NULL,
    [DateModified] DATETIME        NOT NULL,
    [Version]      INT             NOT NULL,
    [CompanyId]    BIGINT          NOT NULL,
    [IsUser]       BIT             NOT NULL,
    [ExternalId]   NVARCHAR (255)  NULL,
    [Gender]       NVARCHAR (255)  NULL,
    [UserId]       BIGINT          NOT NULL,
    CONSTRAINT [PK_mfr__contact] PRIMARY KEY CLUSTERED ([Id] ASC)
);


GO
CREATE NONCLUSTERED INDEX [mfr__contacts__ix1]
    ON [dbo].[mfr__contacts]([CompanyId] ASC)
    INCLUDE([CustomValues], [FirstName], [LastName], [Email], [JobTitle], [MobilePhone], [Telephone], [Fax], [Note], [DateModified], [Version], [IsUser], [ExternalId], [Gender], [UserId]);

