URL Shortener 1.0
A Laravel-based URL shortener application
Chargement...
Recherche...
Aucune correspondance
0001_01_01_000002_create_jobs_table.php
Aller à la documentation de ce fichier.
1<?php
2
3use Illuminate\Database\Migrations\Migration;
4use Illuminate\Database\Schema\Blueprint;
5use Illuminate\Support\Facades\Schema;
6
7return new class extends Migration
8{
12 public function up(): void
13 {
14 Schema::create('jobs', function (Blueprint $table) {
15 $table->id();
16 $table->string('queue')->index();
17 $table->longText('payload');
18 $table->unsignedTinyInteger('attempts');
19 $table->unsignedInteger('reserved_at')->nullable();
20 $table->unsignedInteger('available_at');
21 $table->unsignedInteger('created_at');
22 });
23
24 Schema::create('job_batches', function (Blueprint $table) {
25 $table->string('id')->primary();
26 $table->string('name');
27 $table->integer('total_jobs');
28 $table->integer('pending_jobs');
29 $table->integer('failed_jobs');
30 $table->longText('failed_job_ids');
31 $table->mediumText('options')->nullable();
32 $table->integer('cancelled_at')->nullable();
33 $table->integer('created_at');
34 $table->integer('finished_at')->nullable();
35 });
36
37 Schema::create('failed_jobs', function (Blueprint $table) {
38 $table->id();
39 $table->string('uuid')->unique();
40 $table->text('connection');
41 $table->text('queue');
42 $table->longText('payload');
43 $table->longText('exception');
44 $table->timestamp('failed_at')->useCurrent();
45 });
46 }
47
51 public function down(): void
52 {
53 Schema::dropIfExists('jobs');
54 Schema::dropIfExists('job_batches');
55 Schema::dropIfExists('failed_jobs');
56 }
57};
down()
Reverse the migrations.