From 0deb262c56bead7984db3950e3b47ebee701f02f Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 4 Sep 2016 17:21:41 -0400 Subject: [PATCH] Add two migrations to handle a jobs driver change for databases in 5.3 --- .../2016_09_04_171338_update_jobs_tables.php | 36 +++++++++++++++++++ ..._09_04_172028_update_failed_jobs_table.php | 32 +++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 database/migrations/2016_09_04_171338_update_jobs_tables.php create mode 100644 database/migrations/2016_09_04_172028_update_failed_jobs_table.php diff --git a/database/migrations/2016_09_04_171338_update_jobs_tables.php b/database/migrations/2016_09_04_171338_update_jobs_tables.php new file mode 100644 index 000000000..482bb08c7 --- /dev/null +++ b/database/migrations/2016_09_04_171338_update_jobs_tables.php @@ -0,0 +1,36 @@ +dropIndex('jobs_queue_reserved_reserved_at_index'); + $table->dropColumn('reserved'); + $table->index(['queue', 'reserved_at']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('jobs', function (Blueprint $table) { + $table->dropIndex('jobs_queue_reserved_at_index'); + $table->tinyInteger('reserved')->unsigned(); + $table->index(['queue', 'reserved', 'reserved_at']); + }); + } +} diff --git a/database/migrations/2016_09_04_172028_update_failed_jobs_table.php b/database/migrations/2016_09_04_172028_update_failed_jobs_table.php new file mode 100644 index 000000000..38f2ef3a5 --- /dev/null +++ b/database/migrations/2016_09_04_172028_update_failed_jobs_table.php @@ -0,0 +1,32 @@ +text('exception'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('failed_jobs', function (Blueprint $table) { + $table->dropColumn('exception'); + }); + } +}