Version20170522120000.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. namespace Application\Migrations\Schema\V111;
  4. use Application\Migrations\AbstractMigrationChamilo;
  5. use Doctrine\DBAL\Schema\Schema;
  6. /**
  7. * Class Version20170522120000
  8. * Remove track_e_attempt.course_code which is deleted between 1.9 and 1.10
  9. * but somehow still existed in the 1.10 entity (and it is not deleted from
  10. * 1.10 to 1.11)
  11. * @package Application\Migrations\Schema\V111
  12. */
  13. class Version20170522120000 extends AbstractMigrationChamilo
  14. {
  15. /**
  16. * @param Schema $schema
  17. */
  18. public function up(Schema $schema)
  19. {
  20. $trackEAttempt = $schema->getTable('track_e_attempt');
  21. if ($trackEAttempt->hasColumn('course_code')) {
  22. $this->addSql("ALTER TABLE track_e_attempt DROP COLUMN course_code");
  23. }
  24. }
  25. /**
  26. * Down does not do anything in this case because the field shouldn't
  27. * have been there in the first place
  28. * @param Schema $schema
  29. */
  30. public function down(Schema $schema)
  31. {
  32. }
  33. }