问题描述
当我尝试php artisan queue:table
它给了我以下错误
When I try php artisan queue:table
It gave me the following error
[InvalidArgumentException]
A CreateJobsTable migration already exists.
这是因为我已经将迁移命名为CreateJobsTable
用于其他目的.我无法重命名该表并进行迁移.有什么办法可以将迁移重命名为CreateJobsQueueTable
或其他相关内容?
It is because I have already the migration named CreateJobsTable
for other purpose. I cannot rename this table and migration . Is there any way to rename the migration to CreateJobsQueueTable
or some thing relevant?
我们可以用'queue:table'重命名工匠创建的Jobs表吗?
推荐答案
是.编辑此文件config\queue.php
:
<?php
return [
....
'connections' => [
....
'database' => [
'driver' => 'database',
'table' => 'jobs', <------ Edit this to something else
'queue' => 'default',
'retry_after' => 90,
],
....
],
....
];
将table
名称更改为其他值,它应该由TableCommand
接听.查看Illuminate\Queue\Console\TableCommand
如何使用此值.这非常简单:)
Change the table
name to other value, and it should pick up by the TableCommand
. Check out Illuminate\Queue\Console\TableCommand
on how it uses this value. It's pretty much straightforward :)
这篇关于在Laravel队列/重命名作业表中自定义作业和作业表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!