migrations/Version20241230120107.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 Version20241230120107 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'feature/search_offer: Dodawanie index dla wyszukiwania';
  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 FULLTEXT INDEX keywordsSearch ON offer (keywords)');
  19.         $this->addSql('CREATE INDEX Logo ON file (id)');
  20.         $this->addSql('CREATE INDEX invoiceData ON invoice_data (id)');
  21.         $this->addSql('CREATE INDEX Item ON item (id)');
  22.         $this->addSql('CREATE INDEX itemCategory ON item_category (id, item_category_id)');
  23.         $this->addSql('CREATE INDEX itemItemCategory ON item_item_category (item_id, item_category_id)');
  24.         $this->addSql('CREATE UNIQUE INDEX itemSort ON item_sort (item_id, industry, category)');
  25.         $this->addSql('CREATE INDEX itemSort2 ON item_sort (use_count, points, technology)');
  26.         $this->addSql('CREATE INDEX jobListingsItemCategoryId ON job_listings (item_category_id)');
  27.         $this->addSql('CREATE INDEX offerDate ON offer (boost_date, published_at, created_at)');
  28.         $this->addSql('CREATE INDEX offerSearch ON offer (id, offer_company_id, category_id, done, active, offer_id, order_id)');
  29.         $this->addSql('CREATE INDEX offerCompanyLogo ON offer_company (id, logo_id, invoice_data_id)');
  30.         $this->addSql('CREATE INDEX industryListView ON search_industry (item_category_id)');
  31.     }
  32.     public function down(Schema $schema): void
  33.     {
  34.         // this down() migration is auto-generated, please modify it to your needs
  35.         $this->addSql('DROP INDEX Logo ON file');
  36.         $this->addSql('DROP INDEX invoiceData ON invoice_data');
  37.         $this->addSql('DROP INDEX Item ON item');
  38.         $this->addSql('DROP INDEX itemItemCategory ON item_item_category');
  39.         $this->addSql('DROP INDEX itemCategory ON item_category');
  40.         $this->addSql('DROP INDEX itemSort ON item_sort');
  41.         $this->addSql('DROP INDEX itemSort2 ON item_sort');
  42.         $this->addSql('DROP INDEX jobListingsItemCategoryId ON job_listings');
  43.         $this->addSql('DROP INDEX keywordsSearch ON offer');
  44.         $this->addSql('DROP INDEX offerDate ON offer');
  45.         $this->addSql('DROP INDEX offerSearch ON offer');
  46.         $this->addSql('DROP INDEX offerCompanyLogo ON offer_company');
  47.         $this->addSql('DROP INDEX industryListView ON search_industry');
  48.     }
  49. }