From 50e93dd50b4a040602cc765903a63d390b377355 Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Mon, 14 Dec 2015 16:51:30 -0500 Subject: [PATCH] Remove inconsistencies about non-existing sessions --- app/Migrations/Schema/V110/Version20150603181728.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Migrations/Schema/V110/Version20150603181728.php b/app/Migrations/Schema/V110/Version20150603181728.php index 49fa1c0feb..891fc83fff 100644 --- a/app/Migrations/Schema/V110/Version20150603181728.php +++ b/app/Migrations/Schema/V110/Version20150603181728.php @@ -55,6 +55,11 @@ class Version20150603181728 extends AbstractMigrationChamilo SELECT id FROM user ) "); + $this->addSql(" + UPDATE c_item_property SET session_id = NULL WHERE session_id NOT IN ( + SELECT id FROM session + ) + "); // Remove inconsistencies about non-existing courses $this->addSql("DELETE FROM c_item_property WHERE c_id = 0"); // Remove inconsistencies about non-existing users