<?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 Version20201116194855 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 predmet ADD jazyk VARCHAR(25) NOT NULL');
        $this->addSql('ALTER TABLE zak ADD rod_cis VARCHAR(10) NOT NULL, ADD pohlavi TINYINT(1) NOT NULL, ADD obcanstvi VARCHAR(4) NOT NULL, ADD op INT DEFAULT NULL, ADD pas INT DEFAULT NULL, ADD email VARCHAR(255) DEFAULT NULL, ADD m_cast VARCHAR(255) DEFAULT NULL, ADD pred_skol VARCHAR(4) DEFAULT NULL, ADD dat_zah DATE NOT NULL, ADD dat_uk DATE 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 predmet DROP jazyk');
        $this->addSql('ALTER TABLE zak DROP rod_cis, DROP pohlavi, DROP obcanstvi, DROP op, DROP pas, DROP email, DROP m_cast, DROP pred_skol, DROP dat_zah, DROP dat_uk');
    }
}
