<?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 Version20260207000000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Create product_point_controll table';
    }

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->addSql('CREATE TABLE product_point_controll (id SERIAL NOT NULL, product_id INT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
        $this->addSql('CREATE INDEX IDX_9E3C8F8F4584665A ON product_point_controll (product_id)');
        $this->addSql('ALTER TABLE product_point_controll ADD CONSTRAINT FK_9E3C8F8F4584665A FOREIGN KEY (product_id) REFERENCES product (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE product_point_controll DROP FOREIGN KEY FK_9E3C8F8F4584665A');
        $this->addSql('DROP TABLE product_point_controll');
    }
}
