From 66b7df6dc1c259e2eb8ea2dcb43de56de8b21324 Mon Sep 17 00:00:00 2001 From: Peter Deltchev Date: Sat, 10 Dec 2016 04:24:12 -0800 Subject: [PATCH] Fixed tracking of failed asynchronous jobs. - expect to find the table in the PostgreSQL database, not MySQL - replace the table's schema with Laravel 5.3's version of it --- config/queue.php | 2 +- ...2_10_120107_create_failed_jobs_table_3.php | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2016_12_10_120107_create_failed_jobs_table_3.php diff --git a/config/queue.php b/config/queue.php index 981743e4..8a2efbe7 100644 --- a/config/queue.php +++ b/config/queue.php @@ -56,7 +56,7 @@ return [ */ 'failed' => [ - 'database' => 'mysql', 'table' => 'failed_jobs', + 'database' => 'pgsql', 'table' => 'failed_jobs', ], ]; diff --git a/database/migrations/2016_12_10_120107_create_failed_jobs_table_3.php b/database/migrations/2016_12_10_120107_create_failed_jobs_table_3.php new file mode 100644 index 00000000..e0be195b --- /dev/null +++ b/database/migrations/2016_12_10_120107_create_failed_jobs_table_3.php @@ -0,0 +1,49 @@ +increments('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() + { + DB::transaction(function () { + Schema::dropIfExists('failed_jobs'); + + Schema::create('failed_jobs', function (Blueprint $table) { + $table->increments('id'); + $table->text('connection', 65535); + $table->text('queue', 65535); + $table->text('payload'); + $table->dateTime('failed_at')->default('now()'); + }); + }); + } +}