<?php
declare(strict_types=1);
namespace CoreMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220609141709 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 categories_bundle__category_context (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', category_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', context_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', INDEX IDX_7E2E3ED712469DE2 (category_id), INDEX IDX_7E2E3ED76B00C1CF (context_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE products_bundle__attribute_context (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', attribute_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', context_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', INDEX IDX_2BEB560CB6E62EFA (attribute_id), INDEX IDX_2BEB560C6B00C1CF (context_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE products_bundle__attribute_group_context (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', attribute_group_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', context_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', INDEX IDX_4A85C4B862D643B7 (attribute_group_id), INDEX IDX_4A85C4B86B00C1CF (context_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE products_bundle__declination_context (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', declination_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', context_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', INDEX IDX_B1F3A3809941A932 (declination_id), INDEX IDX_B1F3A3806B00C1CF (context_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE sales_bundle__bank (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(255) NOT NULL, account_number VARCHAR(32) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, is_active TINYINT(1) NOT NULL, INDEX IDX_82507772B03A8386 (created_by_id), INDEX IDX_82507772896DBBDE (updated_by_id), INDEX IDX_82507772C76F1F52 (deleted_by_id), INDEX name (name), INDEX account_number (account_number), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE stocks_bundle__date_type_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_1B0A15EE232D562B (object_id), 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 categories_bundle__category_context ADD CONSTRAINT FK_7E2E3ED712469DE2 FOREIGN KEY (category_id) REFERENCES categories_bundle__category (id)');
$this->addSql('ALTER TABLE categories_bundle__category_context ADD CONSTRAINT FK_7E2E3ED76B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE products_bundle__attribute_context ADD CONSTRAINT FK_2BEB560CB6E62EFA FOREIGN KEY (attribute_id) REFERENCES products_bundle__attribute (id)');
$this->addSql('ALTER TABLE products_bundle__attribute_context ADD CONSTRAINT FK_2BEB560C6B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE products_bundle__attribute_group_context ADD CONSTRAINT FK_4A85C4B862D643B7 FOREIGN KEY (attribute_group_id) REFERENCES products_bundle__attribute_group (id)');
$this->addSql('ALTER TABLE products_bundle__attribute_group_context ADD CONSTRAINT FK_4A85C4B86B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE products_bundle__declination_context ADD CONSTRAINT FK_B1F3A3809941A932 FOREIGN KEY (declination_id) REFERENCES products_bundle__declination (id)');
$this->addSql('ALTER TABLE products_bundle__declination_context ADD CONSTRAINT FK_B1F3A3806B00C1CF FOREIGN KEY (context_id) REFERENCES context (id)');
$this->addSql('ALTER TABLE sales_bundle__bank ADD CONSTRAINT FK_82507772B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE sales_bundle__bank ADD CONSTRAINT FK_82507772896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE sales_bundle__bank ADD CONSTRAINT FK_82507772C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE stocks_bundle__date_type_translations ADD CONSTRAINT FK_1B0A15EE232D562B FOREIGN KEY (object_id) REFERENCES stocks_bundle__date_type (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE sales_bundle__payment ADD bank_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE sales_bundle__payment ADD CONSTRAINT FK_46C1B80511C8FB41 FOREIGN KEY (bank_id) REFERENCES sales_bundle__bank (id)');
$this->addSql('CREATE INDEX IDX_46C1B80511C8FB41 ON sales_bundle__payment (bank_id)');
$this->addSql('ALTER TABLE stocks_bundle__date_type ADD long_name VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sales_bundle__payment DROP FOREIGN KEY FK_46C1B80511C8FB41');
$this->addSql('DROP TABLE categories_bundle__category_context');
$this->addSql('DROP TABLE products_bundle__attribute_context');
$this->addSql('DROP TABLE products_bundle__attribute_group_context');
$this->addSql('DROP TABLE products_bundle__declination_context');
$this->addSql('DROP TABLE sales_bundle__bank');
$this->addSql('DROP TABLE stocks_bundle__date_type_translations');
$this->addSql('DROP INDEX IDX_46C1B80511C8FB41 ON sales_bundle__payment');
$this->addSql('ALTER TABLE sales_bundle__payment DROP bank_id');
$this->addSql('ALTER TABLE stocks_bundle__date_type DROP long_name');
}
}