
CREATE TABLE [dbo].[ApiWorkers](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NOT NULL,
	[Surname] [nvarchar](50) NOT NULL,
	[Passwd] [nvarchar](100) NOT NULL,
	[GroupId] [int] NOT NULL,
	[Priviliges] [int] NOT NULL,
	[lang] [nchar](10) NOT NULL,
	[Currency] [nchar](10) NOT NULL,
	[RepositoryId] [int] NOT NULL,
	[WorkTime] [int] NOT NULL,
	[Permissions] [nvarchar](max) NULL,
	[Position] [nvarchar](40) NULL,
	[SuperiorId] [int] NOT NULL,
	[WorkFrom] [int] NOT NULL,
	[CustId] [int] NOT NULL,
	[EmailAdress] [nvarchar](50) NULL,
	[ImapServer] [nvarchar](50) NULL,
	[ImapUser] [nvarchar](50) NULL,
	[ImapPassword] [nvarchar](50) NULL,
	[ImapPort] [int] NOT NULL,
	[ImapSSL] [int] NOT NULL,
	[SmtpServer] [nvarchar](50) NULL,
	[SmtpUser] [nvarchar](50) NULL,
	[SmtpPassword] [nvarchar](50) NULL,
	[SmtpPort] [int] NOT NULL,
	[SmtpSSL] [int] NOT NULL,
	[CheckMailBox] [int] NOT NULL,
	[ModelWorkerId] [int] NULL,
	[EmaiTaskDefId] [int] NULL,
	[SendEmailNotyfications] [int] NULL,
	[ErpId] [int] NULL,
	[CardNumber] [nvarchar](200) NULL,
	[WorkerId] [int] NULL,
	[DepartamentId] [int] NULL,
 CONSTRAINT [PK_ApiWorkers] 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].[ApiWorkers] ADD  CONSTRAINT [DF_ApiWorkers_WorkTime]  DEFAULT ((0)) FOR [WorkTime]
GO

ALTER TABLE [dbo].[ApiWorkers] ADD  DEFAULT ((0)) FOR [SuperiorId]
GO

ALTER TABLE [dbo].[ApiWorkers] ADD  DEFAULT ((480)) FOR [WorkFrom]
GO

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

ALTER TABLE [dbo].[ApiWorkers] ADD  DEFAULT ((0)) FOR [ImapPort]
GO

ALTER TABLE [dbo].[ApiWorkers] ADD  DEFAULT ((0)) FOR [ImapSSL]
GO

ALTER TABLE [dbo].[ApiWorkers] ADD  DEFAULT ((0)) FOR [SmtpPort]
GO

ALTER TABLE [dbo].[ApiWorkers] ADD  DEFAULT ((0)) FOR [SmtpSSL]
GO

ALTER TABLE [dbo].[ApiWorkers] ADD  DEFAULT ((0)) FOR [CheckMailBox]
GO


