Skip to content

Commit

Permalink
Fix up Migration timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Dec 4, 2023
1 parent f28c7e4 commit 07aca3d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
18 changes: 0 additions & 18 deletions config/Migrations/202311128071500_MigrationAddIndex.php

This file was deleted.

26 changes: 26 additions & 0 deletions config/Migrations/20231112807150_MigrationAddIndex.php
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();
}

}

0 comments on commit 07aca3d

Please sign in to comment.