@ -429,6 +429,169 @@ class Version111 extends AbstractMigrationChamilo
$this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('show_glossary_in_extra_tools', 'exercise', 'Exercise')");
$this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('show_glossary_in_extra_tools', 'lp', 'LearningPath')");
$this->addSql("INSERT INTO settings_options (variable, value, display_text) VALUES ('show_glossary_in_extra_tools', 'exercise_and_lp', 'ExerciseAndLearningPath')");
// Fixes from 1.10.x
// Promotion
if ($schema->hasTable('promotion')) {
$table = $schema->getTable('promotion');
$this->addSql('ALTER TABLE promotion CHANGE name name VARCHAR(255) NOT NULL, CHANGE description description LONGTEXT NOT NULL, CHANGE career_id career_id INT DEFAULT NULL, CHANGE status status INT');
if ($table->hasForeignKey('FK_C11D7DD1B58CDA09') == false) {
if ($table->hasIndex('IDX_C11D7DD1B58CDA09') == false) {
$this->addSql('CREATE INDEX IDX_C11D7DD1B58CDA09 ON promotion (career_id);');
}
}
// Skill
if ($schema->hasTable('skill')) {
$table = $schema->getTable('skill');
$this->addSql('ALTER TABLE skill CHANGE name name VARCHAR(255) NOT NULL, CHANGE short_code short_code VARCHAR(100) NOT NULL, CHANGE description description LONGTEXT NOT NULL, CHANGE icon icon VARCHAR(255) NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL;');
if ($table->hasForeignKey('FK_5E3DE477CCFA12B8') == false) {
if ($table->hasIndex('IDX_7AE9F6B6484A9317') == false) {
$this->addSql('CREATE INDEX IDX_7AE9F6B6484A9317 ON skill_rel_user_comment (skill_rel_user_id);');
}
if ($table->hasIndex('IDX_7AE9F6B63AF3B65B') == false) {
$this->addSql('CREATE INDEX IDX_7AE9F6B63AF3B65B ON skill_rel_user_comment (feedback_giver_id);');
}
if ($table->hasIndex('idx_select_su_giver') == false) {
$this->addSql('CREATE INDEX idx_select_su_giver ON skill_rel_user_comment (skill_rel_user_id, feedback_giver_id);');
}
}
$this->addSql('ALTER TABLE skill_rel_gradebook CHANGE type type VARCHAR(10) NOT NULL;');
// skill_level
if ($schema->hasTable('skill_level')) {
$table = $schema->getTable('skill_level');
$this->addSql('ALTER TABLE skill_level CHANGE profile_id profile_id INT DEFAULT NULL, CHANGE position position INT NOT NULL, CHANGE short_name short_name VARCHAR(255) NOT NULL;');
if ($table->hasForeignKey('FK_BFC25F2FCCFA12B8') == false) {
$this->addSql('ALTER TABLE session_rel_course DROP category, CHANGE session_id session_id INT NOT NULL, CHANGE c_id c_id INT NOT NULL, CHANGE nbr_users nbr_users INT NOT NULL, CHANGE position position INT NOT NULL;');