<?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 Version20240701131641 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 tour_site (id INT AUTO_INCREMENT NOT NULL, site_id INT DEFAULT NULL, tour_id INT DEFAULT NULL, INDEX IDX_4873E9C4F6BD1646 (site_id), INDEX IDX_4873E9C415ED8D43 (tour_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE tour_site_translation (id INT AUTO_INCREMENT NOT NULL, tour_site_id INT DEFAULT NULL, locale VARCHAR(255) NOT NULL, name VARCHAR(255) DEFAULT NULL, INDEX IDX_9D3A1658B65793C7 (tour_site_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE tour_site ADD CONSTRAINT FK_4873E9C4F6BD1646 FOREIGN KEY (site_id) REFERENCES sites (id)');
$this->addSql('ALTER TABLE tour_site ADD CONSTRAINT FK_4873E9C415ED8D43 FOREIGN KEY (tour_id) REFERENCES tour (id)');
$this->addSql('ALTER TABLE tour_site_translation ADD CONSTRAINT FK_9D3A1658B65793C7 FOREIGN KEY (tour_site_id) REFERENCES tour_site (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE tour_site DROP FOREIGN KEY FK_4873E9C4F6BD1646');
$this->addSql('ALTER TABLE tour_site DROP FOREIGN KEY FK_4873E9C415ED8D43');
$this->addSql('ALTER TABLE tour_site_translation DROP FOREIGN KEY FK_9D3A1658B65793C7');
$this->addSql('DROP TABLE tour_site');
$this->addSql('DROP TABLE tour_site_translation');
}
}