From 64df1cf70716b5c1a0a7991ea87dccb9475a22d8 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Wed, 13 May 2015 16:23:46 +0200 Subject: [PATCH] Fix upgrade from 1.9.x --- composer.json | 9 ++++++--- src/Chamilo/CoreBundle/Composer/ScriptHandler.php | 5 +++-- .../CoreBundle/Migrations/Schema/V110/Version110.php | 11 ++++++++++- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index c166c71dba..e91a13c8c8 100755 --- a/composer.json +++ b/composer.json @@ -86,12 +86,15 @@ "behat/mink-selenium2-driver": "*" }, "scripts": { + "pre-install-cmd": [ + "Chamilo\\CoreBundle\\Composer\\ScriptHandler::deleteOldFilesFrom19x" + ], + "pre-update-cmd": [ + "Chamilo\\CoreBundle\\Composer\\ScriptHandler::deleteOldFilesFrom19x" + ], "post-update-cmd": [ - "Chamilo\\CoreBundle\\Composer\\ScriptHandler::deleteOldFilesFrom19x", "Chamilo\\CoreBundle\\Composer\\ScriptHandler::dumpCssFiles" ], - "pre-install-cmd": [ - ], "post-install-cmd": [ "Chamilo\\CoreBundle\\Composer\\ScriptHandler::dumpCssFiles" ] diff --git a/src/Chamilo/CoreBundle/Composer/ScriptHandler.php b/src/Chamilo/CoreBundle/Composer/ScriptHandler.php index f855260437..97b4e57a95 100644 --- a/src/Chamilo/CoreBundle/Composer/ScriptHandler.php +++ b/src/Chamilo/CoreBundle/Composer/ScriptHandler.php @@ -27,7 +27,8 @@ class ScriptHandler public static function deleteOldFilesFrom19x() { $path = __DIR__.'/../../../../main/inc/lib/symfony/'; - $fs = new Filesystem(); - $fs->remove($path); + if (is_dir($path) && is_writable($path)) { + rmdir($path); + } } } diff --git a/src/Chamilo/CoreBundle/Migrations/Schema/V110/Version110.php b/src/Chamilo/CoreBundle/Migrations/Schema/V110/Version110.php index 4342a6dca0..d90b64a125 100644 --- a/src/Chamilo/CoreBundle/Migrations/Schema/V110/Version110.php +++ b/src/Chamilo/CoreBundle/Migrations/Schema/V110/Version110.php @@ -177,7 +177,7 @@ class Version110 extends AbstractMigrationChamilo //'c_role_user', 'c_student_publication', 'c_student_publication_assignment', - 'c_student_publication_comment', + //'c_student_publication_comment', 'c_student_publication_rel_document', 'c_student_publication_rel_user', //'c_survey', @@ -206,6 +206,15 @@ class Version110 extends AbstractMigrationChamilo $this->addSql("ALTER TABLE $table ADD COLUMN iid int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT"); } + $this->addSql("ALTER TABLE c_attendance_calendar_rel_group MODIFY COLUMN id int unsigned DEFAULT NULL"); + $this->addSql("ALTER TABLE c_attendance_calendar_rel_group DROP PRIMARY KEY"); + $this->addSql("ALTER TABLE c_attendance_calendar_rel_group ADD COLUMN iid int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT"); + + $this->addSql("ALTER TABLE c_student_publication_comment MODIFY COLUMN id int unsigned DEFAULT NULL"); + $this->addSql("ALTER TABLE c_student_publication_comment DROP PRIMARY KEY"); + $this->addSql("ALTER TABLE c_student_publication_comment ADD COLUMN iid int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT"); + + $this->addSql("ALTER TABLE c_attendance_sheet MODIFY COLUMN c_id int unsigned DEFAULT NULL"); $this->addSql("ALTER TABLE c_attendance_sheet DROP PRIMARY KEY"); $this->addSql("ALTER TABLE c_attendance_sheet ADD COLUMN iid int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT");