From a377c0fd29eb7d5a9407219aea3968b783d8ab7a Mon Sep 17 00:00:00 2001 From: jmontoya Date: Wed, 24 Feb 2016 17:41:40 +0100 Subject: [PATCH] Fix usergroup_rel_user during migration. --- app/Migrations/Schema/V110/Version110.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Migrations/Schema/V110/Version110.php b/app/Migrations/Schema/V110/Version110.php index cef10faee8..03328fde95 100644 --- a/app/Migrations/Schema/V110/Version110.php +++ b/app/Migrations/Schema/V110/Version110.php @@ -56,6 +56,9 @@ class Version110 extends AbstractMigrationChamilo // Delete info of session_rel_user if session does not exists; $this->addSql("DELETE FROM session_rel_user WHERE id_session NOT IN (SELECT id FROM session)"); + // Delete info of usergroup_rel_user if usergroup does not exists; + $this->addSql("DELETE FROM usergroup_rel_user WHERE usergroup_id NOT IN (SELECT id FROM usergroup)"); + $session = $schema->getTable('session'); $session->getColumn('id')->setType(Type::getType(Type::INTEGER))->setUnsigned(false); if (!$session->hasColumn('description')) {