database/migrations/2021_01_01_000003_create_queue_job_records_table.php
<?php
declare(strict_types=1);
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateQueueJobRecordsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Schema::create(config('queue.connections.database.table'), function (Blueprint $table) {
$table->increments('id');
$table->string('queue');
$table->longText('payload');
$table->tinyInteger('attempts')->unsigned();
$table->integer('reserved_at')->unsigned()->nullable();
$table->integer('available_at')->unsigned();
$table->integer('created_at')->unsigned();
// Indexes
$table->index(['queue']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
Schema::dropIfExists(config('queue.connections.database.table'));
}
}