<?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 Version20201119221518 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 zak DROP FOREIGN KEY FK_A1D6A2C3D53FBD');
        $this->addSql('DROP INDEX UNIQ_A1D6A2C3D53FBD ON zak');
        $this->addSql('ALTER TABLE zak ADD ind_stud_plan INT NOT NULL, ADD znevyhodneni VARCHAR(255) DEFAULT NULL, ADD upr_vzd_program INT DEFAULT NULL, ADD odl_kult_prostredi VARCHAR(1) DEFAULT NULL, ADD prodl_delka_vzd VARCHAR(255) DEFAULT NULL, ADD uprava_vyst_vzdel TINYINT(1) DEFAULT NULL, ADD dat_vyd_doporuc DATE DEFAULT NULL, ADD dat_konce_doporuc DATE DEFAULT NULL, ADD norm_fin_narocnost VARCHAR(20) DEFAULT NULL, ADD forma_poriz_pomucky VARCHAR(1) DEFAULT NULL, ADD fin_narocnost TINYINT(1) DEFAULT NULL, ADD dat_zah_po DATE DEFAULT NULL, ADD dat_uk_po DATE DEFAULT NULL, CHANGE znevyhodneni_id nadani INT DEFAULT 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() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');

        $this->addSql('ALTER TABLE zak ADD znevyhodneni_id INT DEFAULT NULL, DROP ind_stud_plan, DROP znevyhodneni, DROP nadani, DROP upr_vzd_program, DROP odl_kult_prostredi, DROP prodl_delka_vzd, DROP uprava_vyst_vzdel, DROP dat_vyd_doporuc, DROP dat_konce_doporuc, DROP norm_fin_narocnost, DROP forma_poriz_pomucky, DROP fin_narocnost, DROP dat_zah_po, DROP dat_uk_po');
        $this->addSql('ALTER TABLE zak ADD CONSTRAINT FK_A1D6A2C3D53FBD FOREIGN KEY (znevyhodneni_id) REFERENCES znevyhodneni (id)');
        $this->addSql('CREATE UNIQUE INDEX UNIQ_A1D6A2C3D53FBD ON zak (znevyhodneni_id)');
    }
}
