<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241230120107 extends AbstractMigration
{
public function getDescription(): string
{
return 'feature/search_offer: Dodawanie index dla wyszukiwania';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE FULLTEXT INDEX keywordsSearch ON offer (keywords)');
$this->addSql('CREATE INDEX Logo ON file (id)');
$this->addSql('CREATE INDEX invoiceData ON invoice_data (id)');
$this->addSql('CREATE INDEX Item ON item (id)');
$this->addSql('CREATE INDEX itemCategory ON item_category (id, item_category_id)');
$this->addSql('CREATE INDEX itemItemCategory ON item_item_category (item_id, item_category_id)');
$this->addSql('CREATE UNIQUE INDEX itemSort ON item_sort (item_id, industry, category)');
$this->addSql('CREATE INDEX itemSort2 ON item_sort (use_count, points, technology)');
$this->addSql('CREATE INDEX jobListingsItemCategoryId ON job_listings (item_category_id)');
$this->addSql('CREATE INDEX offerDate ON offer (boost_date, published_at, created_at)');
$this->addSql('CREATE INDEX offerSearch ON offer (id, offer_company_id, category_id, done, active, offer_id, order_id)');
$this->addSql('CREATE INDEX offerCompanyLogo ON offer_company (id, logo_id, invoice_data_id)');
$this->addSql('CREATE INDEX industryListView ON search_industry (item_category_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX Logo ON file');
$this->addSql('DROP INDEX invoiceData ON invoice_data');
$this->addSql('DROP INDEX Item ON item');
$this->addSql('DROP INDEX itemItemCategory ON item_item_category');
$this->addSql('DROP INDEX itemCategory ON item_category');
$this->addSql('DROP INDEX itemSort ON item_sort');
$this->addSql('DROP INDEX itemSort2 ON item_sort');
$this->addSql('DROP INDEX jobListingsItemCategoryId ON job_listings');
$this->addSql('DROP INDEX keywordsSearch ON offer');
$this->addSql('DROP INDEX offerDate ON offer');
$this->addSql('DROP INDEX offerSearch ON offer');
$this->addSql('DROP INDEX offerCompanyLogo ON offer_company');
$this->addSql('DROP INDEX industryListView ON search_industry');
}
}