|
|
|
@ -57,14 +57,14 @@ class Version20150603181728 extends AbstractMigrationChamilo |
|
|
|
|
|
|
|
|
|
$this->addSql("DELETE FROM c_item_property WHERE session_id IS NOT NULL and session_id <> 0 AND session_id NOT IN (SELECT id FROM session)"); |
|
|
|
|
$this->addSql("DELETE FROM c_item_property WHERE to_group_id IS NOT NULL AND to_group_id <> 0 AND to_group_id NOT IN (SELECT iid FROM c_group_info)"); |
|
|
|
|
$this->addSql("DELETE FROM c_item_property WHERE to_user_id IS NOT NULL and to_user_id <> 0 AND to_user_id NOT IN (SELECT user_id FROM user)"); |
|
|
|
|
$this->addSql("DELETE FROM c_item_property WHERE to_user_id IS NOT NULL and to_user_id <> 0 AND to_user_id NOT IN (SELECT id FROM user)"); |
|
|
|
|
$this->addSql("DELETE FROM c_item_property WHERE to_user_id IS NOT NULL AND to_user_id <> 0 AND to_user_id NOT IN (SELECT id FROM user)"); |
|
|
|
|
$this->addSql("DELETE FROM c_item_property WHERE insert_user_id IS NOT NULL AND insert_user_id <> 0 AND insert_user_id NOT IN (SELECT id FROM user)"); |
|
|
|
|
|
|
|
|
|
// Remove inconsistencies about non-existing courses |
|
|
|
|
$this->addSql("DELETE FROM c_item_property WHERE c_id NOT IN (SELECT id FROM course)"); |
|
|
|
|
// Remove inconsistencies about non-existing users |
|
|
|
|
$this->addSql("DELETE FROM course_rel_user WHERE user_id NOT IN (SELECT user_id FROM user)"); |
|
|
|
|
$this->addSql("DELETE FROM course_rel_user WHERE user_id NOT IN (SELECT id FROM user)"); |
|
|
|
|
|
|
|
|
|
$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"); |
|
|
|
|