<?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 Version20201119210320 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('CREATE TABLE znevyhodneni (id INT AUTO_INCREMENT NOT NULL, ind_stud_plan INT NOT NULL, znevyhodneni VARCHAR(255) DEFAULT NULL, nadani INT DEFAULT NULL, upr_vzd_program INT DEFAULT NULL, odl_kult_prostredi VARCHAR(1) DEFAULT NULL, prodl_delka_vzd VARCHAR(255) DEFAULT NULL, uprava_vyst_vzdel TINYINT(1) DEFAULT NULL, dat_vyd_doporuc DATE DEFAULT NULL, dat_konce_doporuc DATE DEFAULT NULL, norm_fin_narocnost VARCHAR(20) DEFAULT NULL, forma_poriz_pomucky VARCHAR(1) DEFAULT NULL, fin_narocnost TINYINT(1) DEFAULT NULL, dat_zah_po DATE DEFAULT NULL, dat_uk_po DATE DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
        $this->addSql('ALTER TABLE trida ADD typ_tridy VARCHAR(255) NOT NULL, ADD tt VARCHAR(1) DEFAULT NULL');
        $this->addSql('ALTER TABLE ucitele ADD asistent_pedagoga TINYINT(1) NOT NULL');
        $this->addSql('ALTER TABLE skola ADD red_izo VARCHAR(20) NOT NULL, ADD izo_spz VARCHAR(20) 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('DROP TABLE znevyhodneni');
        $this->addSql('ALTER TABLE skola DROP red_izo, DROP izo_spz');
        $this->addSql('ALTER TABLE trida DROP typ_tridy, DROP tt');
        $this->addSql('ALTER TABLE ucitele DROP asistent_pedagoga');
    }
}
