mirror of
https://github.com/tiennm99/coolify.git
synced 2026-09-20 04:23:16 +00:00
chore: remove raw sql from env relationship
- raw sql should not be used whenever possible - using sql to order on the relationship environment_variables() causes custom sorting to break or be additionally complicated
This commit is contained in:
10 files changed
+10
-90
No files matched your search
@@ -295,15 +295,7 @@ class StandaloneClickhouse extends BaseModel
|
||||
|
||||
public function environment_variables()
|
||||
{
|
||||
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
|
||||
ELSE 3
|
||||
END,
|
||||
LOWER(key) ASC
|
||||
");
|
||||
return $this->morphMany(EnvironmentVariable::class, 'resourceable');
|
||||
}
|
||||
|
||||
public function runtime_environment_variables()
|
||||
|
||||
Reference in new issue
Block a user