<?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 Version20240101101428 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 products ADD answer1_id INT DEFAULT NULL, ADD answer2_id INT DEFAULT NULL, ADD answer3_id INT DEFAULT NULL, ADD answer4_id INT DEFAULT NULL, ADD answer5_id INT DEFAULT NULL, ADD answer6_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE products ADD CONSTRAINT FK_B3BA5A5A48A28B78 FOREIGN KEY (answer1_id) REFERENCES categories (id)');
$this->addSql('ALTER TABLE products ADD CONSTRAINT FK_B3BA5A5A5A172496 FOREIGN KEY (answer2_id) REFERENCES categories (id)');
$this->addSql('ALTER TABLE products ADD CONSTRAINT FK_B3BA5A5AE2AB43F3 FOREIGN KEY (answer3_id) REFERENCES categories (id)');
$this->addSql('ALTER TABLE products ADD CONSTRAINT FK_B3BA5A5A7F7C7B4A FOREIGN KEY (answer4_id) REFERENCES categories (id)');
$this->addSql('ALTER TABLE products ADD CONSTRAINT FK_B3BA5A5AC7C01C2F FOREIGN KEY (answer5_id) REFERENCES categories (id)');
$this->addSql('ALTER TABLE products ADD CONSTRAINT FK_B3BA5A5AD575B3C1 FOREIGN KEY (answer6_id) REFERENCES categories (id)');
$this->addSql('CREATE INDEX IDX_B3BA5A5A48A28B78 ON products (answer1_id)');
$this->addSql('CREATE INDEX IDX_B3BA5A5A5A172496 ON products (answer2_id)');
$this->addSql('CREATE INDEX IDX_B3BA5A5AE2AB43F3 ON products (answer3_id)');
$this->addSql('CREATE INDEX IDX_B3BA5A5A7F7C7B4A ON products (answer4_id)');
$this->addSql('CREATE INDEX IDX_B3BA5A5AC7C01C2F ON products (answer5_id)');
$this->addSql('CREATE INDEX IDX_B3BA5A5AD575B3C1 ON products (answer6_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE products DROP FOREIGN KEY FK_B3BA5A5A48A28B78');
$this->addSql('ALTER TABLE products DROP FOREIGN KEY FK_B3BA5A5A5A172496');
$this->addSql('ALTER TABLE products DROP FOREIGN KEY FK_B3BA5A5AE2AB43F3');
$this->addSql('ALTER TABLE products DROP FOREIGN KEY FK_B3BA5A5A7F7C7B4A');
$this->addSql('ALTER TABLE products DROP FOREIGN KEY FK_B3BA5A5AC7C01C2F');
$this->addSql('ALTER TABLE products DROP FOREIGN KEY FK_B3BA5A5AD575B3C1');
$this->addSql('DROP INDEX IDX_B3BA5A5A48A28B78 ON products');
$this->addSql('DROP INDEX IDX_B3BA5A5A5A172496 ON products');
$this->addSql('DROP INDEX IDX_B3BA5A5AE2AB43F3 ON products');
$this->addSql('DROP INDEX IDX_B3BA5A5A7F7C7B4A ON products');
$this->addSql('DROP INDEX IDX_B3BA5A5AC7C01C2F ON products');
$this->addSql('DROP INDEX IDX_B3BA5A5AD575B3C1 ON products');
$this->addSql('ALTER TABLE products DROP answer1_id, DROP answer2_id, DROP answer3_id, DROP answer4_id, DROP answer5_id, DROP answer6_id');
}
}