diff --git a/pkg/db/postgres.go b/pkg/db/postgres.go index cbab8c1..2a77313 100644 --- a/pkg/db/postgres.go +++ b/pkg/db/postgres.go @@ -125,12 +125,12 @@ func (m *Postgres) GetEnvironmentTestsAndTestCases() (map[string]interface{}, er var environmentTests []models.DBEnvironmentTest var testCases []models.DBTestCase - err := m.db.Select(&environmentTests, "SELECT * FROM db_environment_tests LIMIT 100") + err := m.db.Select(&environmentTests, "SELECT * FROM db_environment_tests ORDER BY TestTime DESC LIMIT 100") if err != nil { return nil, fmt.Errorf("failed to execute SQL query for environment tests: %v", err) } - err = m.db.Select(&testCases, "SELECT * FROM db_test_cases LIMIT 100") + err = m.db.Select(&testCases, "SELECT * FROM db_test_cases ORDER BY TestTime DESC LIMIT 100") if err != nil { return nil, fmt.Errorf("failed to execute SQL query for test cases: %v", err)