mirror of
https://github.com/pelican-dev/panel.git
synced 2025-07-11 09:41:07 +02:00
Add migration to match node ports (#1489)
This commit is contained in:
parent
f8e802afcd
commit
514d961c24
29
database/migrations/2025_07_06_213447_match-node-port.php
Normal file
29
database/migrations/2025_07_06_213447_match-node-port.php
Normal 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
|
||||
}
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user