migrations/Version20220929161348.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 Version20220929161348 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 cal_accommodation_access_step (id INT AUTO_INCREMENT NOT NULL, info_id INT DEFAULT NULL, type VARCHAR(100) DEFAULT NULL, code VARCHAR(50) DEFAULT NULL, description LONGTEXT DEFAULT NULL, INDEX IDX_285FE12C5D8BC1F8 (info_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('CREATE TABLE cal_accommodation_key (id INT AUTO_INCREMENT NOT NULL, info_id INT DEFAULT NULL, photo_id INT DEFAULT NULL, reproduction_id INT DEFAULT NULL, number VARCHAR(20) DEFAULT NULL, type VARCHAR(100) DEFAULT NULL, location LONGTEXT DEFAULT NULL, steps LONGTEXT DEFAULT NULL, INDEX IDX_37B55C495D8BC1F8 (info_id), UNIQUE INDEX UNIQ_37B55C497E9E4C8C (photo_id), UNIQUE INDEX UNIQ_37B55C4992C5DB63 (reproduction_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  20.         $this->addSql('ALTER TABLE cal_accommodation_access_step ADD CONSTRAINT FK_285FE12C5D8BC1F8 FOREIGN KEY (info_id) REFERENCES cal_accommodation_info (id)');
  21.         $this->addSql('ALTER TABLE cal_accommodation_key ADD CONSTRAINT FK_37B55C495D8BC1F8 FOREIGN KEY (info_id) REFERENCES cal_accommodation_info (id)');
  22.         $this->addSql('ALTER TABLE cal_accommodation_key ADD CONSTRAINT FK_37B55C497E9E4C8C FOREIGN KEY (photo_id) REFERENCES cal_accommodation_image (id)');
  23.         $this->addSql('ALTER TABLE cal_accommodation_key ADD CONSTRAINT FK_37B55C4992C5DB63 FOREIGN KEY (reproduction_id) REFERENCES cal_accommodation_image (id)');
  24.         $this->addSql('ALTER TABLE cal_accommodation_info ADD rental_management_fees_percent INT DEFAULT NULL, ADD rental_fees INT DEFAULT NULL, ADD big_brother_fees INT DEFAULT NULL, ADD total_keyrings INT DEFAULT NULL, ADD total_keys_by_keyrings INT DEFAULT NULL, ADD keyrings_id VARCHAR(50) DEFAULT NULL');
  25.     }
  26.     public function down(Schema $schema): void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->addSql('ALTER TABLE cal_accommodation_access_step DROP FOREIGN KEY FK_285FE12C5D8BC1F8');
  30.         $this->addSql('ALTER TABLE cal_accommodation_key DROP FOREIGN KEY FK_37B55C495D8BC1F8');
  31.         $this->addSql('ALTER TABLE cal_accommodation_key DROP FOREIGN KEY FK_37B55C497E9E4C8C');
  32.         $this->addSql('ALTER TABLE cal_accommodation_key DROP FOREIGN KEY FK_37B55C4992C5DB63');
  33.         $this->addSql('DROP TABLE cal_accommodation_access_step');
  34.         $this->addSql('DROP TABLE cal_accommodation_key');
  35.         $this->addSql('ALTER TABLE cal_accommodation_info DROP rental_management_fees_percent, DROP rental_fees, DROP big_brother_fees, DROP total_keyrings, DROP total_keys_by_keyrings, DROP keyrings_id');
  36.     }
  37. }