<?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 Version20211117053349 extends AbstractMigration
{
public function getDescription(): string
{
return 'Changed integer columns to smallint in multiple tables.';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE company CHANGE type type SMALLINT NOT NULL, CHANGE status status SMALLINT NOT NULL, CHANGE step step SMALLINT NOT NULL');
$this->addSql('ALTER TABLE company_file CHANGE type type SMALLINT NOT NULL');
$this->addSql('ALTER TABLE demand CHANGE status status SMALLINT NOT NULL, CHANGE step step SMALLINT NOT NULL, CHANGE company_rating company_rating SMALLINT DEFAULT NULL, CHANGE tree_category tree_category SMALLINT DEFAULT NULL');
$this->addSql('ALTER TABLE demand_comment CHANGE status status SMALLINT DEFAULT NULL');
$this->addSql('ALTER TABLE demand_file CHANGE type type SMALLINT NOT NULL');
$this->addSql('ALTER TABLE demand_status CHANGE status status SMALLINT NOT NULL');
$this->addSql('ALTER TABLE token CHANGE type type SMALLINT NOT NULL');
$this->addSql('ALTER TABLE tree CHANGE category category SMALLINT NOT NULL');
$this->addSql('ALTER TABLE tree_file CHANGE type type SMALLINT NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE company CHANGE type type INT NOT NULL, CHANGE status status INT NOT NULL, CHANGE step step INT NOT NULL');
$this->addSql('ALTER TABLE company_file CHANGE type type INT NOT NULL');
$this->addSql('ALTER TABLE demand CHANGE status status INT NOT NULL, CHANGE step step INT NOT NULL, CHANGE company_rating company_rating INT DEFAULT NULL, CHANGE tree_category tree_category INT DEFAULT NULL');
$this->addSql('ALTER TABLE demand_comment CHANGE status status INT DEFAULT NULL');
$this->addSql('ALTER TABLE demand_file CHANGE type type INT NOT NULL');
$this->addSql('ALTER TABLE demand_status CHANGE status status INT NOT NULL');
$this->addSql('ALTER TABLE token CHANGE type type INT NOT NULL');
$this->addSql('ALTER TABLE tree CHANGE category category INT NOT NULL');
$this->addSql('ALTER TABLE tree_file CHANGE type type INT NOT NULL');
}
}