Skip to content

Commit db64606

Browse files
committed
Fix PostgreSQL index name collision in MigrationQueueIndexOptimization
The migration was creating an index named 'workerkey' on the queued_jobs table, but this name already exists on the queue_processes table (created in MigrationQueueInitV8). PostgreSQL requires index names to be unique across the entire schema, unlike MySQL which only requires uniqueness within a table. This caused the migration to fail with error: SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "workerkey" already exists Solution: Rename the index from 'workerkey' to 'queued_jobs_workerkey' to follow the table_column naming convention and avoid the collision. This fix is backwards compatible with MySQL and resolves the PostgreSQL migration failure.
1 parent b9bf7a5 commit db64606

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

config/Migrations/20251119005411_MigrationQueueIndexOptimization.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function change(): void {
4242
->addIndex(
4343
['workerkey'],
4444
[
45-
'name' => 'workerkey',
45+
'name' => 'queued_jobs_workerkey',
4646
],
4747
)
4848
->update();

0 commit comments

Comments
 (0)