Skip to main content
Post Closed as "Needs more focus" by Mołot, Pierre.Vriens, Shawn Conn, Yuseferi, Krishna Mohan

I am using migrate module to transfer data from one site to another here is my query

$query = Database::getConnection('db1', 'db1') ->select('users', 'u'); $query->leftjoin('field_data_field_user_insti_name', 'insti_name', 'insti_name.entity_id = u.uid and insti_name.bundle = \'user\''); $query->leftjoin('users_roles', 'ur', 'ur.uid = u.uid'); $query->fields('u', array('uid', 'name', 'mail', 'pass', 'status')); $query->fields('insti_name', array('field_user_insti_name_target_id')); $query->condition('u.uid', '1', '>'); $query->condition('ur.rid', '6', '!='); $query->distinct(); 

than iI am getting this error

Blockquote

Integrity constraint violation: 1052 Column 'uid' in on clause is ambiguous

BlockquoteIntegrity constraint violation: 1052 Column 'uid' in on clause is ambiguous

I found a solution for this problem that i have to add line

$this->source = new MigrateSourceSQL($query, array(), NULL, array('map_joinable' => FALSE)); 

After this error is solved, but don't know what this line do, is it safe to use this line

I am using migrate module to transfer data from one site to another here is my query

$query = Database::getConnection('db1', 'db1') ->select('users', 'u'); $query->leftjoin('field_data_field_user_insti_name', 'insti_name', 'insti_name.entity_id = u.uid and insti_name.bundle = \'user\''); $query->leftjoin('users_roles', 'ur', 'ur.uid = u.uid'); $query->fields('u', array('uid', 'name', 'mail', 'pass', 'status')); $query->fields('insti_name', array('field_user_insti_name_target_id')); $query->condition('u.uid', '1', '>'); $query->condition('ur.rid', '6', '!='); $query->distinct(); 

than i am getting this error

Blockquote

Integrity constraint violation: 1052 Column 'uid' in on clause is ambiguous

Blockquote

I found a solution for this problem that i have to add line

$this->source = new MigrateSourceSQL($query, array(), NULL, array('map_joinable' => FALSE)); 

After this error is solved, but don't know what this line do, is it safe to use this line

I am using migrate module to transfer data from one site to another here is my query

$query = Database::getConnection('db1', 'db1') ->select('users', 'u'); $query->leftjoin('field_data_field_user_insti_name', 'insti_name', 'insti_name.entity_id = u.uid and insti_name.bundle = \'user\''); $query->leftjoin('users_roles', 'ur', 'ur.uid = u.uid'); $query->fields('u', array('uid', 'name', 'mail', 'pass', 'status')); $query->fields('insti_name', array('field_user_insti_name_target_id')); $query->condition('u.uid', '1', '>'); $query->condition('ur.rid', '6', '!='); $query->distinct(); 

than I am getting this error

Integrity constraint violation: 1052 Column 'uid' in on clause is ambiguous

I found a solution for this problem that i have to add line

$this->source = new MigrateSourceSQL($query, array(), NULL, array('map_joinable' => FALSE)); 

After this error is solved, but don't know what this line do, is it safe to use this line

Source Link
Sagar
  • 23
  • 3

Integrity constraint violation: 1052 Column 'uid' in on clause is ambiguous

I am using migrate module to transfer data from one site to another here is my query

$query = Database::getConnection('db1', 'db1') ->select('users', 'u'); $query->leftjoin('field_data_field_user_insti_name', 'insti_name', 'insti_name.entity_id = u.uid and insti_name.bundle = \'user\''); $query->leftjoin('users_roles', 'ur', 'ur.uid = u.uid'); $query->fields('u', array('uid', 'name', 'mail', 'pass', 'status')); $query->fields('insti_name', array('field_user_insti_name_target_id')); $query->condition('u.uid', '1', '>'); $query->condition('ur.rid', '6', '!='); $query->distinct(); 

than i am getting this error

Blockquote

Integrity constraint violation: 1052 Column 'uid' in on clause is ambiguous

Blockquote

I found a solution for this problem that i have to add line

$this->source = new MigrateSourceSQL($query, array(), NULL, array('map_joinable' => FALSE)); 

After this error is solved, but don't know what this line do, is it safe to use this line