Skip to content

Commit 07aca3d

Browse files
committed
Fix up Migration timestamp
1 parent f28c7e4 commit 07aca3d

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

config/Migrations/202311128071500_MigrationAddIndex.php

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
use Phinx\Migration\AbstractMigration;
4+
5+
class MigrationAddIndex extends AbstractMigration {
6+
7+
/**
8+
* @return void
9+
*/
10+
public function change() {
11+
// Shim: make sure this is void when a migrating with `202311128071500` instead of `20231112807150` has been run already.
12+
$result = $this->query('SELECT * FROM `queue_phinxlog` WHERE version = "202311128071500" LIMIT 1')->fetch();
13+
if ($result) {
14+
$this->execute('DELETE FROM `queue_phinxlog` WHERE version = "202311128071500" LIMIT 1');
15+
16+
return;
17+
}
18+
19+
$table = $this->table('queued_jobs');
20+
$table
21+
->addIndex('completed')
22+
->addIndex('job_task')
23+
->update();
24+
}
25+
26+
}

0 commit comments

Comments
 (0)