

CREATE TABLE [dbo].[ApiProdOperations](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[PrevId] [int] NOT NULL,
	[Name] [nvarchar](max) NULL,
	[Code] [nvarchar](max) NULL,
	[TechnologyId] [int] NOT NULL,
	[OrgTechnologyId] [int] NOT NULL,
	[ProdDocNumber] [nvarchar](max) NULL,
	[ProdDocId] [int] NOT NULL,
	[ProductId] [int] NOT NULL,
	[ProductCode] [nvarchar](max) NULL,
	[ProductName] [nvarchar](max) NULL,
	[ProductQuantity] [float] NOT NULL,
	[ProductUM] [nvarchar](max) NULL,
	[Size] [decimal](18, 2) NOT NULL,
	[MainProdDocNumber] [nvarchar](max) NULL,
	[MainProdDocId] [int] NOT NULL,
	[MainProductCode] [nvarchar](max) NULL,
	[MainProductName] [nvarchar](max) NULL,
	[MainProductQuantity] [float] NOT NULL,
	[MainProductUM] [nvarchar](max) NULL,
	[MainTechnologyId] [int] NOT NULL,
	[LastActivityId] [int] NOT NULL,
	[StateId] [int] NOT NULL,
	[TimeSpend] [int] NOT NULL,
	[NormativeTime] [int] NOT NULL,
	[OperatorId] [int] NOT NULL,
	[Description] [nvarchar](max) NULL,
	[PrevStateId] [int] NOT NULL,
	[Date] [datetime] NOT NULL,
	[DueDate] [datetime] NOT NULL,
	[SumQuantity] [decimal](18, 2) NOT NULL,
	[ReferenceOpeId] [int] NOT NULL,
	[TS] [datetime] NOT NULL,
	[NextOperationId] [int] NOT NULL,
	[NextOperationName] [nvarchar](max) NULL,
	[NextOperationRefId] [int] NOT NULL,
	[CustInfo] [nvarchar](max) NULL,
	[CustId] [int] NOT NULL,
	[ErpId] [int] NOT NULL,
	[ProdDocStateId] [int] NULL,
	[Material] [nvarchar](20) NULL,
	[Weight] [decimal](18, 2) NULL,
	[ActivQuantity] [decimal](18, 2) NULL,
	[ProductTechnLineId] [int] NULL,
 CONSTRAINT [PK_dbo.ApiProdOperations] 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


