

/****** Object:  Table [dbo].[ApiCustomerPersons]    Script Date: 2021-09-06 21:06:18 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[ApiCustomerPersons](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[CustPersonId] [int] NOT NULL,
	[CustId] [int] NOT NULL,
	[CustCustId] [int] NOT NULL,
	[CustLocId] [int] NOT NULL,
	[CustLocLocId] [int] NOT NULL,
	[ErpId] [int] NOT NULL,
	[Name] [nvarchar](40) NOT NULL,
	[LastName] [nvarchar](60) NULL,
	[Position] [nvarchar](40) NULL,
	[Phone] [nvarchar](40) NULL,
	[Phone2] [nvarchar](40) NULL,
	[Email] [nvarchar](50) NULL,
	[Notes] [nvarchar](max) NULL,
	[VendorId] [int] NOT NULL,
	[TS] [datetime] NOT NULL,
	[SaveTS] [int] NOT NULL,
	[DeviceUid] [nvarchar](100) NULL,
	[State] [int] NOT NULL,
	[CustErpId] [int] NOT NULL,
	[CustLocErpId] [int] NOT NULL,
	NotyficationType int 
 CONSTRAINT [PK_dbo.ApiCustomerPersons] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

ALTER TABLE [dbo].[ApiCustomerPersons] ADD  DEFAULT ((0)) FOR [CustErpId]
GO

ALTER TABLE [dbo].[ApiCustomerPersons] ADD  DEFAULT ((0)) FOR [CustLocErpId]
GO


