猿问

为什么 Laravel 6.x 默认创建 failed_jobs 迁移

我在 Laravel 迁移中创建了一个消息表,但它也在创建另一个表create_failed_jobs_table。我没有创建这个,它是一个新项目。它发生在我创建的每个项目中,它也会自动创建此表,同时还创建另一个表,我不知道我所做的是否创建了它。这是这个文件:


create_failed_jobs_table):


<?php


use Illuminate\Database\Migrations\Migration;

use Illuminate\Database\Schema\Blueprint;

use Illuminate\Support\Facades\Schema;


class CreateFailedJobsTable extends Migration

{

    /**

     * Run the migrations.

     *

     * @return void

     */

    public function up()

    {

        Schema::create('failed_jobs', function (Blueprint $table) {

            $table->bigIncrements('id');

            $table->text('connection');

            $table->text('queue');

            $table->longText('payload');

            $table->longText('exception');

            $table->timestamp('failed_at')->useCurrent();

        });

    }


    /**

     * Reverse the migrations.

     *

     * @return void

     */

    public function down()

    {

        Schema::dropIfExists('failed_jobs');

    }

}


创建消息表:)


<?php


use Illuminate\Database\Migrations\Migration;

use Illuminate\Database\Schema\Blueprint;

use Illuminate\Support\Facades\Schema;


class CreateMessagesTable extends Migration

{

    /**

     * Run the migrations.

     *

     * @return void

     */

    public function up()

    {

        Schema::create('messages', function (Blueprint $table) {

            $table->bigIncrements('id');

            $table->timestamps();

        });

    }


    /**

     * Reverse the migrations.

     *

     * @return void

     */

    public function down()

    {

        Schema::dropIfExists('messages');

    }

}


精慕HU
浏览 173回答 1
1回答

呼唤远方

要回答您的问题,以便您的问题可以标记为已回答:该failed_jobs表是所有 Laravel 6.x 项目的默认设置。您可以查看发行说明以了解 6.0 版中更改的其他内容。请注意,Laravel 6.0 还在配置中添加了一个新的驱动程序选项。这可能就是他们默认包含迁移的原因。
随时随地看视频慕课网APP
我要回答