瀏覽代碼

Fix migration to 1.10.x on course_rel_user table

Angel Fernando Quiroz Campos 9 年之前
父節點
當前提交
41c2674578
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      app/Migrations/Schema/V110/Version110.php

+ 5 - 0
app/Migrations/Schema/V110/Version110.php

@@ -487,6 +487,11 @@ class Version110 extends AbstractMigrationChamilo
 
         $this->addSql("UPDATE settings_current SET selected_value = 'UTF-8' WHERE variable = 'platform_charset'");
 
+        $this->addSql("ALTER TABLE course_rel_user DROP PRIMARY KEY");
+        $this->addSql("ALTER TABLE course_rel_user ADD COLUMN id INT NOT NULL PRIMARY KEY AUTO_INCREMENT");
+        $this->addSql("ALTER TABLE course_rel_user MODIFY COLUMN user_id INT NULL");
+
+        $this->addSql("ALTER TABLE user MODIFY COLUMN user_id INT NULL");
     }
 
     /**