migrations/Version20220818135228.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace CoreMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20220818135228 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $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');
  19.         $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');
  20.         $this->addSql('ALTER TABLE products_bundle__search_association ADD CONSTRAINT FK_A4AC80614584665A FOREIGN KEY (product_id) REFERENCES products_bundle__product (id)');
  21.         $this->addSql('ALTER TABLE products_bundle__search_association ADD CONSTRAINT FK_A4AC80619941A932 FOREIGN KEY (declination_id) REFERENCES products_bundle__declination (id)');
  22.         $this->addSql('ALTER TABLE products_bundle__search_association ADD CONSTRAINT FK_A4AC80616E86AC17 FOREIGN KEY (search_word_id) REFERENCES products_bundle__search_word (id)');
  23.         $this->addSql('CREATE INDEX deleted_at ON context (deleted_at)');
  24.         $this->addSql('CREATE INDEX created_at ON context (created_at)');
  25.         $this->addSql('CREATE INDEX updated_at ON context (updated_at)');
  26.         $this->addSql('CREATE INDEX deleted_at ON country (deleted_at)');
  27.         $this->addSql('CREATE INDEX created_at ON country (created_at)');
  28.         $this->addSql('CREATE INDEX updated_at ON country (updated_at)');
  29.         $this->addSql('CREATE INDEX deleted_at ON country_state (deleted_at)');
  30.         $this->addSql('CREATE INDEX created_at ON country_state (created_at)');
  31.         $this->addSql('CREATE INDEX updated_at ON country_state (updated_at)');
  32.         $this->addSql('CREATE FULLTEXT INDEX content ON country_translations (content)');
  33.         $this->addSql('CREATE INDEX deleted_at ON country_zone (deleted_at)');
  34.         $this->addSql('CREATE INDEX created_at ON country_zone (created_at)');
  35.         $this->addSql('CREATE INDEX updated_at ON country_zone (updated_at)');
  36.         $this->addSql('CREATE FULLTEXT INDEX content ON country_zone_translations (content)');
  37.         $this->addSql('CREATE INDEX deleted_at ON currency (deleted_at)');
  38.         $this->addSql('CREATE INDEX created_at ON currency (created_at)');
  39.         $this->addSql('CREATE INDEX updated_at ON currency (updated_at)');
  40.         $this->addSql('CREATE INDEX deleted_at ON language (deleted_at)');
  41.         $this->addSql('CREATE INDEX created_at ON language (created_at)');
  42.         $this->addSql('CREATE INDEX updated_at ON language (updated_at)');
  43.         $this->addSql('CREATE INDEX deleted_at ON mail_server (deleted_at)');
  44.         $this->addSql('CREATE INDEX deleted_at ON profile (deleted_at)');
  45.         $this->addSql('DROP INDEX location_unique ON stocks_bundle__location');
  46.         $this->addSql('CREATE UNIQUE INDEX location_unique ON stocks_bundle__location (warehouse_id, x, y, z, deleted_at)');
  47.         $this->addSql('CREATE INDEX deleted_at ON tax (deleted_at)');
  48.         $this->addSql('CREATE INDEX created_at ON tax (created_at)');
  49.         $this->addSql('CREATE INDEX updated_at ON tax (updated_at)');
  50.         $this->addSql('CREATE INDEX deleted_at ON tax_rule (deleted_at)');
  51.         $this->addSql('CREATE INDEX created_at ON tax_rule (created_at)');
  52.         $this->addSql('CREATE INDEX updated_at ON tax_rule (updated_at)');
  53.         $this->addSql('CREATE INDEX deleted_at ON tax_rule_country (deleted_at)');
  54.         $this->addSql('CREATE INDEX created_at ON tax_rule_country (created_at)');
  55.         $this->addSql('CREATE INDEX updated_at ON tax_rule_country (updated_at)');
  56.         $this->addSql('CREATE INDEX deleted_at ON unit_measure (deleted_at)');
  57.         $this->addSql('CREATE INDEX created_at ON unit_measure (created_at)');
  58.         $this->addSql('CREATE INDEX updated_at ON unit_measure (updated_at)');
  59.         $this->addSql('DROP INDEX state ON user');
  60.         $this->addSql('CREATE INDEX is_active ON user (is_active)');
  61.         $this->addSql('CREATE INDEX deleted_at ON user (deleted_at)');
  62.         $this->addSql('CREATE INDEX created_at ON user (created_at)');
  63.         $this->addSql('CREATE INDEX updated_at ON user (updated_at)');
  64.         $this->addSql('CREATE INDEX is_active ON webservice_key (is_active)');
  65.         $this->addSql('CREATE INDEX deleted_at ON webservice_key (deleted_at)');
  66.         $this->addSql('CREATE INDEX created_at ON webservice_key (created_at)');
  67.         $this->addSql('CREATE INDEX updated_at ON webservice_key (updated_at)');
  68.         $this->addSql('CREATE INDEX deleted_at ON webservice_permission (deleted_at)');
  69.         $this->addSql('CREATE INDEX created_at ON webservice_permission (created_at)');
  70.         $this->addSql('CREATE INDEX updated_at ON webservice_permission (updated_at)');
  71.     }
  72.     public function down(Schema $schema): void
  73.     {
  74.         // this down() migration is auto-generated, please modify it to your needs
  75.         $this->addSql('ALTER TABLE products_bundle__search_association DROP FOREIGN KEY FK_A4AC80616E86AC17');
  76.         $this->addSql('DROP TABLE products_bundle__search_association');
  77.         $this->addSql('DROP TABLE products_bundle__search_word');
  78.         $this->addSql('DROP INDEX deleted_at ON context');
  79.         $this->addSql('DROP INDEX created_at ON context');
  80.         $this->addSql('DROP INDEX updated_at ON context');
  81.         $this->addSql('DROP INDEX deleted_at ON country');
  82.         $this->addSql('DROP INDEX created_at ON country');
  83.         $this->addSql('DROP INDEX updated_at ON country');
  84.         $this->addSql('DROP INDEX deleted_at ON country_state');
  85.         $this->addSql('DROP INDEX created_at ON country_state');
  86.         $this->addSql('DROP INDEX updated_at ON country_state');
  87.         $this->addSql('DROP INDEX content ON country_translations');
  88.         $this->addSql('DROP INDEX deleted_at ON country_zone');
  89.         $this->addSql('DROP INDEX created_at ON country_zone');
  90.         $this->addSql('DROP INDEX updated_at ON country_zone');
  91.         $this->addSql('DROP INDEX content ON country_zone_translations');
  92.         $this->addSql('DROP INDEX deleted_at ON currency');
  93.         $this->addSql('DROP INDEX created_at ON currency');
  94.         $this->addSql('DROP INDEX updated_at ON currency');
  95.         $this->addSql('DROP INDEX deleted_at ON language');
  96.         $this->addSql('DROP INDEX created_at ON language');
  97.         $this->addSql('DROP INDEX updated_at ON language');
  98.         $this->addSql('DROP INDEX deleted_at ON mail_server');
  99.         $this->addSql('DROP INDEX deleted_at ON profile');
  100.         $this->addSql('DROP INDEX location_unique ON stocks_bundle__location');
  101.         $this->addSql('CREATE UNIQUE INDEX location_unique ON stocks_bundle__location (warehouse_id, x, y, z)');
  102.         $this->addSql('DROP INDEX deleted_at ON tax');
  103.         $this->addSql('DROP INDEX created_at ON tax');
  104.         $this->addSql('DROP INDEX updated_at ON tax');
  105.         $this->addSql('DROP INDEX deleted_at ON tax_rule');
  106.         $this->addSql('DROP INDEX created_at ON tax_rule');
  107.         $this->addSql('DROP INDEX updated_at ON tax_rule');
  108.         $this->addSql('DROP INDEX deleted_at ON tax_rule_country');
  109.         $this->addSql('DROP INDEX created_at ON tax_rule_country');
  110.         $this->addSql('DROP INDEX updated_at ON tax_rule_country');
  111.         $this->addSql('DROP INDEX deleted_at ON unit_measure');
  112.         $this->addSql('DROP INDEX created_at ON unit_measure');
  113.         $this->addSql('DROP INDEX updated_at ON unit_measure');
  114.         $this->addSql('DROP INDEX is_active ON user');
  115.         $this->addSql('DROP INDEX deleted_at ON user');
  116.         $this->addSql('DROP INDEX created_at ON user');
  117.         $this->addSql('DROP INDEX updated_at ON user');
  118.         $this->addSql('CREATE INDEX state ON user (is_active, deleted_at)');
  119.         $this->addSql('DROP INDEX is_active ON webservice_key');
  120.         $this->addSql('DROP INDEX deleted_at ON webservice_key');
  121.         $this->addSql('DROP INDEX created_at ON webservice_key');
  122.         $this->addSql('DROP INDEX updated_at ON webservice_key');
  123.         $this->addSql('DROP INDEX deleted_at ON webservice_permission');
  124.         $this->addSql('DROP INDEX created_at ON webservice_permission');
  125.         $this->addSql('DROP INDEX updated_at ON webservice_permission');
  126.     }
  127. }