<?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 Version20191007164307 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 notification ADD project_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE notification ADD CONSTRAINT FK_BF5476CA166D1F9C FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_BF5476CA166D1F9C ON notification (project_id)');
$this->addSql('ALTER TABLE notification CHANGE type type ENUM(\'system\',\'customer\',\'customer_comment\',\'customer_message\',\'customer_file\',\'customer_upsell_request\',\'customer_rating_log\',\'lead\',\'event\',\'project\',\'feed\',\'issue\') NOT NULL COMMENT \'(DC2Type:NotificationSectionType)\'');
}
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 notification CHANGE type type ENUM(\'system\',\'customer\',\'customer_comment\',\'customer_message\',\'customer_file\',\'customer_upsell_request\',\'customer_rating_log\',\'lead\',\'event\',\'feed\',\'issue\') NOT NULL COMMENT \'(DC2Type:NotificationSectionType)\'');
$this->addSql('ALTER TABLE notification DROP FOREIGN KEY FK_BF5476CA166D1F9C');
$this->addSql('DROP INDEX IDX_BF5476CA166D1F9C ON notification');
$this->addSql('ALTER TABLE notification DROP project_id');
}
}