diff --git a/config/Migrations/202311128071500_MigrationAddIndex.php b/config/Migrations/202311128071500_MigrationAddIndex.php deleted file mode 100644 index 68daf0d9..00000000 --- a/config/Migrations/202311128071500_MigrationAddIndex.php +++ /dev/null @@ -1,18 +0,0 @@ -table('queued_jobs'); - $table - ->addIndex('completed') - ->addIndex('job_task') - ->update(); - } - -} diff --git a/config/Migrations/20231112807150_MigrationAddIndex.php b/config/Migrations/20231112807150_MigrationAddIndex.php new file mode 100644 index 00000000..31b92845 --- /dev/null +++ b/config/Migrations/20231112807150_MigrationAddIndex.php @@ -0,0 +1,26 @@ +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(); + } + +}