-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f28c7e4
commit 07aca3d
Showing
2 changed files
with
26 additions
and
18 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
use Phinx\Migration\AbstractMigration; | ||
|
||
class MigrationAddIndex extends AbstractMigration { | ||
|
||
/** | ||
* @return void | ||
*/ | ||
public function change() { | ||
// Shim: make sure this is void when a migrating with `202311128071500` instead of `20231112807150` has been run already. | ||
$result = $this->query('SELECT * FROM `queue_phinxlog` WHERE version = "202311128071500" LIMIT 1')->fetch(); | ||
if ($result) { | ||
$this->execute('DELETE FROM `queue_phinxlog` WHERE version = "202311128071500" LIMIT 1'); | ||
|
||
return; | ||
} | ||
|
||
$table = $this->table('queued_jobs'); | ||
$table | ||
->addIndex('completed') | ||
->addIndex('job_task') | ||
->update(); | ||
} | ||
|
||
} |