<?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 Version20190115134503 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 establishment ALTER support_them SET DEFAULT \'true\'');
        $this->addSql('ALTER TABLE establishment ALTER support_us SET DEFAULT \'false\'');
        $this->addSql('ALTER TABLE sms RENAME COLUMN "sendbinblue_api_return" TO "sendinblue_api_return"');
        $this->addSql('ALTER TABLE menu ADD params TEXT DEFAULT NULL');
        $this->addSql('COMMENT ON COLUMN menu.params IS \'(DC2Type:object)\'');
    }

    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('ALTER TABLE sms RENAME COLUMN "sendinblue_api_return" TO "sendbinblue_api_return"');
        $this->addSql('ALTER TABLE Menu DROP params');
        $this->addSql('ALTER TABLE establishment ALTER support_them SET DEFAULT \'false\'');
        $this->addSql('ALTER TABLE establishment ALTER support_us SET DEFAULT \'true\'');
    }
}
