Version20160808160000.php 784 B

12345678910111213141516171819202122232425262728293031
  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 Version20160808160000
  8. * Set ponderation and destination for questions and answers
  9. * @package Application\Migrations\Schema\V111
  10. */
  11. class Version20160808160000 extends AbstractMigrationChamilo
  12. {
  13. /**
  14. * @param Schema $schema
  15. */
  16. public function up(Schema $schema)
  17. {
  18. $this->addSql("UPDATE c_quiz_answer SET destination = NULL WHERE TRIM(destination) = ''");
  19. }
  20. /**
  21. * @param Schema $schema
  22. */
  23. public function down(Schema $schema)
  24. {
  25. $this->addSql("UPDATE c_quiz_answer SET destination = '' WHERE destination IS NULL");
  26. }
  27. }