diff --git a/database/migrations/0001_01_01_000002_create_jobs_table.php b/database/migrations/0001_01_01_000002_create_jobs_table.php index 425e7058..967fbf5e 100644 --- a/database/migrations/0001_01_01_000002_create_jobs_table.php +++ b/database/migrations/0001_01_01_000002_create_jobs_table.php @@ -13,12 +13,14 @@ return new class extends Migration { Schema::create('jobs', function (Blueprint $table) { $table->id(); - $table->string('queue')->index(); + $table->string('queue'); $table->longText('payload'); $table->unsignedTinyInteger('attempts'); $table->unsignedInteger('reserved_at')->nullable(); $table->unsignedInteger('available_at'); $table->unsignedInteger('created_at'); + + $table->index(['queue', 'reserved_at', 'available_at']); }); Schema::create('job_batches', function (Blueprint $table) {