<?php declare(strict_types=1);

namespace Application\Migrations;

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

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20190405145420 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 mer_itdlc ALTER answer TYPE VARCHAR(255)');
        $this->addSql('ALTER TABLE mer_itdlc ALTER answer DROP DEFAULT');
        $this->addSql('ALTER INDEX idx_7322747e244ae7f0 RENAME TO IDX_80073050244AE7F0');
        $this->addSql('ALTER INDEX idx_7322747ef56082c RENAME TO IDX_80073050F56082C');
    }

    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 mer_ITDLC ALTER answer TYPE BOOLEAN');
        $this->addSql('ALTER TABLE mer_ITDLC ALTER answer DROP DEFAULT');
        $this->addSql('ALTER INDEX idx_80073050f56082c RENAME TO idx_7322747ef56082c');
        $this->addSql('ALTER INDEX idx_80073050244ae7f0 RENAME TO idx_7322747e244ae7f0');
    }
}
