vendor/bluue/mondialrelay-bundle/migrations/Version20230718210555.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace MondialrelayBundleMigrations;
  4. use App\Services\ObjectSerialize;
  5. use Doctrine\DBAL\Schema\Schema;
  6. use Doctrine\Migrations\AbstractMigration;
  7. use Symfony\Component\Uid\UuidV6;
  8. final class Version20230718210555 extends AbstractMigration
  9. {
  10.     private ObjectSerialize $objectSerialize;
  11.     public function setObjectSerialize(ObjectSerialize $objectSerialize)
  12.     {
  13.         $this->objectSerialize $objectSerialize;
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.     }
  18.     public function down(Schema $schema): void
  19.     {
  20.     }
  21.     public function postUp(Schema $schema): void
  22.     {
  23.         parent::postUp($schema);
  24.         $now = (new \DateTime())->format('Y-m-d H:i:s');
  25.         $this->connection->insert('configuration', [
  26.             'id' => (new UuidV6())->toBinary(),
  27.             'name' => 'mondialrelay_bundle__collection_mode',
  28.             'context_id' => null,
  29.             'value' => $this->objectSerialize->add((object)['value' => 'REL']),
  30.             'created_at' => $now,
  31.             'updated_at' => $now
  32.         ]);
  33.     }
  34. }