migrations/Version20250207160648.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 Version20250207160648 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 charterer DROP FOREIGN KEY FK_1A9C8BA8D905C92C');
  19.         $this->addSql('DROP INDEX UNIQ_1A9C8BA8D905C92C ON charterer');
  20.         $this->addSql('ALTER TABLE charterer DROP primary_contact_id');
  21.         $this->addSql('ALTER TABLE contact DROP FOREIGN KEY FK_4C62E63890E4571D');
  22.         $this->addSql('DROP INDEX IDX_4C62E63890E4571D ON contact');
  23.         $this->addSql('ALTER TABLE contact DROP charterer_id');
  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 charterer ADD primary_contact_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
  29.         $this->addSql('ALTER TABLE charterer ADD CONSTRAINT FK_1A9C8BA8D905C92C FOREIGN KEY (primary_contact_id) REFERENCES contact (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
  30.         $this->addSql('CREATE UNIQUE INDEX UNIQ_1A9C8BA8D905C92C ON charterer (primary_contact_id)');
  31.         $this->addSql('ALTER TABLE contact ADD charterer_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
  32.         $this->addSql('ALTER TABLE contact ADD CONSTRAINT FK_4C62E63890E4571D FOREIGN KEY (charterer_id) REFERENCES charterer (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
  33.         $this->addSql('CREATE INDEX IDX_4C62E63890E4571D ON contact (charterer_id)');
  34.     }
  35. }