Cmd*_*arp 5 laravel lumen laravel-5.2 lumen-5.2
出于某种原因,我无法在 Lumen 5.2 中生成失败的作业表。
我咨询过:
唯一提到的生成器artisan queue:failed-table简单地返回:
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "queue:failed-table" is not defined.
Did you mean one of these?
queue:failed
queue:forget
queue:flush
queue:retry
queue:work
queue:listen
queue:restart
Run Code Online (Sandbox Code Playgroud)
有谁知道为什么会这样?由于(好吧,错误)并且没有要处理的失败作业表,应用程序本身正在抛出错误。
多谢!
我相信 CmdrSharp 是正确的,Lumen 不包含该artisan queue:failed-table命令。
如果有帮助,以下是我自己创建 failed_jobs 表的步骤:
1) 创建迁移以创建 failed_jobs 表。生成的迁移将放置在 /database/migrations 文件夹中。
php artisan make:migration create_failed_jobs_table --table=failed_jobs
Run Code Online (Sandbox Code Playgroud)
2) 编辑迁移,使其看起来像这样:
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->increments('id');
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('failed_jobs');
}
}
Run Code Online (Sandbox Code Playgroud)
3) 运行迁移以创建表
php artisan migrate
Run Code Online (Sandbox Code Playgroud)
祝你好运!
| 归档时间: |
|
| 查看次数: |
3004 次 |
| 最近记录: |