vendor/bluue/suppliers-bundle/migrations/Version20230321143700.php line 1

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