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 committed 2025-01-22 10:21:51 +01:00
1 parent 185ddd48f2
commit 085103708c
2 files changed
+33 -7

No files matched your search

@@ -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());
}
}
};