<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20250224160220 extends AbstractMigration
{
public function getDescription(): string
{
return 'Copiying the old endpoint data and converting it into a serialized array format';
}
public function up(Schema $schema): void
{
$this->addSql('UPDATE webhook SET endpoints = CONCAT(\'a:1:{i:0;a:1:{s:8:"endpoint";s:\', CHAR_LENGTH(endpoint) , \':"\', endpoint, \'";}}\')');
}
public function down(Schema $schema): void
{
$this->addSql('UPDATE webhook SET endpoints = NULL');
}
}