<?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 Version20190913184834 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->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE customer_rating_log ADD case_manager_user_id INT DEFAULT NULL, ADD lead_agent_user_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE customer_rating_log ADD CONSTRAINT FK_6B2F51BE1F7084AC FOREIGN KEY (case_manager_user_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('ALTER TABLE customer_rating_log ADD CONSTRAINT FK_6B2F51BE4FDF71D5 FOREIGN KEY (lead_agent_user_id) REFERENCES user (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_6B2F51BE1F7084AC ON customer_rating_log (case_manager_user_id)');
$this->addSql('CREATE INDEX IDX_6B2F51BE4FDF71D5 ON customer_rating_log (lead_agent_user_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE customer_rating_log DROP FOREIGN KEY FK_6B2F51BE1F7084AC');
$this->addSql('ALTER TABLE customer_rating_log DROP FOREIGN KEY FK_6B2F51BE4FDF71D5');
$this->addSql('DROP INDEX IDX_6B2F51BE1F7084AC ON customer_rating_log');
$this->addSql('DROP INDEX IDX_6B2F51BE4FDF71D5 ON customer_rating_log');
$this->addSql('ALTER TABLE customer_rating_log DROP case_manager_user_id, DROP lead_agent_user_id');
}
}