<?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 Version20200428094948 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($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE country ADD parent_country_id INT DEFAULT NULL, ADD tax_period_start DATE DEFAULT NULL, ADD tax_period_end DATE DEFAULT NULL, ADD max_working_days INT DEFAULT NULL, ADD description VARCHAR(500) DEFAULT NULL, DROP max_days');
$this->addSql('ALTER TABLE country ADD CONSTRAINT FK_5373C966BE6CBA20 FOREIGN KEY (parent_country_id) REFERENCES country (id)');
$this->addSql('CREATE INDEX IDX_5373C966BE6CBA20 ON country (parent_country_id)');
}
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 country DROP FOREIGN KEY FK_5373C966BE6CBA20');
$this->addSql('DROP INDEX IDX_5373C966BE6CBA20 ON country');
$this->addSql('ALTER TABLE country ADD max_days INT NOT NULL, DROP parent_country_id, DROP tax_period_start, DROP tax_period_end, DROP max_working_days, DROP description');
}
}