migrations/Version20230313172524.php line 1
<?phpdeclare(strict_types=1);namespace DoctrineMigrations;use Doctrine\DBAL\Schema\Schema;use Doctrine\Migrations\AbstractMigration;/*** Auto-generated Migration: Please modify to your needs!*/final class Version20230313172524 extends AbstractMigration{public function getDescription(): string{return '';}public function up(Schema $schema): void{// this up() migration is auto-generated, please modify it to your needs$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610AB925704');$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610AB925704 FOREIGN KEY (relate_product_id) REFERENCES product (id) ON DELETE CASCADE');$this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04AD6AAA18EF');$this->addSql('ALTER TABLE product ADD CONSTRAINT FK_D34A04AD6AAA18EF FOREIGN KEY (relate_order_id) REFERENCES `order` (id) ON DELETE CASCADE');}public function down(Schema $schema): void{// this down() migration is auto-generated, please modify it to your needs$this->addSql('ALTER TABLE file DROP FOREIGN KEY FK_8C9F3610AB925704');$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610AB925704 FOREIGN KEY (relate_product_id) REFERENCES product (id)');$this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04AD6AAA18EF');$this->addSql('ALTER TABLE product ADD CONSTRAINT FK_D34A04AD6AAA18EF FOREIGN KEY (relate_order_id) REFERENCES `order` (id)');}}