Fix upgrade from 1.9.x

1.10.x
Julio Montoya 11 years ago
parent d4e385bb77
commit 64df1cf707
  1. 9
      composer.json
  2. 5
      src/Chamilo/CoreBundle/Composer/ScriptHandler.php
  3. 11
      src/Chamilo/CoreBundle/Migrations/Schema/V110/Version110.php

@ -86,12 +86,15 @@
"behat/mink-selenium2-driver": "*" "behat/mink-selenium2-driver": "*"
}, },
"scripts": { "scripts": {
"pre-install-cmd": [
"Chamilo\\CoreBundle\\Composer\\ScriptHandler::deleteOldFilesFrom19x"
],
"pre-update-cmd": [
"Chamilo\\CoreBundle\\Composer\\ScriptHandler::deleteOldFilesFrom19x"
],
"post-update-cmd": [ "post-update-cmd": [
"Chamilo\\CoreBundle\\Composer\\ScriptHandler::deleteOldFilesFrom19x",
"Chamilo\\CoreBundle\\Composer\\ScriptHandler::dumpCssFiles" "Chamilo\\CoreBundle\\Composer\\ScriptHandler::dumpCssFiles"
], ],
"pre-install-cmd": [
],
"post-install-cmd": [ "post-install-cmd": [
"Chamilo\\CoreBundle\\Composer\\ScriptHandler::dumpCssFiles" "Chamilo\\CoreBundle\\Composer\\ScriptHandler::dumpCssFiles"
] ]

@ -27,7 +27,8 @@ class ScriptHandler
public static function deleteOldFilesFrom19x() public static function deleteOldFilesFrom19x()
{ {
$path = __DIR__.'/../../../../main/inc/lib/symfony/'; $path = __DIR__.'/../../../../main/inc/lib/symfony/';
$fs = new Filesystem(); if (is_dir($path) && is_writable($path)) {
$fs->remove($path); rmdir($path);
}
} }
} }

@ -177,7 +177,7 @@ class Version110 extends AbstractMigrationChamilo
//'c_role_user', //'c_role_user',
'c_student_publication', 'c_student_publication',
'c_student_publication_assignment', 'c_student_publication_assignment',
'c_student_publication_comment', //'c_student_publication_comment',
'c_student_publication_rel_document', 'c_student_publication_rel_document',
'c_student_publication_rel_user', 'c_student_publication_rel_user',
//'c_survey', //'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 $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 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 DROP PRIMARY KEY");
$this->addSql("ALTER TABLE c_attendance_sheet ADD COLUMN iid int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT"); $this->addSql("ALTER TABLE c_attendance_sheet ADD COLUMN iid int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT");

Loading…
Cancel
Save