<?php
declare(strict_types=1);
namespace ProductsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230117081933 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE products_bundle__feature (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(128) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_A5C7C81B03A8386 (created_by_id), INDEX IDX_A5C7C81896DBBDE (updated_by_id), INDEX IDX_A5C7C81C76F1F52 (deleted_by_id), INDEX name (name), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE products_bundle__feature_context (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', feature_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', context_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', INDEX IDX_13B08B3560E4B879 (feature_id), INDEX IDX_13B08B356B00C1CF (context_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE products_bundle__feature_translations (id INT AUTO_INCREMENT NOT NULL, object_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', locale VARCHAR(8) NOT NULL, field VARCHAR(32) NOT NULL, content LONGTEXT DEFAULT NULL, INDEX IDX_A5D657E3232D562B (object_id), FULLTEXT INDEX content (content), UNIQUE INDEX lookup_unique_idx (locale, object_id, field), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE products_bundle__feature_value (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', feature_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', name VARCHAR(128) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_F2CD4BD760E4B879 (feature_id), INDEX IDX_F2CD4BD7B03A8386 (created_by_id), INDEX IDX_F2CD4BD7896DBBDE (updated_by_id), INDEX IDX_F2CD4BD7C76F1F52 (deleted_by_id), INDEX name (name), INDEX deleted_at (deleted_at), INDEX created_at (created_at), INDEX updated_at (updated_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE products_bundle__feature_value_context (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', feature_value_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', context_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', INDEX IDX_434334D280CD149D (feature_value_id), INDEX IDX_434334D26B00C1CF (context_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE products_bundle__feature_value_translations (id INT AUTO_INCREMENT NOT NULL, object_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', locale VARCHAR(8) NOT NULL, field VARCHAR(32) NOT NULL, content LONGTEXT DEFAULT NULL, INDEX IDX_770A823D232D562B (object_id), FULLTEXT INDEX content (content), UNIQUE INDEX lookup_unique_idx (locale, object_id, field), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE products_bundle__feature ADD CONSTRAINT FK_A5C7C81B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE products_bundle__feature ADD CONSTRAINT FK_A5C7C81896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE products_bundle__feature ADD CONSTRAINT FK_A5C7C81C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE products_bundle__feature_context ADD CONSTRAINT FK_13B08B3560E4B879 FOREIGN KEY (feature_id) REFERENCES products_bundle__feature (id)');
$this->addSql('ALTER TABLE products_bundle__feature_context ADD CONSTRAINT FK_13B08B356B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE products_bundle__feature_translations ADD CONSTRAINT FK_A5D657E3232D562B FOREIGN KEY (object_id) REFERENCES products_bundle__feature (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE products_bundle__feature_value ADD CONSTRAINT FK_F2CD4BD760E4B879 FOREIGN KEY (feature_id) REFERENCES products_bundle__feature (id)');
$this->addSql('ALTER TABLE products_bundle__feature_value ADD CONSTRAINT FK_F2CD4BD7B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE products_bundle__feature_value ADD CONSTRAINT FK_F2CD4BD7896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE products_bundle__feature_value ADD CONSTRAINT FK_F2CD4BD7C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE products_bundle__feature_value_context ADD CONSTRAINT FK_434334D280CD149D FOREIGN KEY (feature_value_id) REFERENCES products_bundle__feature_value (id)');
$this->addSql('ALTER TABLE products_bundle__feature_value_context ADD CONSTRAINT FK_434334D26B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE products_bundle__feature_value_translations ADD CONSTRAINT FK_770A823D232D562B FOREIGN KEY (object_id) REFERENCES products_bundle__feature_value (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE products_bundle__feature DROP FOREIGN KEY FK_A5C7C81B03A8386');
$this->addSql('ALTER TABLE products_bundle__feature DROP FOREIGN KEY FK_A5C7C81896DBBDE');
$this->addSql('ALTER TABLE products_bundle__feature DROP FOREIGN KEY FK_A5C7C81C76F1F52');
$this->addSql('ALTER TABLE products_bundle__feature_context DROP FOREIGN KEY FK_13B08B3560E4B879');
$this->addSql('ALTER TABLE products_bundle__feature_context DROP FOREIGN KEY FK_13B08B356B00C1CF');
$this->addSql('ALTER TABLE products_bundle__feature_translations DROP FOREIGN KEY FK_A5D657E3232D562B');
$this->addSql('ALTER TABLE products_bundle__feature_value DROP FOREIGN KEY FK_F2CD4BD760E4B879');
$this->addSql('ALTER TABLE products_bundle__feature_value DROP FOREIGN KEY FK_F2CD4BD7B03A8386');
$this->addSql('ALTER TABLE products_bundle__feature_value DROP FOREIGN KEY FK_F2CD4BD7896DBBDE');
$this->addSql('ALTER TABLE products_bundle__feature_value DROP FOREIGN KEY FK_F2CD4BD7C76F1F52');
$this->addSql('ALTER TABLE products_bundle__feature_value_context DROP FOREIGN KEY FK_434334D280CD149D');
$this->addSql('ALTER TABLE products_bundle__feature_value_context DROP FOREIGN KEY FK_434334D26B00C1CF');
$this->addSql('ALTER TABLE products_bundle__feature_value_translations DROP FOREIGN KEY FK_770A823D232D562B');
$this->addSql('DROP TABLE products_bundle__feature');
$this->addSql('DROP TABLE products_bundle__feature_context');
$this->addSql('DROP TABLE products_bundle__feature_translations');
$this->addSql('DROP TABLE products_bundle__feature_value');
$this->addSql('DROP TABLE products_bundle__feature_value_context');
$this->addSql('DROP TABLE products_bundle__feature_value_translations');
}
}