<?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 Version20240926061039 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE hotel_category_sites (hotel_category_id INT NOT NULL, sites_id INT NOT NULL, INDEX IDX_1168AC11CC88D7CD (hotel_category_id), INDEX IDX_1168AC117838E496 (sites_id), PRIMARY KEY(hotel_category_id, sites_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE tour_category_sites (tour_category_id INT NOT NULL, sites_id INT NOT NULL, INDEX IDX_CD5F06447210CF21 (tour_category_id), INDEX IDX_CD5F06447838E496 (sites_id), PRIMARY KEY(tour_category_id, sites_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE hotel_category_sites ADD CONSTRAINT FK_1168AC11CC88D7CD FOREIGN KEY (hotel_category_id) REFERENCES hotel_category (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE hotel_category_sites ADD CONSTRAINT FK_1168AC117838E496 FOREIGN KEY (sites_id) REFERENCES sites (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE tour_category_sites ADD CONSTRAINT FK_CD5F06447210CF21 FOREIGN KEY (tour_category_id) REFERENCES tour_category (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE tour_category_sites ADD CONSTRAINT FK_CD5F06447838E496 FOREIGN KEY (sites_id) REFERENCES sites (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE hotel_category_sites DROP FOREIGN KEY FK_1168AC11CC88D7CD');
$this->addSql('ALTER TABLE hotel_category_sites DROP FOREIGN KEY FK_1168AC117838E496');
$this->addSql('ALTER TABLE tour_category_sites DROP FOREIGN KEY FK_CD5F06447210CF21');
$this->addSql('ALTER TABLE tour_category_sites DROP FOREIGN KEY FK_CD5F06447838E496');
$this->addSql('DROP TABLE hotel_category_sites');
$this->addSql('DROP TABLE tour_category_sites');
}
}