migrations/Version20220222081418.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 Version20220222081418 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('ALTER TABLE media__media CHANGE provider_metadata provider_metadata LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\'');
  19.         $this->addSql('ALTER TABLE shop_categorie ADD domaine VARCHAR(50) DEFAULT NULL');
  20.         $this->addSql('UPDATE `shop_categorie` SET `domaine` = "code" WHERE `shop_categorie`.`id` = 17;');
  21.         $this->addSql('UPDATE `shop_categorie` SET `domaine` = "auto-conduite" WHERE `shop_categorie`.`id` = 18;');
  22.         $this->addSql('UPDATE `shop_categorie` SET `domaine` = "moto-circulation" WHERE `shop_categorie`.`id` = 19;');
  23.         $this->addSql('UPDATE `shop_categorie` SET `domaine` = "moto-plateau" WHERE `shop_categorie`.`id` = 20;');
  24.         $this->addSql('ALTER TABLE shop_produit DROP domaine');
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('ALTER TABLE media__media CHANGE provider_metadata provider_metadata LONGTEXT CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci` COMMENT \'(DC2Type:json)\'');
  30.         $this->addSql('ALTER TABLE shop_categorie DROP domaine');
  31.         $this->addSql('ALTER TABLE shop_produit ADD domaine VARCHAR(50) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`');
  32.     }
  33. }