<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250823134011 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 promo_code ADD product_label_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE promo_code ADD CONSTRAINT FK_3D8C939EF80945AE FOREIGN KEY (product_label_id) REFERENCES product_label (id)');
$this->addSql('CREATE INDEX IDX_3D8C939EF80945AE ON promo_code (product_label_id)');
$this->addSql('ALTER TABLE promotion ADD product_label_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE promotion ADD CONSTRAINT FK_C11D7DD1F80945AE FOREIGN KEY (product_label_id) REFERENCES product_label (id)');
$this->addSql('CREATE INDEX IDX_C11D7DD1F80945AE ON promotion (product_label_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE promotion DROP FOREIGN KEY FK_C11D7DD1F80945AE');
$this->addSql('DROP INDEX IDX_C11D7DD1F80945AE ON promotion');
$this->addSql('ALTER TABLE promotion DROP product_label_id');
$this->addSql('ALTER TABLE promo_code DROP FOREIGN KEY FK_3D8C939EF80945AE');
$this->addSql('DROP INDEX IDX_3D8C939EF80945AE ON promo_code');
$this->addSql('ALTER TABLE promo_code DROP product_label_id');
}
}