migrations/Version20231219221541.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20231219221541 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('DROP INDEX UNIQ_8D93D649A0D96FBF ON user');
  19.         $this->addSql('DROP INDEX UNIQ_8D93D64992FC23A8 ON user');
  20.         $this->addSql('ALTER TABLE user ADD newPassword VARCHAR(255) DEFAULT NULL, ADD type VARCHAR(30) DEFAULT NULL, ADD photo LONGTEXT DEFAULT NULL, ADD reset_password_token VARCHAR(255) DEFAULT NULL, ADD reset_password_token_expires_at DATETIME DEFAULT NULL, DROP username, DROP username_canonical, DROP email_canonical, CHANGE email email VARCHAR(180) DEFAULT NULL, CHANGE enabled enabled TINYINT(1) DEFAULT NULL, CHANGE salt salt VARCHAR(1000) DEFAULT NULL, CHANGE password password VARCHAR(255) DEFAULT NULL');
  21.     }
  22.     public function down(Schema $schema): void
  23.     {
  24.         // this down() migration is auto-generated, please modify it to your needs
  25.         $this->addSql('ALTER TABLE user ADD username VARCHAR(180) NOT NULL, ADD username_canonical VARCHAR(180) NOT NULL, ADD email_canonical VARCHAR(180) NOT NULL, DROP newPassword, DROP type, DROP photo, DROP reset_password_token, DROP reset_password_token_expires_at, CHANGE email email VARCHAR(180) NOT NULL, CHANGE salt salt VARCHAR(255) DEFAULT NULL, CHANGE password password VARCHAR(255) NOT NULL, CHANGE enabled enabled TINYINT(1) NOT NULL');
  26.         $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649A0D96FBF ON user (email_canonical)');
  27.         $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D64992FC23A8 ON user (username_canonical)');
  28.     }
  29. }