Skip to content

Commit

Permalink
list ordered by date
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyr committed Jun 4, 2018
1 parent 91b6e35 commit 6ac318b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
src/
.envrc
bin/
pkg/
2 changes: 1 addition & 1 deletion backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (r *BackupRepo) GetBackup(backupID string) (*Backup, error) {
}

func (r *BackupRepo) GetBackups(appID string) ([]*Backup, error) {
rows, err := r.db.Query("SELECT * FROM pgbackups WHERE app_id = $1", appID)
rows, err := r.db.Query("SELECT * FROM pgbackups WHERE app_id = $1 ORDER BY started_at ASC", appID)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func listBackups(pgb *PgBackups) {
appName := os.Args[2]

if appName == "" {
panic("App name must be given (pgbackups [list] [appname])")
panic("App name must be given (pgbackups list [appname])")
}

app, err := pgb.FlynnClient.GetApp(appName)
Expand Down

0 comments on commit 6ac318b

Please sign in to comment.