vendor/bluue/categories-bundle/migrations/Version20231001140117.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace CategoriesBundleMigrations;
  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 Version20231001140117 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' => 'categories_bundle__shared_categories',
  25.             'context_id' => null,
  26.             'value' => $this->objectSerialize->add((object) ['value' => '1']),
  27.             'created_at' => (new DateTime())->format('Y-m-d H:i:s'),
  28.             'updated_at' => (new DateTime())->format('Y-m-d H:i:s')
  29.         ]);
  30.     }
  31.     public function down(Schema $schema): void
  32.     {
  33.     }
  34. }