<?php
declare(strict_types=1);
namespace CrmBundleMigrations;
use App\Services\ObjectSerialize;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
use Symfony\Component\Uid\UuidV6;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241018135140 extends AbstractMigration
{
/**
* @var ObjectSerialize
*/
private ObjectSerialize $objectSerialize;
/**
* @param ObjectSerialize $objectSerialize
* @return void
*/
public function setObjectSerialize(ObjectSerialize $objectSerialize)
{
$this->objectSerialize = $objectSerialize;
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
}
public function postUp(Schema $schema): void
{
parent::postUp($schema);
$now = (new \DateTime())->format('Y-m-d H:i:s');
$configurations = ['crm_bundle__notify_creation_opportunity' => []];
foreach ($configurations as $configuration => $value) {
$this->connection->update('configuration', [
'value' => $this->objectSerialize->add((object) ['value' => $value]),
'updated_at' => $now
], [
'name' => $configuration,
]);
}
}
}