<?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 Version20221122155826 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->addSql('CREATE TABLE bus_filter_tonnage (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, active TINYINT(1) DEFAULT 1, position INT NOT NULL, slug VARCHAR(255) NOT NULL, created_at DATETIME DEFAULT NULL, modified_at DATETIME DEFAULT NULL, created_user INT DEFAULT NULL, modified_user INT DEFAULT NULL, UNIQUE INDEX UNIQ_80E976F2989D9B62 (slug), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE bus ADD filter_tonnage_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE bus ADD CONSTRAINT FK_2F566B6922359F68 FOREIGN KEY (filter_tonnage_id) REFERENCES bus_filter_tonnage (id) ON DELETE SET NULL');
$this->addSql('CREATE INDEX IDX_2F566B6922359F68 ON bus (filter_tonnage_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE bus DROP FOREIGN KEY FK_2F566B6922359F68');
$this->addSql('DROP TABLE bus_filter_tonnage');
$this->addSql('DROP INDEX IDX_2F566B6922359F68 ON bus');
$this->addSql('ALTER TABLE bus DROP filter_tonnage_id');
}
}