addSql('ALTER TABLE group_of_products DROP FOREIGN KEY FK_2A99B370A76ED395'); $this->addSql('DROP INDEX IDX_2A99B370A76ED395 ON group_of_products'); $this->addSql('ALTER TABLE group_of_products CHANGE user_id owner_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE group_of_products ADD CONSTRAINT FK_2A99B3707E3C61F9 FOREIGN KEY (owner_id) REFERENCES user (id)'); $this->addSql('CREATE INDEX IDX_2A99B3707E3C61F9 ON group_of_products (owner_id)'); $this->addSql('ALTER TABLE selling DROP date'); } public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE selling ADD date VARCHAR(255) NOT NULL'); $this->addSql('ALTER TABLE group_of_products DROP FOREIGN KEY FK_2A99B3707E3C61F9'); $this->addSql('DROP INDEX IDX_2A99B3707E3C61F9 ON group_of_products'); $this->addSql('ALTER TABLE group_of_products CHANGE owner_id user_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE group_of_products ADD CONSTRAINT FK_2A99B370A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)'); $this->addSql('CREATE INDEX IDX_2A99B370A76ED395 ON group_of_products (user_id)'); } }