mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-22 09:26:27 +02:00
Add index on sms timestamps for perfs
This commit is contained in:
parent
7c94c24192
commit
aaeb7b64e9
1 changed files with 24 additions and 0 deletions
24
db/migrations/20230606151521_add_index_to_sms_timestamps.php
Normal file
24
db/migrations/20230606151521_add_index_to_sms_timestamps.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue