mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-01-31 19:16:44 +01:00
Add missing migration
This commit is contained in:
parent
15e01fcc8d
commit
0af1dfa71d
1 changed files with 38 additions and 0 deletions
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddUuidToFailedJobsTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('failed_jobs', function (Blueprint $table) {
|
||||||
|
$table->string('uuid')->after('id')->nullable()->unique();
|
||||||
|
});
|
||||||
|
|
||||||
|
DB::table('failed_jobs')->whereNull('uuid')->cursor()->each(function ($job) {
|
||||||
|
DB::table('failed_jobs')
|
||||||
|
->where('id', $job->id)
|
||||||
|
->update(['uuid' => (string) Str::uuid()]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('failed_jobs', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('uuid');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue