<?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 Version20200121154432 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 DROP FOREIGN KEY FK_524D5938C33F7837');
$this->addSql('ALTER TABLE customer_document_log ADD subject VARCHAR(255) DEFAULT NULL, ADD body LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE customer_document_log ADD CONSTRAINT FK_524D5938C33F7837 FOREIGN KEY (document_id) REFERENCES config_document (id) ON DELETE SET NULL');
}
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_524D5938C33F7837');
$this->addSql('ALTER TABLE customer_document_log DROP subject, DROP body');
$this->addSql('ALTER TABLE customer_document_log ADD CONSTRAINT FK_524D5938C33F7837 FOREIGN KEY (document_id) REFERENCES config_document (id) ON DELETE CASCADE');
}
}