vendor/bluue/shipments-bundle/migrations/Version20240528120442.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace ShipmentsBundleMigrations;
  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 Version20240528120442 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.         // this up() migration is auto-generated, please modify it to your needs
  18.     }
  19.     public function postUp(Schema $schema): void
  20.     {
  21.         $now = (new \DateTime())->format('Y-m-d H:i:s');
  22.         $configuration 'shipments_bundle__number_days_before_removal';
  23.         $this->connection->insert('configuration', [
  24.             'id' => (new UuidV6())->toBinary(),
  25.             'name' => $configuration,
  26.             'context_id' => null,
  27.             'value' => $this->objectSerialize->add((object) ['value' => 120]),
  28.             'created_at' => $now,
  29.             'updated_at' => $now
  30.         ]);
  31.         $this->connection->insert('cron_job', [
  32.             'name' => 'shipments:auto-delete-label',
  33.             'command' => 'bluue-bundle:shipments:auto-delete-label',
  34.             'schedule' => '0 1 * * *',
  35.             'description' => '',
  36.             'enabled' => 1
  37.         ]);
  38.     }
  39.     public function down(Schema $schema): void
  40.     {
  41.         // this down() migration is auto-generated, please modify it to your needs
  42.     }
  43. }