
/****** Object:  Table [dbo].[ApiDeviceLines]    Script Date: 06.09.2021 20:52:08 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[ApiDeviceLines](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[DeviceLineId] [int] NOT NULL,
	[ErpId] [int] NOT NULL,
	[TaskId] [int] NOT NULL,
	[DocumentId] [int] NOT NULL,
	[DocId] [int] NOT NULL,
	[CategoryName] [nvarchar](max) NULL,
	[State] [nvarchar](max) NULL,
	[StateId] [int] NOT NULL,
	[ModelId] [int] NOT NULL,
	[ModelSymbol] [nvarchar](max) NULL,
	[ManufactureYear] [int] NOT NULL,
	[DeviceId] [int] NOT NULL,
	[DeviceSerialNumber] [nvarchar](max) NULL,
	[DeviceCode] [nvarchar](max) NULL,
	[DeviceName] [nvarchar](max) NULL,
	[Counters] [int] NOT NULL,
	[Price] [decimal](18, 2) NOT NULL,
	[Value] [decimal](18, 2) NOT NULL,
	[Quantity] [int] NOT NULL,
	[Description] [nvarchar](max) NULL,
	[ReservationType] [int] NOT NULL,
	[ReservationFrom] [datetime] NOT NULL,
	[ReservationTo] [datetime] NOT NULL,
	[WarrantyCounter] [int] NOT NULL,
	[WarrantyMonths] [int] NOT NULL,
	[Modified] [int] NOT NULL,
 CONSTRAINT [PK_dbo.ApiDeviceLines] 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].[ApiDeviceLines] ADD  DEFAULT ((0)) FOR [Modified]
GO


