add indexes for searching task by end date

This commit is contained in:
Julien Fastré 2021-10-30 00:38:59 +02:00
parent 35a27de216
commit c63b1015e1

View File

@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\Task;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20211029213909 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add index for task state and end date';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE INDEX by_end_date ON chill_task.single_task (end_date DESC NULLS FIRST)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX chill_task.by_end_date');
}
}