<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20221013005105 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE message ADD sender_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE message ADD CONSTRAINT FK_B6BD307FF624B39D FOREIGN KEY (sender_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_B6BD307FF624B39D ON message (sender_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE message DROP FOREIGN KEY FK_B6BD307FF624B39D');
$this->addSql('DROP INDEX IDX_B6BD307FF624B39D ON message');
$this->addSql('ALTER TABLE message DROP sender_id');
}
}