<?php declare(strict_types=1);

namespace Application\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20191125095752 extends AbstractMigration
{
    public function up(Schema $schema) : void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

        $this->addSql('ALTER TABLE config ALTER domain DROP NOT NULL');
        $this->addSql('ALTER TABLE mer_itdlc ALTER first_date DROP NOT NULL');
        $this->addSql('ALTER TABLE operationpee ALTER is_identity_mandatory SET NOT NULL');
    }

    public function down(Schema $schema) : void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');

        $this->addSql('CREATE SCHEMA public');
        $this->addSql('ALTER TABLE config ALTER domain SET NOT NULL');
        $this->addSql('ALTER TABLE OperationPEE ALTER is_identity_mandatory DROP NOT NULL');
        $this->addSql('ALTER TABLE mer_ITDLC ALTER first_date SET NOT NULL');
    }
}
