migrations/Version20231124182407.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  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 Version20231124182407 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 custom_entity (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, category_id INT NOT NULL, object_type_id INT DEFAULT NULL, slug VARCHAR(255) NOT NULL, type VARCHAR(20) NOT NULL, status VARCHAR(20) NOT NULL, public TINYINT(1) NOT NULL, settings LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', external_id1 VARCHAR(100) DEFAULT NULL, external_id2 VARCHAR(100) DEFAULT NULL, parameter1 VARCHAR(255) DEFAULT NULL, parameter2 VARCHAR(255) DEFAULT NULL, parameter3 VARCHAR(255) DEFAULT NULL, variant VARCHAR(255) DEFAULT NULL, override_languages TINYINT(1) DEFAULT NULL, identifier VARCHAR(255) DEFAULT NULL, INDEX IDX_3A85906C9395C3F3 (customer_id), INDEX IDX_3A85906C12469DE2 (category_id), INDEX IDX_3A85906CC5020C33 (object_type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE custom_entity ADD CONSTRAINT FK_3A85906C9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
  20.         $this->addSql('ALTER TABLE custom_entity ADD CONSTRAINT FK_3A85906C12469DE2 FOREIGN KEY (category_id) REFERENCES category (id)');
  21.         $this->addSql('ALTER TABLE custom_entity ADD CONSTRAINT FK_3A85906CC5020C33 FOREIGN KEY (object_type_id) REFERENCES object_type (id)');
  22. //        $this->addSql('DROP TABLE al_wp_posts_old');
  23. //        $this->addSql('DROP INDEX post_content ON al_wp_posts');
  24. //        $this->addSql('DROP INDEX type_status_date ON al_wp_posts');
  25. //        $this->addSql('DROP INDEX post_parent ON al_wp_posts');
  26. //        $this->addSql('DROP INDEX post_title ON al_wp_posts');
  27. //        $this->addSql('ALTER TABLE al_wp_posts CHANGE ID id INT AUTO_INCREMENT NOT NULL, CHANGE post_date post_date DATETIME NOT NULL, CHANGE post_status post_status LONGTEXT NOT NULL, CHANGE post_parent post_parent INT NOT NULL, CHANGE menu_order menu_order INT NOT NULL, CHANGE post_type post_type LONGTEXT NOT NULL');
  28. //        $this->addSql('ALTER TABLE app_translations RENAME INDEX idx_ed8c63d37987212d TO IDX_439C0067987212D');
  29. //        $this->addSql('ALTER TABLE app_translations RENAME INDEX idx_ed8c63d312469de2 TO IDX_439C00612469DE2');
  30. //        $this->addSql('ALTER TABLE app_translations_translation RENAME INDEX idx_3f806f872c2ac5d3 TO IDX_6D4A86FF2C2AC5D3');
  31. //        $this->addSql('ALTER TABLE app_translations_translation RENAME INDEX app_translation_translation_unique_translation TO app_translations_translation_unique_translation');
  32. //        $this->addSql('DROP INDEX titles_only ON country_translation');
  33. //        $this->addSql('ALTER TABLE customer RENAME INDEX fk_81398e09f92f3e70 TO IDX_81398E09F92F3E70');
  34. //        $this->addSql('ALTER TABLE disease CHANGE type type VARCHAR(30) NOT NULL');
  35. //        $this->addSql('DROP INDEX name ON disease_translation');
  36. //        $this->addSql('DROP INDEX titles_only ON disease_translation');
  37. //        $this->addSql('ALTER TABLE drug CHANGE type type VARCHAR(30) NOT NULL');
  38. //        $this->addSql('DROP INDEX name ON drug_translation');
  39. //        $this->addSql('DROP INDEX titles_only ON drug_translation');
  40. //        $this->addSql('ALTER TABLE import CHANGE type type VARCHAR(255) NOT NULL');
  41. //        $this->addSql('ALTER TABLE level CHANGE svg_optimized_file svg_optimized_file VARCHAR(255) NOT NULL');
  42. //        $this->addSql('DROP INDEX titles_only ON map_marker_translation');
  43. //        $this->addSql('DROP INDEX name ON map_marker_translation');
  44. //        $this->addSql('ALTER TABLE medical_procedure CHANGE type type VARCHAR(30) NOT NULL');
  45. //        $this->addSql('DROP INDEX name ON medical_procedure_translation');
  46. //        $this->addSql('DROP INDEX titles_only ON medical_procedure_translation');
  47. //        $this->addSql('DROP INDEX name ON page_translation');
  48. //        $this->addSql('DROP INDEX titles_only ON page_translation');
  49. //        $this->addSql('ALTER TABLE test_definition CHANGE type type VARCHAR(30) NOT NULL');
  50.     }
  51.     public function down(Schema $schema): void
  52.     {
  53.         // this down() migration is auto-generated, please modify it to your needs
  54.         $this->addSql('CREATE TABLE al_wp_posts_old (id INT AUTO_INCREMENT NOT NULL, post_date DATETIME NOT NULL, post_content LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, post_title TEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, post_excerpt TEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, post_status LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, post_parent INT NOT NULL, menu_order INT NOT NULL, post_type LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  55.         $this->addSql('DROP TABLE custom_entity');
  56.         $this->addSql('ALTER TABLE al_wp_posts CHANGE id ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, CHANGE post_date post_date DATETIME DEFAULT \'0000-00-00 00:00:00\' NOT NULL, CHANGE post_status post_status VARCHAR(20) CHARACTER SET utf8 DEFAULT \'publish\' NOT NULL COLLATE `utf8_general_ci`, CHANGE post_parent post_parent BIGINT UNSIGNED DEFAULT 0 NOT NULL, CHANGE menu_order menu_order INT DEFAULT 0 NOT NULL, CHANGE post_type post_type VARCHAR(20) CHARACTER SET utf8 DEFAULT \'post\' NOT NULL COLLATE `utf8_general_ci`');
  57.         $this->addSql('CREATE FULLTEXT INDEX post_content ON al_wp_posts (post_content)');
  58.         $this->addSql('CREATE INDEX type_status_date ON al_wp_posts (post_type, post_status, post_date, ID)');
  59.         $this->addSql('CREATE INDEX post_parent ON al_wp_posts (post_parent)');
  60.         $this->addSql('CREATE FULLTEXT INDEX post_title ON al_wp_posts (post_title)');
  61.         $this->addSql('ALTER TABLE app_translations RENAME INDEX idx_439c00612469de2 TO IDX_ED8C63D312469DE2');
  62.         $this->addSql('ALTER TABLE app_translations RENAME INDEX idx_439c0067987212d TO IDX_ED8C63D37987212D');
  63.         $this->addSql('ALTER TABLE app_translations_translation RENAME INDEX app_translations_translation_unique_translation TO app_translation_translation_unique_translation');
  64.         $this->addSql('ALTER TABLE app_translations_translation RENAME INDEX idx_6d4a86ff2c2ac5d3 TO IDX_3F806F872C2AC5D3');
  65.         $this->addSql('CREATE FULLTEXT INDEX titles_only ON country_translation (name)');
  66.         $this->addSql('ALTER TABLE customer RENAME INDEX idx_81398e09f92f3e70 TO FK_81398E09F92F3E70');
  67.         $this->addSql('ALTER TABLE disease CHANGE type type VARCHAR(30) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
  68.         $this->addSql('CREATE FULLTEXT INDEX name ON disease_translation (name, description)');
  69.         $this->addSql('CREATE FULLTEXT INDEX titles_only ON disease_translation (name)');
  70.         $this->addSql('ALTER TABLE drug CHANGE type type VARCHAR(30) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
  71.         $this->addSql('CREATE FULLTEXT INDEX name ON drug_translation (name, description)');
  72.         $this->addSql('CREATE FULLTEXT INDEX titles_only ON drug_translation (name)');
  73.         $this->addSql('ALTER TABLE import CHANGE type type VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
  74.         $this->addSql('ALTER TABLE level CHANGE svg_optimized_file svg_optimized_file VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
  75.         $this->addSql('CREATE FULLTEXT INDEX titles_only ON map_marker_translation (name)');
  76.         $this->addSql('CREATE FULLTEXT INDEX name ON map_marker_translation (name, description)');
  77.         $this->addSql('ALTER TABLE medical_procedure CHANGE type type VARCHAR(30) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
  78.         $this->addSql('CREATE FULLTEXT INDEX name ON medical_procedure_translation (name, description)');
  79.         $this->addSql('CREATE FULLTEXT INDEX titles_only ON medical_procedure_translation (name)');
  80.         $this->addSql('CREATE FULLTEXT INDEX name ON page_translation (name, excerpt, body)');
  81.         $this->addSql('CREATE FULLTEXT INDEX titles_only ON page_translation (name)');
  82.         $this->addSql('ALTER TABLE test_definition CHANGE type type VARCHAR(30) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
  83.     }
  84. }