mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-03 04:46:18 +00:00
refactor(environment): streamline environment variable handling by replacing sorting methods with direct property access and enhancing query ordering for improved performance
This commit is contained in:
1 parent
c6b47da1e9
commit
8e155f25b3
12 files changed
+108
-43
No files matched your search
@@ -341,6 +341,13 @@ class StandaloneKeydb extends BaseModel
|
||||
public function environment_variables()
|
||||
{
|
||||
return $this->morphMany(EnvironmentVariable::class, 'resourceable')
|
||||
->orderBy('key', 'asc');
|
||||
->orderByRaw("
|
||||
CASE
|
||||
WHEN LOWER(key) LIKE 'service_%' THEN 1
|
||||
WHEN is_required = true AND (value IS NULL OR value = '') THEN 2
|
||||
ELSE 3
|
||||
END,
|
||||
LOWER(key) ASC
|
||||
");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user