Version20170522120000.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. error_log('Version20170522120000');
  21. $trackEAttempt = $schema->getTable('track_e_attempt');
  22. if ($trackEAttempt->hasColumn('course_code')) {
  23. $this->addSql("ALTER TABLE track_e_attempt DROP COLUMN course_code");
  24. }
  25. }
  26. /**
  27. * Down does not do anything in this case because the field shouldn't
  28. * have been there in the first place
  29. * @param Schema $schema
  30. */
  31. public function down(Schema $schema)
  32. {
  33. }
  34. }