migrations/Version20240627125928.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 Version20240627125928 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_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');
  19.         $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');
  20.         $this->addSql('ALTER TABLE hotel_site ADD CONSTRAINT FK_DE86DF6CF6BD1646 FOREIGN KEY (site_id) REFERENCES sites (id)');
  21.         $this->addSql('ALTER TABLE hotel_site ADD CONSTRAINT FK_DE86DF6C3243BB18 FOREIGN KEY (hotel_id) REFERENCES hotel (id)');
  22.         $this->addSql('ALTER TABLE hotel_site_translation ADD CONSTRAINT FK_6CF5298825F7086F FOREIGN KEY (hotel_site_id) REFERENCES hotel_site (id)');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql('ALTER TABLE hotel_site DROP FOREIGN KEY FK_DE86DF6CF6BD1646');
  28.         $this->addSql('ALTER TABLE hotel_site DROP FOREIGN KEY FK_DE86DF6C3243BB18');
  29.         $this->addSql('ALTER TABLE hotel_site_translation DROP FOREIGN KEY FK_6CF5298825F7086F');
  30.         $this->addSql('DROP TABLE hotel_site');
  31.         $this->addSql('DROP TABLE hotel_site_translation');
  32.     }
  33. }