migrations/Version20240702065327.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20240702065327 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('CREATE TABLE hotel_category_site (id INT AUTO_INCREMENT NOT NULL, site_id INT DEFAULT NULL, hotel_category_id INT DEFAULT NULL, INDEX IDX_66CD3D8EF6BD1646 (site_id), INDEX IDX_66CD3D8ECC88D7CD (hotel_category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE hotel_category_site_translation (id INT AUTO_INCREMENT NOT NULL, hotel_category_site_id INT DEFAULT NULL, locale VARCHAR(255) NOT NULL, name VARCHAR(255) DEFAULT NULL, description LONGTEXT DEFAULT NULL, INDEX IDX_22E4304B2D7056F (hotel_category_site_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('CREATE TABLE hotel_destination_site (id INT AUTO_INCREMENT NOT NULL, site_id INT DEFAULT NULL, hotel_destination_id INT DEFAULT NULL, INDEX IDX_F950D382F6BD1646 (site_id), INDEX IDX_F950D382C437287B (hotel_destination_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  21.         $this->addSql('CREATE TABLE hotel_destination_site_translation (id INT AUTO_INCREMENT NOT NULL, hotel_destination_site_id INT DEFAULT NULL, locale VARCHAR(255) NOT NULL, name VARCHAR(255) DEFAULT NULL, description LONGTEXT DEFAULT NULL, page_description LONGTEXT DEFAULT NULL, iframe_youtube LONGTEXT DEFAULT NULL, iframe_vimeo LONGTEXT DEFAULT NULL, destination_description LONGTEXT DEFAULT NULL, INDEX IDX_73D47BDD458ECD0F (hotel_destination_site_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  22.         $this->addSql('CREATE TABLE tour_destination_site (id INT AUTO_INCREMENT NOT NULL, site_id INT DEFAULT NULL, tour_destination_id INT DEFAULT NULL, INDEX IDX_89FEC52F6BD1646 (site_id), INDEX IDX_89FEC521800822E (tour_destination_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  23.         $this->addSql('CREATE TABLE tour_destination_site_translation (id INT AUTO_INCREMENT NOT NULL, tour_destination_site_id INT DEFAULT NULL, locale VARCHAR(255) NOT NULL, name VARCHAR(255) DEFAULT NULL, description LONGTEXT DEFAULT NULL, INDEX IDX_9CC3731E9B020DD3 (tour_destination_site_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  24.         $this->addSql('ALTER TABLE hotel_category_site ADD CONSTRAINT FK_66CD3D8EF6BD1646 FOREIGN KEY (site_id) REFERENCES sites (id)');
  25.         $this->addSql('ALTER TABLE hotel_category_site ADD CONSTRAINT FK_66CD3D8ECC88D7CD FOREIGN KEY (hotel_category_id) REFERENCES hotel_category (id)');
  26.         $this->addSql('ALTER TABLE hotel_category_site_translation ADD CONSTRAINT FK_22E4304B2D7056F FOREIGN KEY (hotel_category_site_id) REFERENCES hotel_category_site (id)');
  27.         $this->addSql('ALTER TABLE hotel_destination_site ADD CONSTRAINT FK_F950D382F6BD1646 FOREIGN KEY (site_id) REFERENCES sites (id)');
  28.         $this->addSql('ALTER TABLE hotel_destination_site ADD CONSTRAINT FK_F950D382C437287B FOREIGN KEY (hotel_destination_id) REFERENCES hotel_destination (id)');
  29.         $this->addSql('ALTER TABLE hotel_destination_site_translation ADD CONSTRAINT FK_73D47BDD458ECD0F FOREIGN KEY (hotel_destination_site_id) REFERENCES hotel_destination_site (id)');
  30.         $this->addSql('ALTER TABLE tour_destination_site ADD CONSTRAINT FK_89FEC52F6BD1646 FOREIGN KEY (site_id) REFERENCES sites (id)');
  31.         $this->addSql('ALTER TABLE tour_destination_site ADD CONSTRAINT FK_89FEC521800822E FOREIGN KEY (tour_destination_id) REFERENCES tour_destination (id)');
  32.         $this->addSql('ALTER TABLE tour_destination_site_translation ADD CONSTRAINT FK_9CC3731E9B020DD3 FOREIGN KEY (tour_destination_site_id) REFERENCES tour_destination_site (id)');
  33.     }
  34.     public function down(Schema $schema): void
  35.     {
  36.         // this down() migration is auto-generated, please modify it to your needs
  37.         $this->addSql('ALTER TABLE hotel_category_site DROP FOREIGN KEY FK_66CD3D8EF6BD1646');
  38.         $this->addSql('ALTER TABLE hotel_category_site DROP FOREIGN KEY FK_66CD3D8ECC88D7CD');
  39.         $this->addSql('ALTER TABLE hotel_category_site_translation DROP FOREIGN KEY FK_22E4304B2D7056F');
  40.         $this->addSql('ALTER TABLE hotel_destination_site DROP FOREIGN KEY FK_F950D382F6BD1646');
  41.         $this->addSql('ALTER TABLE hotel_destination_site DROP FOREIGN KEY FK_F950D382C437287B');
  42.         $this->addSql('ALTER TABLE hotel_destination_site_translation DROP FOREIGN KEY FK_73D47BDD458ECD0F');
  43.         $this->addSql('ALTER TABLE tour_destination_site DROP FOREIGN KEY FK_89FEC52F6BD1646');
  44.         $this->addSql('ALTER TABLE tour_destination_site DROP FOREIGN KEY FK_89FEC521800822E');
  45.         $this->addSql('ALTER TABLE tour_destination_site_translation DROP FOREIGN KEY FK_9CC3731E9B020DD3');
  46.         $this->addSql('DROP TABLE hotel_category_site');
  47.         $this->addSql('DROP TABLE hotel_category_site_translation');
  48.         $this->addSql('DROP TABLE hotel_destination_site');
  49.         $this->addSql('DROP TABLE hotel_destination_site_translation');
  50.         $this->addSql('DROP TABLE tour_destination_site');
  51.         $this->addSql('DROP TABLE tour_destination_site_translation');
  52.     }
  53. }