Skip to content

Commit 0deb262

Browse files
committed
Add two migrations to handle a jobs driver change for databases in 5.3
1 parent 193acaa commit 0deb262

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class UpdateJobsTables extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table('jobs', function (Blueprint $table) {
17+
$table->dropIndex('jobs_queue_reserved_reserved_at_index');
18+
$table->dropColumn('reserved');
19+
$table->index(['queue', 'reserved_at']);
20+
});
21+
}
22+
23+
/**
24+
* Reverse the migrations.
25+
*
26+
* @return void
27+
*/
28+
public function down()
29+
{
30+
Schema::table('jobs', function (Blueprint $table) {
31+
$table->dropIndex('jobs_queue_reserved_at_index');
32+
$table->tinyInteger('reserved')->unsigned();
33+
$table->index(['queue', 'reserved', 'reserved_at']);
34+
});
35+
}
36+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Schema;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Database\Migrations\Migration;
6+
7+
class UpdateFailedJobsTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table('failed_jobs', function (Blueprint $table) {
17+
$table->text('exception');
18+
});
19+
}
20+
21+
/**
22+
* Reverse the migrations.
23+
*
24+
* @return void
25+
*/
26+
public function down()
27+
{
28+
Schema::table('failed_jobs', function (Blueprint $table) {
29+
$table->dropColumn('exception');
30+
});
31+
}
32+
}

0 commit comments

Comments
 (0)