<?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 Version20200121160121 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_document_log ADD message_id INT DEFAULT NULL, DROP subject, DROP body');
$this->addSql('ALTER TABLE customer_document_log ADD CONSTRAINT FK_524D5938537A1329 FOREIGN KEY (message_id) REFERENCES customer_message (id) ON DELETE CASCADE');
$this->addSql('CREATE INDEX IDX_524D5938537A1329 ON customer_document_log (message_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_document_log DROP FOREIGN KEY FK_524D5938537A1329');
$this->addSql('DROP INDEX IDX_524D5938537A1329 ON customer_document_log');
$this->addSql('ALTER TABLE customer_document_log ADD subject VARCHAR(255) DEFAULT NULL COLLATE utf8mb4_general_ci, ADD body LONGTEXT DEFAULT NULL COLLATE utf8mb4_general_ci, DROP message_id');
}
}