<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230315184105 extends AbstractMigration
{
public function getDescription(): string
{
return '+dates and code names changes';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE bus_offer ADD created_at DATETIME DEFAULT NULL, ADD updated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE bus_stop DROP position, CHANGE code_name code_name VARCHAR(50) NOT NULL');
$this->addSql('ALTER TABLE course CHANGE code_name code_name VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE `order` ADD created_at DATETIME DEFAULT NULL, ADD updated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE transaction ADD created_at DATETIME DEFAULT NULL, ADD updated_at DATETIME DEFAULT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE bus_offer DROP created_at, DROP updated_at');
$this->addSql('ALTER TABLE bus_stop ADD position INT NOT NULL, CHANGE code_name code_name VARCHAR(1) NOT NULL');
$this->addSql('ALTER TABLE course CHANGE code_name code_name VARCHAR(5) NOT NULL');
$this->addSql('ALTER TABLE `order` DROP created_at, DROP updated_at');
$this->addSql('ALTER TABLE transaction DROP created_at, DROP updated_at');
}
}