src/CoreBundle/Migrations/Schema/V200/Version20231031204300.php
<?php
/* For licensing terms, see /license.txt */
declare(strict_types=1);
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
final class Version20231031204300 extends AbstractMigrationChamilo
{
public function getDescription(): string
{
return 'Allow message sender to be null';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE message DROP FOREIGN KEY FK_B6BD307FF6C43E79');
$this->addSql('ALTER TABLE message CHANGE user_sender_id user_sender_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE message ADD CONSTRAINT FK_B6BD307FF6C43E79 FOREIGN KEY (user_sender_id) REFERENCES user (id) ON DELETE SET NULL');
}
}