<?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 Version20240717035210 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 business_card_option CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL');
//$this->addSql('ALTER TABLE business_card_option RENAME INDEX idx_697d8aac574ceffb TO IDX_697D8AAC2F066F23');
$this->addSql('SET FOREIGN_KEY_CHECKS = 0');
$this->addSql('ALTER TABLE business_card_option DROP INDEX idx_697d8aac574ceffb');
$this->addSql('CREATE INDEX IDX_697D8AAC2F066F23 ON business_card_option (calculator_product_business_card_id)');
$this->addSql('ALTER TABLE calculator_product_business_card ADD calculator_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE calculator_product_business_card ADD CONSTRAINT FK_E05A6A7CACF2C4B8 FOREIGN KEY (calculator_id) REFERENCES calculator (id)');
$this->addSql('CREATE INDEX IDX_E05A6A7CACF2C4B8 ON calculator_product_business_card (calculator_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE business_card_option CHANGE created_at created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', CHANGE updated_at updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
$this->addSql('ALTER TABLE business_card_option RENAME INDEX idx_697d8aac2f066f23 TO IDX_697D8AAC574CEFFB');
$this->addSql('ALTER TABLE calculator_product_business_card DROP FOREIGN KEY FK_E05A6A7CACF2C4B8');
$this->addSql('DROP INDEX IDX_E05A6A7CACF2C4B8 ON calculator_product_business_card');
$this->addSql('ALTER TABLE calculator_product_business_card DROP calculator_id');
}
}