vendor/bluue/sales-bundle/migrations/Version20230213150000.php line 1

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