migrations/Version20220408144414.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 Version20220408144414 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('ALTER TABLE cal_booking_room ADD additional_rent INT DEFAULT NULL, ADD previous_rent INT DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE cal_inventory ADD comment LONGTEXT DEFAULT NULL, ADD comment2 LONGTEXT DEFAULT NULL, ADD comment3 LONGTEXT DEFAULT NULL, ADD representative LONGTEXT DEFAULT NULL, ADD need_big_brother TINYINT(1) DEFAULT NULL');
  20.         $this->addSql('ALTER TABLE cal_inventory_item ADD image3_id INT DEFAULT NULL');
  21.         $this->addSql('ALTER TABLE cal_inventory_item ADD CONSTRAINT FK_5E61AC254F5B5DD8 FOREIGN KEY (image3_id) REFERENCES cal_room_item_image (id)');
  22.         $this->addSql('CREATE UNIQUE INDEX UNIQ_5E61AC254F5B5DD8 ON cal_inventory_item (image3_id)');
  23.         $this->addSql('ALTER TABLE cal_maintenance ADD closed_at DATETIME DEFAULT NULL');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->addSql('ALTER TABLE cal_booking_room DROP additional_rent, DROP previous_rent');
  29.         $this->addSql('ALTER TABLE cal_inventory DROP comment, DROP comment2, DROP comment3, DROP representative, DROP need_big_brother');
  30.         $this->addSql('ALTER TABLE cal_inventory_item DROP FOREIGN KEY FK_5E61AC254F5B5DD8');
  31.         $this->addSql('DROP INDEX UNIQ_5E61AC254F5B5DD8 ON cal_inventory_item');
  32.         $this->addSql('ALTER TABLE cal_inventory_item DROP image3_id');
  33.         $this->addSql('ALTER TABLE cal_maintenance DROP closed_at');
  34.     }
  35. }