fix(parser): use firstOrCreate instead of updateOrCreate for environment variables

Prevent unnecessary updates to existing environment variable records.
The previous implementation would update matching records, but the intent
is to retrieve or create the record without modifying existing ones.
This commit is contained in:
Andras Bacsai 2026-03-10 18:06:01 +01:00
parent a362282976
commit 0679e91c85

View file

@ -1940,7 +1940,7 @@ function serviceParser(Service $resource): Collection
} else {
$value = generateEnvValue($command, $resource);
$resource->environment_variables()->updateOrCreate([
$resource->environment_variables()->firstOrCreate([
'key' => $key->value(),
'resourceable_type' => get_class($resource),
'resourceable_id' => $resource->id,