<?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 Version20220627005153 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 combine (id INT AUTO_INCREMENT NOT NULL, action_id INT DEFAULT NULL, prop_id INT DEFAULT NULL, description LONGTEXT NOT NULL, INDEX IDX_AFBD9BAC9D32F035 (action_id), INDEX IDX_AFBD9BACDEB3FFBD (prop_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE combine_action (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, public TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE combine_product (id INT AUTO_INCREMENT NOT NULL, combine_id INT DEFAULT NULL, sort INT NOT NULL, INDEX IDX_E30C3D399146FD7B (combine_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE combine_prop (id INT AUTO_INCREMENT NOT NULL, title VARCHAR(255) NOT NULL, public TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE product_color (id INT AUTO_INCREMENT NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE combine ADD CONSTRAINT FK_AFBD9BAC9D32F035 FOREIGN KEY (action_id) REFERENCES combine_action (id)');
$this->addSql('ALTER TABLE combine ADD CONSTRAINT FK_AFBD9BACDEB3FFBD FOREIGN KEY (prop_id) REFERENCES combine_prop (id)');
$this->addSql('ALTER TABLE combine_product ADD CONSTRAINT FK_E30C3D399146FD7B FOREIGN KEY (combine_id) REFERENCES combine (id)');
$this->addSql('ALTER TABLE mark_color ADD CONSTRAINT FK_B6E3F9754290F12B FOREIGN KEY (mark_id) REFERENCES mark (id)');
$this->addSql('ALTER TABLE mark_color ADD CONSTRAINT FK_B6E3F9757ADA1FB5 FOREIGN KEY (color_id) REFERENCES color (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE combine_product DROP FOREIGN KEY FK_E30C3D399146FD7B');
$this->addSql('ALTER TABLE combine DROP FOREIGN KEY FK_AFBD9BAC9D32F035');
$this->addSql('ALTER TABLE combine DROP FOREIGN KEY FK_AFBD9BACDEB3FFBD');
$this->addSql('DROP TABLE combine');
$this->addSql('DROP TABLE combine_action');
$this->addSql('DROP TABLE combine_product');
$this->addSql('DROP TABLE combine_prop');
$this->addSql('DROP TABLE product_color');
$this->addSql('ALTER TABLE mark_color DROP FOREIGN KEY FK_B6E3F9754290F12B');
$this->addSql('ALTER TABLE mark_color DROP FOREIGN KEY FK_B6E3F9757ADA1FB5');
}
}