mirror of
https://github.com/tiennm99/coolify.git
synced 2026-05-03 04:21:05 +00:00
refactor(environment-variables): adjust ordering logic for environment variables
- Updated the ordering logic in the environment_variables methods for both Application and Service models to prioritize required variables over service-prefixed keys. - This change enhances the clarity and organization of environment variable retrieval, ensuring that essential variables are listed first.
This commit is contained in:
@@ -1231,9 +1231,9 @@ class Service extends BaseModel
|
||||
{
|
||||
return $this->morphMany(EnvironmentVariable::class, 'resourceable')
|
||||
->orderByRaw("
|
||||
CASE
|
||||
WHEN LOWER(key) LIKE 'service_%' THEN 1
|
||||
WHEN is_required = true AND (value IS NULL OR value = '') THEN 2
|
||||
CASE
|
||||
WHEN is_required = true THEN 1
|
||||
WHEN LOWER(key) LIKE 'service_%' THEN 2
|
||||
ELSE 3
|
||||
END,
|
||||
LOWER(key) ASC
|
||||
|
||||
Reference in New Issue
Block a user