You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: app/Migrations/Schema/V110/Version20150603181728.php
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -59,12 +59,13 @@ public function up(Schema $schema)
59
59
$this->addSql("UPDATE c_item_property SET session_id = NULL WHERE session_id NOT IN (SELECT id FROM session)");
60
60
61
61
// Remove inconsistencies about non-existing courses
62
-
$this->addSql("DELETE FROM c_item_property WHERE c_id NOT IN (SELECT user_id FROM user)");
62
+
$this->addSql("DELETE FROM c_item_property WHERE c_id NOT IN (SELECT id FROM course)");
63
63
// Remove inconsistencies about non-existing users
64
64
$this->addSql("DELETE FROM course_rel_user WHERE user_id NOT IN (SELECT user_id FROM user)");
65
65
66
66
$this->addSql("DELETE FROM c_item_property WHERE c_id NOT IN (SELECT id FROM course)");
67
-
$this->addSql("DELETE FROM c_item_property WHERE to_group_id NOT IN (SELECT id FROM c_group_info)");
67
+
$this->addSql("UPDATE c_item_property SET to_group_id = NULL WHERE to_group_id = 0");
68
+
$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)");
68
69
69
70
$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)');
0 commit comments