mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CloudMigrations: Add ordering to snapshot list query (#89916)
add ordering to snapshot list
This commit is contained in:
parent
86466aec61
commit
6761ed863f
@ -237,6 +237,7 @@ func (ss *sqlStore) GetSnapshotList(ctx context.Context, query cloudmigration.Li
|
|||||||
err := ss.db.WithDbSession(ctx, func(sess *db.Session) error {
|
err := ss.db.WithDbSession(ctx, func(sess *db.Session) error {
|
||||||
offset := (query.Page - 1) * query.Limit
|
offset := (query.Page - 1) * query.Limit
|
||||||
sess.Limit(query.Limit, offset)
|
sess.Limit(query.Limit, offset)
|
||||||
|
sess.OrderBy("created DESC")
|
||||||
return sess.Find(&snapshots, &cloudmigration.CloudMigrationSnapshot{
|
return sess.Find(&snapshots, &cloudmigration.CloudMigrationSnapshot{
|
||||||
SessionUID: query.SessionUID,
|
SessionUID: query.SessionUID,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user