@ -69,8 +69,10 @@ class Version20150603181728 extends AbstractMigrationChamilo
$this->addSql("DELETE FROM c_item_property WHERE c_id NOT IN (SELECT id FROM course)");
$this->addSql("UPDATE c_item_property SET to_group_id = NULL WHERE to_group_id = 0");
$this->addSql("DELETE FROM c_item_property WHERE to_group_id IS NOT NULL AND to_group_id NOT IN (SELECT id FROM c_group_info)");
$this->addSql('UPDATE c_item_property cip SET cip.to_group_id = (SELECT cgi.iid FROM c_group_info cgi WHERE cgi.c_id = cip.c_id AND cgi.id = cip.to_group_id)');
$this->addSql('UPDATE c_item_property SET to_user_id = NULL WHERE to_user_id = 0');
$this->addSql('UPDATE c_item_property SET insert_user_id = NULL WHERE insert_user_id = 0');
$this->addSql('UPDATE c_item_property SET session_id = NULL WHERE session_id = 0');