laravel / framework

The Laravel Framework.
https://laravel.com
MIT License
32.22k stars 10.91k forks source link

Cannot rename failed_jobs table #51002

Closed MichaelRushton closed 5 months ago

MichaelRushton commented 5 months ago

Laravel Version

11

PHP Version

8.3

Database Driver & Version

No response

Description

In config/queue.php I have renamed the failed_jobs table to failed_queues:

"failed" => [
    "driver" => env("QUEUE_FAILED_DRIVER", "database-uuids"),
    "database" => env("DB_CONNECTION", "sqlite"),
    "table" => "failed_queues",
],

But when a queue fails it is still trying to insert into the failed_jobs table:

[2024-04-10 14:03:44] local.ERROR: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.failed_jobs' doesn't exist (Connection: mariadb, SQL: insert into `failed_jobs`...

Steps To Reproduce

Update failed.table in config/queue.php. Run php artisan queue:work. Trigger a queue that will fail to send.

MichaelRushton commented 5 months ago

My mistake. Forgot to cancel and re-run php artisan queue:work after changing the config.