<?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 Version20220818135228 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 products_bundle__search_association (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', product_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', declination_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', search_word_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', INDEX IDX_A4AC80614584665A (product_id), INDEX IDX_A4AC80619941A932 (declination_id), INDEX IDX_A4AC80616E86AC17 (search_word_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE products_bundle__search_word (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', word VARCHAR(32) NOT NULL, INDEX word (word), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE products_bundle__search_association ADD CONSTRAINT FK_A4AC80614584665A FOREIGN KEY (product_id) REFERENCES products_bundle__product (id)');
$this->addSql('ALTER TABLE products_bundle__search_association ADD CONSTRAINT FK_A4AC80619941A932 FOREIGN KEY (declination_id) REFERENCES products_bundle__declination (id)');
$this->addSql('ALTER TABLE products_bundle__search_association ADD CONSTRAINT FK_A4AC80616E86AC17 FOREIGN KEY (search_word_id) REFERENCES products_bundle__search_word (id)');
$this->addSql('CREATE INDEX deleted_at ON context (deleted_at)');
$this->addSql('CREATE INDEX created_at ON context (created_at)');
$this->addSql('CREATE INDEX updated_at ON context (updated_at)');
$this->addSql('CREATE INDEX deleted_at ON country (deleted_at)');
$this->addSql('CREATE INDEX created_at ON country (created_at)');
$this->addSql('CREATE INDEX updated_at ON country (updated_at)');
$this->addSql('CREATE INDEX deleted_at ON country_state (deleted_at)');
$this->addSql('CREATE INDEX created_at ON country_state (created_at)');
$this->addSql('CREATE INDEX updated_at ON country_state (updated_at)');
$this->addSql('CREATE FULLTEXT INDEX content ON country_translations (content)');
$this->addSql('CREATE INDEX deleted_at ON country_zone (deleted_at)');
$this->addSql('CREATE INDEX created_at ON country_zone (created_at)');
$this->addSql('CREATE INDEX updated_at ON country_zone (updated_at)');
$this->addSql('CREATE FULLTEXT INDEX content ON country_zone_translations (content)');
$this->addSql('CREATE INDEX deleted_at ON currency (deleted_at)');
$this->addSql('CREATE INDEX created_at ON currency (created_at)');
$this->addSql('CREATE INDEX updated_at ON currency (updated_at)');
$this->addSql('CREATE INDEX deleted_at ON language (deleted_at)');
$this->addSql('CREATE INDEX created_at ON language (created_at)');
$this->addSql('CREATE INDEX updated_at ON language (updated_at)');
$this->addSql('CREATE INDEX deleted_at ON mail_server (deleted_at)');
$this->addSql('CREATE INDEX deleted_at ON profile (deleted_at)');
$this->addSql('DROP INDEX location_unique ON stocks_bundle__location');
$this->addSql('CREATE UNIQUE INDEX location_unique ON stocks_bundle__location (warehouse_id, x, y, z, deleted_at)');
$this->addSql('CREATE INDEX deleted_at ON tax (deleted_at)');
$this->addSql('CREATE INDEX created_at ON tax (created_at)');
$this->addSql('CREATE INDEX updated_at ON tax (updated_at)');
$this->addSql('CREATE INDEX deleted_at ON tax_rule (deleted_at)');
$this->addSql('CREATE INDEX created_at ON tax_rule (created_at)');
$this->addSql('CREATE INDEX updated_at ON tax_rule (updated_at)');
$this->addSql('CREATE INDEX deleted_at ON tax_rule_country (deleted_at)');
$this->addSql('CREATE INDEX created_at ON tax_rule_country (created_at)');
$this->addSql('CREATE INDEX updated_at ON tax_rule_country (updated_at)');
$this->addSql('CREATE INDEX deleted_at ON unit_measure (deleted_at)');
$this->addSql('CREATE INDEX created_at ON unit_measure (created_at)');
$this->addSql('CREATE INDEX updated_at ON unit_measure (updated_at)');
$this->addSql('DROP INDEX state ON user');
$this->addSql('CREATE INDEX is_active ON user (is_active)');
$this->addSql('CREATE INDEX deleted_at ON user (deleted_at)');
$this->addSql('CREATE INDEX created_at ON user (created_at)');
$this->addSql('CREATE INDEX updated_at ON user (updated_at)');
$this->addSql('CREATE INDEX is_active ON webservice_key (is_active)');
$this->addSql('CREATE INDEX deleted_at ON webservice_key (deleted_at)');
$this->addSql('CREATE INDEX created_at ON webservice_key (created_at)');
$this->addSql('CREATE INDEX updated_at ON webservice_key (updated_at)');
$this->addSql('CREATE INDEX deleted_at ON webservice_permission (deleted_at)');
$this->addSql('CREATE INDEX created_at ON webservice_permission (created_at)');
$this->addSql('CREATE INDEX updated_at ON webservice_permission (updated_at)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE products_bundle__search_association DROP FOREIGN KEY FK_A4AC80616E86AC17');
$this->addSql('DROP TABLE products_bundle__search_association');
$this->addSql('DROP TABLE products_bundle__search_word');
$this->addSql('DROP INDEX deleted_at ON context');
$this->addSql('DROP INDEX created_at ON context');
$this->addSql('DROP INDEX updated_at ON context');
$this->addSql('DROP INDEX deleted_at ON country');
$this->addSql('DROP INDEX created_at ON country');
$this->addSql('DROP INDEX updated_at ON country');
$this->addSql('DROP INDEX deleted_at ON country_state');
$this->addSql('DROP INDEX created_at ON country_state');
$this->addSql('DROP INDEX updated_at ON country_state');
$this->addSql('DROP INDEX content ON country_translations');
$this->addSql('DROP INDEX deleted_at ON country_zone');
$this->addSql('DROP INDEX created_at ON country_zone');
$this->addSql('DROP INDEX updated_at ON country_zone');
$this->addSql('DROP INDEX content ON country_zone_translations');
$this->addSql('DROP INDEX deleted_at ON currency');
$this->addSql('DROP INDEX created_at ON currency');
$this->addSql('DROP INDEX updated_at ON currency');
$this->addSql('DROP INDEX deleted_at ON language');
$this->addSql('DROP INDEX created_at ON language');
$this->addSql('DROP INDEX updated_at ON language');
$this->addSql('DROP INDEX deleted_at ON mail_server');
$this->addSql('DROP INDEX deleted_at ON profile');
$this->addSql('DROP INDEX location_unique ON stocks_bundle__location');
$this->addSql('CREATE UNIQUE INDEX location_unique ON stocks_bundle__location (warehouse_id, x, y, z)');
$this->addSql('DROP INDEX deleted_at ON tax');
$this->addSql('DROP INDEX created_at ON tax');
$this->addSql('DROP INDEX updated_at ON tax');
$this->addSql('DROP INDEX deleted_at ON tax_rule');
$this->addSql('DROP INDEX created_at ON tax_rule');
$this->addSql('DROP INDEX updated_at ON tax_rule');
$this->addSql('DROP INDEX deleted_at ON tax_rule_country');
$this->addSql('DROP INDEX created_at ON tax_rule_country');
$this->addSql('DROP INDEX updated_at ON tax_rule_country');
$this->addSql('DROP INDEX deleted_at ON unit_measure');
$this->addSql('DROP INDEX created_at ON unit_measure');
$this->addSql('DROP INDEX updated_at ON unit_measure');
$this->addSql('DROP INDEX is_active ON user');
$this->addSql('DROP INDEX deleted_at ON user');
$this->addSql('DROP INDEX created_at ON user');
$this->addSql('DROP INDEX updated_at ON user');
$this->addSql('CREATE INDEX state ON user (is_active, deleted_at)');
$this->addSql('DROP INDEX is_active ON webservice_key');
$this->addSql('DROP INDEX deleted_at ON webservice_key');
$this->addSql('DROP INDEX created_at ON webservice_key');
$this->addSql('DROP INDEX updated_at ON webservice_key');
$this->addSql('DROP INDEX deleted_at ON webservice_permission');
$this->addSql('DROP INDEX created_at ON webservice_permission');
$this->addSql('DROP INDEX updated_at ON webservice_permission');
}
}