<?php
declare(strict_types=1);
namespace StocksBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use App\Services\ObjectSerialize;
use Symfony\Component\Uid\UuidV6;
use Doctrine\Migrations\AbstractMigration;
final class Version20221212145610 extends AbstractMigration
{
private ObjectSerialize $objectSerialize;
public function setObjectSerialize(ObjectSerialize $objectSerialize)
{
$this->objectSerialize = $objectSerialize;
}
public function up(Schema $schema): void
{
}
public function down(Schema $schema): void
{
}
public function postUp(Schema $schema): void
{
parent::postUp($schema);
$now = (new \DateTime())->format('Y-m-d H:i:s');
$this->connection->insert('configuration', [
'id' => (new UuidV6())->toBinary(),
'name' => 'stocks_bundle__expiration_date_near_days',
'context_id' => null,
'value' => $this->objectSerialize->add((object) ['value' => 30]),
'created_at' => $now,
'updated_at' => $now
]);
}
}