
    ALTER TABLE dbo.ApiCustomers add RegionId int;
	Go
  update dbo.ApiCustomers set RegionId=0;
  GO


    ALTER TABLE dbo.ApiWmsDocuments add Additionally int;
	GO
  update dbo.ApiWmsDocuments set Additionally =  0;
  GO


  ALTER TABLE dbo.ApiWorkers add EmaiTaskDefId int, SendEmailNotyfications int;
  GO
  update dbo.ApiWorkers set EmaiTaskDefId =  0,SendEmailNotyfications =0;
  
  
  
    ALTER TABLE dbo.ApiDocuments add StateDoc int, ReservationResource int, ReservationType int;
	GO
	update dbo.ApiDocuments set StateDoc =0 where ISNULL(StateDoc,-1)=-1;
	GO


	  ALTER TABLE dbo.ApiDefinitions add ReservationType int;
	  GO
	update dbo.ApiDefinitions set ReservationType =0 where ISNULL(ReservationType,-1)=-1;
	GO

	  ALTER TABLE dbo.ApiLines add ReservationType int, Direction int, RepositoryId int;
	  GO
	update dbo.ApiLines set ReservationType =0 where ISNULL(ReservationType,-1)=-1;
	GO

	
	update dbo.ApiLines set Direction =0 where ISNULL(Direction,-111)=-111;
	GO

		
	update dbo.ApiLines set RepositoryId =0 where ISNULL(RepositoryId,-1)=-1;
	GO
	
	
	update dbo.ApiDOcuments set ReservationResource =0 where ISNULL(ReservationResource,-1)=-1;
	GO


	update dbo.ApiDOcuments set ReservationType =0 where ISNULL(ReservationType,-1)=-1;
	GO

	ALTER TABLE dbo.ApiTaskHistories add RelObjectElem int;
	GO
	update dbo.ApiTaskHistories set RelObjectElem = 0 where ISNULL(RelObjectElem,-1)=-1;
	GO

	ALTER TABLE dbo.ApiWorkers add ModelWorkerId int;
	GO
	update dbo.ApiWorkers set ModelWorkerId=0 where ISNULL(ModelWorkerId,-1)=-1;
	GO

	ALTER TABLE dbo.ApiEmails add PlainText nvarchar(max);
	GO