DROP INDEX IF EXISTS idx_unique_pipeline_bitrix;
CREATE UNIQUE INDEX idx_unique_pipeline_bitrix ON PipelineBitrix (BitrixID, AccountID, EntityTypeId) WHERE Deleted = false;
DROP INDEX IF EXISTS idx_unique_step_bitrix;
CREATE UNIQUE INDEX idx_unique_step_bitrix ON StepBitrix (BitrixID, AccountID, EntityID) WHERE Deleted = false;