mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Add migration
This commit is contained in:
parent
95f118b2dc
commit
83bc84dd97
1 changed files with 34 additions and 0 deletions
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use App\Status;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
foreach(Status::whereNotNull('entities')->lazyById(200, 'id') as $status) {
|
||||||
|
if(!in_array($status->scope, ['public', 'unlisted', 'private'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(str_starts_with($status->entities, '{"urls')) {
|
||||||
|
$status->entities = null;
|
||||||
|
$status->save();
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in a new issue