migrations/Version20220115015851.php line 1

  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 Version20220115015851 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_8D93D649E7927C74 ON user');
  19.         $this->addSql('DROP INDEX UNIQ_8D93D64976F5C865 ON user');
  20.         $this->addSql('ALTER TABLE user ADD google_account_google_id VARCHAR(255) NOT NULL, ADD google_account_avatar VARCHAR(255) DEFAULT NULL, ADD google_account_email VARCHAR(255) NOT NULL, ADD google_account_first_name VARCHAR(255) NOT NULL, ADD google_account_last_name VARCHAR(255) NOT NULL, DROP email, DROP first_name, DROP last_name, DROP google_id');
  21.         $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649F97CC36E ON user (google_account_google_id)');
  22.         $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649EB69BF47 ON user (google_account_email)');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql('DROP INDEX UNIQ_8D93D649F97CC36E ON user');
  28.         $this->addSql('DROP INDEX UNIQ_8D93D649EB69BF47 ON user');
  29.         $this->addSql('ALTER TABLE user ADD email VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, ADD first_name VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, ADD last_name VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, ADD google_id VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, DROP google_account_google_id, DROP google_account_avatar, DROP google_account_email, DROP google_account_first_name, DROP google_account_last_name');
  30.         $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649E7927C74 ON user (email)');
  31.         $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D64976F5C865 ON user (google_id)');
  32.     }
  33. }