Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions app/Services/Servers/ServerDeletionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function withForce(bool $bool = true): self
}

/**
* Delete a server from the panel and remove any associated databases from hosts.
* Delete a server from the panel, clear any allocation notes, and remove any associated databases from hosts.
*
* @throws \Throwable
* @throws \Pterodactyl\Exceptions\DisplayException
Expand Down Expand Up @@ -77,7 +77,11 @@ public function handle(Server $server): void
}
}

// clear any allocation notes for the server
$server->allocations()->update(['notes' => null]);


$server->delete();
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{

DB::table('allocations')
->whereNull('server_id')
->update(['notes' => null]);

}

/**
* Reverse the migrations.
*/
public function down(): void
{
// Reverse not needed
}
};
Loading