raspisms/db/migrations/20230606151521_add_index_to...

25 lines
614 B
PHP
Raw Permalink Normal View History

2023-06-06 18:39:48 +02:00
<?php
use Phinx\Migration\AbstractMigration;
class AddIndexToSmsTimestamps extends AbstractMigration
{
/**
* Add indexes on most SMS table timestamp (and possibly other fields) to improve perfs on query using date, like stats, sending limits, etc.
*/
public function change()
{
$table = $this->table('sended');
$table->addIndex('at');
$table->update();
$table = $this->table('received');
$table->addIndex('at');
$table->update();
$table = $this->table('scheduled');
$table->addIndex('at');
$table->update();
}
}