<?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 Version20240716030027 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 business_card_option (id INT AUTO_INCREMENT NOT NULL, calculator_product_business_card_id INT DEFAULT NULL, machine_id INT DEFAULT NULL, paper_size_id INT DEFAULT NULL, imposition_id INT DEFAULT NULL, finished_size_x INT NOT NULL, finished_size_y INT NOT NULL, side_one VARCHAR(255) NOT NULL, side_two VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_697D8AAC574CEFFB (calculator_product_business_card_id), INDEX IDX_697D8AACF6B75B26 (machine_id), INDEX IDX_697D8AAC4929FAC6 (paper_size_id), INDEX IDX_697D8AAC86EC6478 (imposition_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE business_card_option_task (business_card_option_id INT NOT NULL, task_id INT NOT NULL, INDEX IDX_D07EA41B59FB1C1D (business_card_option_id), INDEX IDX_D07EA41B8DB60186 (task_id), PRIMARY KEY(business_card_option_id, task_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE business_card_option ADD CONSTRAINT FK_697D8AAC574CEFFB FOREIGN KEY (calculator_product_business_card_id) REFERENCES calculator_product_business_card (id)');
$this->addSql('ALTER TABLE business_card_option ADD CONSTRAINT FK_697D8AACF6B75B26 FOREIGN KEY (machine_id) REFERENCES machine (id)');
$this->addSql('ALTER TABLE business_card_option ADD CONSTRAINT FK_697D8AAC4929FAC6 FOREIGN KEY (paper_size_id) REFERENCES paper_size (id)');
$this->addSql('ALTER TABLE business_card_option ADD CONSTRAINT FK_697D8AAC86EC6478 FOREIGN KEY (imposition_id) REFERENCES imposition (id)');
$this->addSql('ALTER TABLE business_card_option_task ADD CONSTRAINT FK_D07EA41B59FB1C1D FOREIGN KEY (business_card_option_id) REFERENCES business_card_option (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE business_card_option_task ADD CONSTRAINT FK_D07EA41B8DB60186 FOREIGN KEY (task_id) REFERENCES task (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE calculator_product_business_card CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL');
}
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 DROP FOREIGN KEY FK_697D8AAC574CEFFB');
$this->addSql('ALTER TABLE business_card_option DROP FOREIGN KEY FK_697D8AACF6B75B26');
$this->addSql('ALTER TABLE business_card_option DROP FOREIGN KEY FK_697D8AAC4929FAC6');
$this->addSql('ALTER TABLE business_card_option DROP FOREIGN KEY FK_697D8AAC86EC6478');
$this->addSql('ALTER TABLE business_card_option_task DROP FOREIGN KEY FK_D07EA41B59FB1C1D');
$this->addSql('ALTER TABLE business_card_option_task DROP FOREIGN KEY FK_D07EA41B8DB60186');
$this->addSql('DROP TABLE business_card_option');
$this->addSql('DROP TABLE business_card_option_task');
$this->addSql('ALTER TABLE calculator_product_business_card CHANGE created_at created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', CHANGE updated_at updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
}
}