<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20230126155948 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE notification_list ADD user_id INT DEFAULT NULL, ADD role_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE notification_list ADD CONSTRAINT FK_FCF4B322A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE notification_list ADD CONSTRAINT FK_FCF4B322D60322AC FOREIGN KEY (role_id) REFERENCES role (id)');
$this->addSql('CREATE INDEX IDX_FCF4B322A76ED395 ON notification_list (user_id)');
$this->addSql('CREATE INDEX IDX_FCF4B322D60322AC ON notification_list (role_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE notification_list DROP FOREIGN KEY FK_FCF4B322A76ED395');
$this->addSql('ALTER TABLE notification_list DROP FOREIGN KEY FK_FCF4B322D60322AC');
$this->addSql('DROP INDEX IDX_FCF4B322A76ED395 ON notification_list');
$this->addSql('DROP INDEX IDX_FCF4B322D60322AC ON notification_list');
$this->addSql('ALTER TABLE notification_list DROP user_id, DROP role_id');
}
}