From 2f4c5187054c31dd7a746b9e44c5e928a29d2957 Mon Sep 17 00:00:00 2001 From: akash-sachan Date: Thu, 11 May 2023 18:19:56 +0530 Subject: [PATCH] sort by created_at --- types/incidents/database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/incidents/database.go b/types/incidents/database.go index b38ae461..5af1cb07 100644 --- a/types/incidents/database.go +++ b/types/incidents/database.go @@ -34,7 +34,7 @@ func (i *Incident) BeforeCreate() error { } func (i *Incident) AfterFind() { - db.Model(i).Related(&i.Updates).Order("id DESC") + db.Model(i).Related(&i.Updates).Order("created_at DESC") metrics.Query("incident", "find") }