migrations/Version20240206163437.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 Version20240206163437 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 layout_setting (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, user_id INT DEFAULT NULL, entity VARCHAR(255) NOT NULL, settings LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', INDEX IDX_ED08E70A9395C3F3 (customer_id), INDEX IDX_ED08E70AA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE layout_setting ADD CONSTRAINT FK_ED08E70A9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
  20.         $this->addSql('ALTER TABLE layout_setting ADD CONSTRAINT FK_ED08E70AA76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
  21. //        $this->addSql('ALTER TABLE app_translations RENAME INDEX idx_ed8c63d37987212d TO IDX_439C0067987212D');
  22. //        $this->addSql('ALTER TABLE app_translations RENAME INDEX idx_ed8c63d312469de2 TO IDX_439C00612469DE2');
  23. //        $this->addSql('ALTER TABLE app_translations_translation RENAME INDEX idx_3f806f872c2ac5d3 TO IDX_6D4A86FF2C2AC5D3');
  24. //        $this->addSql('ALTER TABLE app_translations_translation RENAME INDEX app_translation_translation_unique_translation TO app_translations_translation_unique_translation');
  25. //        $this->addSql('DROP INDEX titles_only ON country_translation');
  26. //        $this->addSql('ALTER TABLE customer RENAME INDEX fk_81398e09f92f3e70 TO IDX_81398E09F92F3E70');
  27. //        $this->addSql('DROP INDEX name ON disease_translation');
  28. //        $this->addSql('DROP INDEX titles_only ON disease_translation');
  29. //        $this->addSql('DROP INDEX name ON drug_translation');
  30. //        $this->addSql('DROP INDEX titles_only ON drug_translation');
  31. //        $this->addSql('DROP INDEX titles_only ON map_marker_translation');
  32. //        $this->addSql('DROP INDEX name ON map_marker_translation');
  33. //        $this->addSql('DROP INDEX name ON medical_procedure_translation');
  34. //        $this->addSql('DROP INDEX titles_only ON medical_procedure_translation');
  35. ///        $this->addSql('DROP INDEX name ON page_translation');
  36. //        $this->addSql('DROP INDEX titles_only ON page_translation');
  37. //        $this->addSql('ALTER TABLE therapy CHANGE read_only_time read_only_time VARCHAR(255) DEFAULT NULL');
  38.     }
  39.     public function down(Schema $schema): void
  40.     {
  41.         // this down() migration is auto-generated, please modify it to your needs
  42.         $this->addSql('DROP TABLE layout_setting');
  43.         $this->addSql('ALTER TABLE app_translations RENAME INDEX idx_439c00612469de2 TO IDX_ED8C63D312469DE2');
  44.         $this->addSql('ALTER TABLE app_translations RENAME INDEX idx_439c0067987212d TO IDX_ED8C63D37987212D');
  45.         $this->addSql('ALTER TABLE app_translations_translation RENAME INDEX app_translations_translation_unique_translation TO app_translation_translation_unique_translation');
  46.         $this->addSql('ALTER TABLE app_translations_translation RENAME INDEX idx_6d4a86ff2c2ac5d3 TO IDX_3F806F872C2AC5D3');
  47.         $this->addSql('CREATE FULLTEXT INDEX titles_only ON country_translation (name)');
  48.         $this->addSql('ALTER TABLE customer RENAME INDEX idx_81398e09f92f3e70 TO FK_81398E09F92F3E70');
  49.         $this->addSql('CREATE FULLTEXT INDEX name ON disease_translation (name, description)');
  50.         $this->addSql('CREATE FULLTEXT INDEX titles_only ON disease_translation (name)');
  51.         $this->addSql('CREATE FULLTEXT INDEX name ON drug_translation (name, description)');
  52.         $this->addSql('CREATE FULLTEXT INDEX titles_only ON drug_translation (name)');
  53.         $this->addSql('CREATE FULLTEXT INDEX titles_only ON map_marker_translation (name)');
  54.         $this->addSql('CREATE FULLTEXT INDEX name ON map_marker_translation (name, description)');
  55.         $this->addSql('CREATE FULLTEXT INDEX name ON medical_procedure_translation (name, description)');
  56.         $this->addSql('CREATE FULLTEXT INDEX titles_only ON medical_procedure_translation (name)');
  57.         $this->addSql('CREATE FULLTEXT INDEX name ON page_translation (name, excerpt, body)');
  58.         $this->addSql('CREATE FULLTEXT INDEX titles_only ON page_translation (name)');
  59.         $this->addSql('ALTER TABLE therapy CHANGE read_only_time read_only_time VARCHAR(20) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`');
  60.     }
  61. }