Skip to content
Permalink
Browse files

Add migration fix for course_code column that shouldn't have been the…

…re in the first place
  • Loading branch information...
ywarnier committed May 22, 2017
1 parent 3114052 commit 98eb7229334bd7ce707c5b83f2494446b31f3c25
Showing with 38 additions and 0 deletions.
  1. +38 −0 app/Migrations/Schema/V111/Version20170522120000.php
@@ -0,0 +1,38 @@
<?php
/* For licensing terms, see /license.txt */
namespace Application\Migrations\Schema\V111;
use Application\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
/**
* Class Version20170522120000
* Remove track_e_attempt.course_code which is deleted between 1.9 and 1.10
* but somehow still existed in the 1.10 entity (and it is not deleted from
* 1.10 to 1.11)
* @package Application\Migrations\Schema\V111
*/
class Version20170522120000 extends AbstractMigrationChamilo
{
/**
* @param Schema $schema
*/
public function up(Schema $schema)
{
$trackEAttempt = $schema->getTable('track_e_attempt');
if ($trackEAttempt->hasColumn('course_code')) {
$this->addSql("ALTER TABLE track_e_attempt DROP COLUMN course_code");
}
}
/**
* Down does not do anything in this case because the field shouldn't
* have been there in the first place
* @param Schema $schema
*/
public function down(Schema $schema)
{
}
}

0 comments on commit 98eb722

Please sign in to comment.
You can’t perform that action at this time.