Add migration to match node ports (#1489)

This commit is contained in:
Boy132 2025-07-07 08:37:45 +02:00 committed by GitHub
parent f8e802afcd
commit 514d961c24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,29 @@
<?php
use App\Models\Node;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
DB::transaction(function () {
$nodes = Node::where('behind_proxy', false)->get();
foreach ($nodes as $node) {
$node->update(['daemon_connect' => $node->daemon_listen]);
}
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Not needed
}
};