Version20150803171220.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. namespace Application\Migrations\Schema\V110;
  4. use Application\Migrations\AbstractMigrationChamilo;
  5. use Doctrine\DBAL\Schema\Schema;
  6. /**
  7. * Class Version20150803171220
  8. *
  9. * @package Application\Migrations\Schema\V110
  10. */
  11. class Version20150803171220 extends AbstractMigrationChamilo
  12. {
  13. /**
  14. * @param Schema $schema
  15. */
  16. public function up(Schema $schema)
  17. {
  18. $this->addSql('UPDATE user SET username_canonical = username');
  19. $this->addSql('ALTER TABLE user ADD confirmation_token VARCHAR(255) NULL');
  20. $this->addSql('ALTER TABLE user ADD password_requested_at DATETIME DEFAULT NULL');
  21. $this->addSql('RENAME TABLE track_e_exercices TO track_e_exercises');
  22. // This drops the old table
  23. // $schema->renameTable('track_e_exercices', 'track_e_exercises');
  24. }
  25. /**
  26. * @param Schema $schema
  27. */
  28. public function down(Schema $schema)
  29. {
  30. $this->addSql('ALTER TABLE user DROP confirmation_token');
  31. $this->addSql('ALTER TABLE user DROP password_requested_at');
  32. }
  33. }