

CREATE TABLE [dbo].[ApiProdActivities](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[OperationId] [int] NOT NULL,
	[OperationCode] [nvarchar](max) NULL,
	[OperatorId] [int] NOT NULL,
	[StateId] [int] NOT NULL,
	[Quantity] [decimal](18, 2) NOT NULL,
	[Counter] [decimal](18, 2) NOT NULL,
	[TS] [datetime] NOT NULL,
	[Barcode] [nvarchar](max) NULL,
	[ObjectId] [int] NOT NULL,
	[ObjectType] [int] NOT NULL,
	[Description] [nvarchar](max) NULL,
	[Confirmed] [int] NOT NULL,
	[ActionId] [int] NOT NULL,
	[ErpId] [int] NOT NULL,
	[ProdDocNumber] [nvarchar](max) NULL,
	[ProductCode] [nvarchar](max) NULL,
	[ProductName] [nvarchar](max) NULL,
	[NextOperationId] [int] NOT NULL,
	[NextOperationName] [nvarchar](max) NULL,
	[CustInfo] [nvarchar](max) NULL,
	[CustId] [int] NOT NULL,
	[DeliveredToTheWarehouse] [decimal](18, 2) NOT NULL,
	[NextOperationRefId] [int] NOT NULL,
	[ProductId] [int] NOT NULL,
	[Size] [decimal](16, 4) NULL,
	[StartActivityId] [int] NULL,
	[Weight] [decimal](18, 2) NULL,
	[ReferenceOpeId] [int] NULL,
	[ProductTechnLineId] [int] NULL,
 CONSTRAINT [PK_dbo.ApiProdActivities] 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].[ApiProdActivities] ADD  DEFAULT ((0)) FOR [NextOperationId]
GO

ALTER TABLE [dbo].[ApiProdActivities] ADD  DEFAULT ((0)) FOR [CustId]
GO

ALTER TABLE [dbo].[ApiProdActivities] ADD  DEFAULT ((0)) FOR [DeliveredToTheWarehouse]
GO

ALTER TABLE [dbo].[ApiProdActivities] ADD  DEFAULT ((0)) FOR [NextOperationRefId]
GO

ALTER TABLE [dbo].[ApiProdActivities] ADD  DEFAULT ((0)) FOR [ProductId]
GO


