migrations/Version20251111135209.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 Version20251111135209 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 as_demenagement_address ADD quotation_id INT NOT NULL');
  19.         $this->addSql('ALTER TABLE as_demenagement_address ADD CONSTRAINT FK_9987E465B4EA4E60 FOREIGN KEY (quotation_id) REFERENCES as_demenagement_quotation (id)');
  20.         $this->addSql('CREATE INDEX IDX_9987E465B4EA4E60 ON as_demenagement_address (quotation_id)');
  21.         $this->addSql('ALTER TABLE as_demenagement_quotation DROP FOREIGN KEY FK_732753010AEBBB');
  22.         $this->addSql('ALTER TABLE as_demenagement_quotation DROP FOREIGN KEY FK_7327530727DB8F6');
  23.         $this->addSql('DROP INDEX IDX_732753010AEBBB ON as_demenagement_quotation');
  24.         $this->addSql('DROP INDEX IDX_7327530727DB8F6 ON as_demenagement_quotation');
  25.         $this->addSql('ALTER TABLE as_demenagement_quotation DROP loading_address_id, DROP unloading_address_id');
  26.         $this->addSql('ALTER TABLE exemple_page_content CHANGE content content LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\'');
  27.         $this->addSql('ALTER TABLE user CHANGE roles roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
  28.     }
  29.     public function down(Schema $schema): void
  30.     {
  31.         // this down() migration is auto-generated, please modify it to your needs
  32.         $this->addSql('ALTER TABLE exemple_page_content CHANGE content content LONGTEXT DEFAULT NULL COLLATE `utf8mb4_bin`');
  33.         $this->addSql('ALTER TABLE user CHANGE roles roles LONGTEXT NOT NULL COLLATE `utf8mb4_bin`');
  34.         $this->addSql('ALTER TABLE as_demenagement_quotation ADD loading_address_id INT DEFAULT NULL, ADD unloading_address_id INT DEFAULT NULL');
  35.         $this->addSql('ALTER TABLE as_demenagement_quotation ADD CONSTRAINT FK_732753010AEBBB FOREIGN KEY (loading_address_id) REFERENCES as_demenagement_address (id)');
  36.         $this->addSql('ALTER TABLE as_demenagement_quotation ADD CONSTRAINT FK_7327530727DB8F6 FOREIGN KEY (unloading_address_id) REFERENCES as_demenagement_address (id)');
  37.         $this->addSql('CREATE INDEX IDX_732753010AEBBB ON as_demenagement_quotation (loading_address_id)');
  38.         $this->addSql('CREATE INDEX IDX_7327530727DB8F6 ON as_demenagement_quotation (unloading_address_id)');
  39.         $this->addSql('ALTER TABLE as_demenagement_address DROP FOREIGN KEY FK_9987E465B4EA4E60');
  40.         $this->addSql('DROP INDEX IDX_9987E465B4EA4E60 ON as_demenagement_address');
  41.         $this->addSql('ALTER TABLE as_demenagement_address DROP quotation_id');
  42.     }
  43. }