migrations/Version20260611210219.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. final class Version20260611210219 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return 'Filling data for shopInfo field';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         $this->addSql("
  15.             UPDATE `order` o
  16.             INNER JOIN shop s ON s.id = o.shop_id
  17.             SET o.shop_info = JSON_OBJECT(
  18.                 'name', s.name,
  19.                 'timezone', s.time_zone
  20.             )
  21.             WHERE o.shop_info IS NULL
  22.         ");
  23.     }
  24. }