addSql('ALTER TABLE individual_data ADD territory_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE individual_data ADD CONSTRAINT FK_653169D073F74AD4 FOREIGN KEY (territory_id) REFERENCES territory (id)'); $this->addSql('CREATE INDEX IDX_653169D073F74AD4 ON individual_data (territory_id)'); $this->addSql('ALTER TABLE territory DROP FOREIGN KEY FK_E9743966E2920B1'); $this->addSql('DROP INDEX IDX_E9743966E2920B1 ON territory'); $this->addSql('ALTER TABLE territory DROP individual_data_id'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE individual_data DROP FOREIGN KEY FK_653169D073F74AD4'); $this->addSql('DROP INDEX IDX_653169D073F74AD4 ON individual_data'); $this->addSql('ALTER TABLE individual_data DROP territory_id'); $this->addSql('ALTER TABLE territory ADD individual_data_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE territory ADD CONSTRAINT FK_E9743966E2920B1 FOREIGN KEY (individual_data_id) REFERENCES individual_data (id)'); $this->addSql('CREATE INDEX IDX_E9743966E2920B1 ON territory (individual_data_id)'); } }