<?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 Version20230223075920 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 shuttle_tour_company_mapping (id INT AUTO_INCREMENT NOT NULL, shuttle_tour_id INT DEFAULT NULL, shuttle_company_id INT DEFAULT NULL, position INT NOT NULL, INDEX IDX_659363F368B2E502 (shuttle_tour_id), INDEX IDX_659363F3B0335096 (shuttle_company_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE shuttle_tour_company_mapping ADD CONSTRAINT FK_659363F368B2E502 FOREIGN KEY (shuttle_tour_id) REFERENCES shuttle_tour (id)');
$this->addSql('ALTER TABLE shuttle_tour_company_mapping ADD CONSTRAINT FK_659363F3B0335096 FOREIGN KEY (shuttle_company_id) REFERENCES shuttle_company (id)');
$this->addSql('ALTER TABLE shuttle_company_date_mapping DROP FOREIGN KEY FK_287894AB68B2E502');
$this->addSql('DROP INDEX IDX_287894AB68B2E502 ON shuttle_company_date_mapping');
$this->addSql('ALTER TABLE shuttle_company_date_mapping DROP shuttle_tour_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE shuttle_tour_company_mapping');
$this->addSql('ALTER TABLE shuttle_company_date_mapping ADD shuttle_tour_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE shuttle_company_date_mapping ADD CONSTRAINT FK_287894AB68B2E502 FOREIGN KEY (shuttle_tour_id) REFERENCES shuttle_tour (id)');
$this->addSql('CREATE INDEX IDX_287894AB68B2E502 ON shuttle_company_date_mapping (shuttle_tour_id)');
}
}