fix(core): v1 parser versions trying to access application_id, while it is resourceable_id

fix(db): remove wrongly created, empty environmentvariables
This commit is contained in:
Andras Bacsai
2025-01-22 10:21:41 +01:00
parent 185ddd48f2
commit 085103708c
2 changed files with 33 additions and 7 deletions

View File

@@ -0,0 +1,19 @@
<?php
use App\Models\EnvironmentVariable;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Log;
return new class extends Migration
{
public function up(): void
{
try {
EnvironmentVariable::whereNull('resourceable_id')->each(function (EnvironmentVariable $environmentVariable) {
$environmentVariable->delete();
});
} catch (\Exception $e) {
Log::error('Failed to delete wrongly created environment variables: '.$e->getMessage());
}
}
};