migrations/Version20210303112631.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 Version20210303112631 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_rooms_charges_details (accommodation_room_id INT NOT NULL, property_list_item_id INT NOT NULL, INDEX IDX_24AAF9D718230469 (accommodation_room_id), INDEX IDX_24AAF9D71257F0A (property_list_item_id), PRIMARY KEY(accommodation_room_id, property_list_item_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE cal_accommodation_rooms_charges_details ADD CONSTRAINT FK_24AAF9D718230469 FOREIGN KEY (accommodation_room_id) REFERENCES cal_accommodation_room (id) ON DELETE CASCADE');
  20.         $this->addSql('ALTER TABLE cal_accommodation_rooms_charges_details ADD CONSTRAINT FK_24AAF9D71257F0A FOREIGN KEY (property_list_item_id) REFERENCES cal_property_list_item (id) ON DELETE CASCADE');
  21.         $this->addSql('ALTER TABLE cal_property_list_item ADD description_id INT DEFAULT NULL');
  22.         $this->addSql('ALTER TABLE cal_property_list_item ADD CONSTRAINT FK_82B5FD0ED9F966B FOREIGN KEY (description_id) REFERENCES cal_translation (id)');
  23.         $this->addSql('CREATE UNIQUE INDEX UNIQ_82B5FD0ED9F966B ON cal_property_list_item (description_id)');
  24.         $this->addSql('ALTER TABLE cal_user ADD job VARCHAR(50) DEFAULT NULL, CHANGE password password VARCHAR(255) 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('DROP TABLE cal_accommodation_rooms_charges_details');
  30.         $this->addSql('ALTER TABLE cal_property_list_item DROP FOREIGN KEY FK_82B5FD0ED9F966B');
  31.         $this->addSql('DROP INDEX UNIQ_82B5FD0ED9F966B ON cal_property_list_item');
  32.         $this->addSql('ALTER TABLE cal_property_list_item DROP description_id');
  33.         $this->addSql('ALTER TABLE cal_user DROP job, CHANGE password password VARCHAR(100) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
  34.     }
  35. }