<?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 Version20240627125928 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 hotel_site (id INT AUTO_INCREMENT NOT NULL, site_id INT DEFAULT NULL, hotel_id INT DEFAULT NULL, INDEX IDX_DE86DF6CF6BD1646 (site_id), INDEX IDX_DE86DF6C3243BB18 (hotel_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE hotel_site_translation (id INT AUTO_INCREMENT NOT NULL, hotel_site_id INT DEFAULT NULL, locale VARCHAR(255) NOT NULL, name VARCHAR(255) DEFAULT NULL, address VARCHAR(255) DEFAULT NULL, INDEX IDX_6CF5298825F7086F (hotel_site_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE hotel_site ADD CONSTRAINT FK_DE86DF6CF6BD1646 FOREIGN KEY (site_id) REFERENCES sites (id)');
$this->addSql('ALTER TABLE hotel_site ADD CONSTRAINT FK_DE86DF6C3243BB18 FOREIGN KEY (hotel_id) REFERENCES hotel (id)');
$this->addSql('ALTER TABLE hotel_site_translation ADD CONSTRAINT FK_6CF5298825F7086F FOREIGN KEY (hotel_site_id) REFERENCES hotel_site (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE hotel_site DROP FOREIGN KEY FK_DE86DF6CF6BD1646');
$this->addSql('ALTER TABLE hotel_site DROP FOREIGN KEY FK_DE86DF6C3243BB18');
$this->addSql('ALTER TABLE hotel_site_translation DROP FOREIGN KEY FK_6CF5298825F7086F');
$this->addSql('DROP TABLE hotel_site');
$this->addSql('DROP TABLE hotel_site_translation');
}
}