mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 21:20:29 +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:
@@ -845,15 +845,7 @@ class Application extends BaseModel
|
||||
public function environment_variables()
|
||||
{
|
||||
return $this->morphMany(EnvironmentVariable::class, 'resourceable')
|
||||
->where('is_preview', false)
|
||||
->orderByRaw("
|
||||
CASE
|
||||
WHEN is_required = true THEN 1
|
||||
WHEN LOWER(key) LIKE 'service_%' THEN 2
|
||||
ELSE 3
|
||||
END,
|
||||
LOWER(key) ASC
|
||||
");
|
||||
->where('is_preview', false);
|
||||
}
|
||||
|
||||
public function runtime_environment_variables()
|
||||
|
||||
Reference in New Issue
Block a user