migrations/Version20240912134532DataUpdate.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use App\Entity\Workflow\MailTag;
  5. use Doctrine\DBAL\Schema\Schema;
  6. use Doctrine\Migrations\AbstractMigration;
  7. use Symfony\Component\DependencyInjection\ContainerAwareInterface;
  8. use Symfony\Component\DependencyInjection\ContainerAwareTrait;
  9. /**
  10.  * Auto-generated Migration: Please modify to your needs!
  11.  */
  12. final class Version20240912134532DataUpdate extends AbstractMigration implements ContainerAwareInterface
  13. {
  14.     use ContainerAwareTrait;
  15.     public function getDescription(): string
  16.     {
  17.         return '';
  18.     }
  19.     public function up(Schema $schema): void
  20.     
  21.         $entityManager $this->container->get('doctrine.orm.entity_manager');
  22.         $newMailTag = (new MailTag())
  23.             ->setName(MailTag::MAIL_TAG_COUNTRY)
  24.             ->setVisibleName('[@country]')
  25.             ->setDescription('Show client\'s country.');
  26.     
  27.         $entityManager->persist($newMailTag);
  28.         $entityManager->flush();
  29.     }
  30.     public function down(Schema $schema): void
  31.     {
  32.         // this down() migration is auto-generated, please modify it to your needs
  33.     }
  34. }