<?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 Version20260204075839 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('CREATE TABLE product_options (product_id INT NOT NULL, options_id INT NOT NULL, PRIMARY KEY (product_id, options_id))');
        $this->addSql('CREATE INDEX IDX_1ECE1374584665A ON product_options (product_id)');
        $this->addSql('CREATE INDEX IDX_1ECE1373ADB05F1 ON product_options (options_id)');
        $this->addSql('ALTER TABLE product_options ADD CONSTRAINT FK_1ECE1374584665A FOREIGN KEY (product_id) REFERENCES product (id) ON DELETE CASCADE');
        $this->addSql('ALTER TABLE product_options ADD CONSTRAINT FK_1ECE1373ADB05F1 FOREIGN KEY (options_id) REFERENCES options (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 product_options DROP CONSTRAINT FK_1ECE1374584665A');
        $this->addSql('ALTER TABLE product_options DROP CONSTRAINT FK_1ECE1373ADB05F1');
        $this->addSql('DROP TABLE product_options');
    }
}
