<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20200521151638 extends AbstractMigration
{
/**
* @param Schema $schema
*/
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE mint ADD period2_id INT DEFAULT NULL, ADD period3_id INT DEFAULT NULL, ADD period4_id INT DEFAULT NULL, CHANGE period_id period1_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE mint_audit ADD period2_id INT DEFAULT NULL, ADD period3_id INT DEFAULT NULL, ADD period4_id INT DEFAULT NULL, CHANGE period_id period1_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE person ADD period3_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE person_audit ADD period3_id INT DEFAULT NULL');
}
/**
* @param Schema $schema
*/
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE mint DROP period2_id, DROP period3_id, DROP period4_id, CHANGE period1_id period_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE mint_audit DROP period2_id, DROP period3_id, DROP period4_id, CHANGE period1_id period_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE person DROP period3_id');
$this->addSql('ALTER TABLE person_audit DROP period3_id');
}
}