From 41df88bdde1f4925d435129c8b075f2a9047a072 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Mon, 21 Nov 2022 18:58:42 +0000 Subject: [PATCH 1/2] Add new failed jobs table --- ... 2022_11_21_185719_create_failed_jobs_table.php} | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) rename database/migrations/{2015_07_22_084423_create_failed_jobs_table.php => 2022_11_21_185719_create_failed_jobs_table.php} (63%) diff --git a/database/migrations/2015_07_22_084423_create_failed_jobs_table.php b/database/migrations/2022_11_21_185719_create_failed_jobs_table.php similarity index 63% rename from database/migrations/2015_07_22_084423_create_failed_jobs_table.php rename to database/migrations/2022_11_21_185719_create_failed_jobs_table.php index 16db8524..17191986 100644 --- a/database/migrations/2015_07_22_084423_create_failed_jobs_table.php +++ b/database/migrations/2022_11_21_185719_create_failed_jobs_table.php @@ -2,8 +2,9 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; -class CreateFailedJobsTable extends Migration +return new class extends Migration { /** * Run the migrations. @@ -13,11 +14,13 @@ class CreateFailedJobsTable extends Migration public function up() { Schema::create('failed_jobs', function (Blueprint $table) { - $table->increments('id'); + $table->id(); + $table->string('uuid')->unique(); $table->text('connection'); $table->text('queue'); $table->longText('payload'); - $table->timestamp('failed_at'); + $table->longText('exception'); + $table->timestamp('failed_at')->useCurrent(); }); } @@ -28,6 +31,6 @@ class CreateFailedJobsTable extends Migration */ public function down() { - Schema::drop('failed_jobs'); + Schema::dropIfExists('failed_jobs'); } -} +}; From 953f98a389e0237fd8098ae9bddbd3150f045bcf Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Mon, 21 Nov 2022 19:07:47 +0000 Subject: [PATCH 2/2] Remove a migration that alters the failed jobs table --- ..._exception_column_to_failed_jobs_table.php | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 database/migrations/2016_09_06_152900_add_exception_column_to_failed_jobs_table.php diff --git a/database/migrations/2016_09_06_152900_add_exception_column_to_failed_jobs_table.php b/database/migrations/2016_09_06_152900_add_exception_column_to_failed_jobs_table.php deleted file mode 100644 index 0f0598cb..00000000 --- a/database/migrations/2016_09_06_152900_add_exception_column_to_failed_jobs_table.php +++ /dev/null @@ -1,31 +0,0 @@ -text('exception'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('failed_jobs', function (Blueprint $table) { - $table->dropColumn('exception'); - }); - } -}