
/****** Object:  Table [dbo].[ApiWmsDocuments]    Script Date: 06.09.2021 20:14:54 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[ApiWmsDocuments](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[ErpId] [int] NOT NULL,
	[Direction] [int] NOT NULL,
	[DefId] [int] NOT NULL,
	[StateId] [int] NOT NULL,
	StateDoc int NULL,
	DepartamentId int NULL,
	[Number] [int] NOT NULL,
	[Year] [int] NOT NULL,
	[Month] [int] NOT NULL,
	[Series] [nvarchar](30) NULL,
	[NumberString] [nvarchar](30) NULL,
	[Priority] [int] NOT NULL,
	[PlaceId] [int] NOT NULL,
	[CustId] [int] NOT NULL,
	[CustInfo] [nvarchar](250) NULL,
	[Date] [datetime] NOT NULL,
	[OperatorId] [int] NOT NULL,
	[CreateTS] [datetime] NOT NULL,
	[OwnerId] [int] NOT NULL,
	[TS] [datetime] NOT NULL,
	[Description] [nvarchar](max) NULL,
	[ObjectId] [int] NOT NULL,
	[ObjectType] [int] NOT NULL,
	[OrgDocumentNumber] [nvarchar](30) NULL,
	[RepositoryId] [int] NOT NULL,
	[Info] [nvarchar](250) NULL,
	[Info2] [nvarchar](250) NULL,
	[Link] [nvarchar](250) NULL,
	[ExtId] [nvarchar](50) NULL,
	[ReciverId] [int] NULL,
	[ForeginNumber] [nvarchar](40) NULL,
	[Additionally] [int] NULL,
	CategoryId [int] NULL,
    [ProjectLineId] [int]  NULL,
	[ProjectId] [int]  NULL,
	PackageInfo nvarchar(100) NULL
	
 CONSTRAINT [PK_dbo.ApiWmsDocuments] 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].[ApiWmsDocuments] ADD  DEFAULT ((0)) FOR [ObjectId]
GO

ALTER TABLE [dbo].[ApiWmsDocuments] ADD  DEFAULT ((0)) FOR [ObjectType]
GO

ALTER TABLE [dbo].[ApiWmsDocuments] ADD  DEFAULT ((0)) FOR [RepositoryId]
GO


