Skip to content

Commit 9795115

Browse files
authored
Merge pull request #555 from civo/fix/dbversion
correctly visualise all the DB versions (not just the defaults)
2 parents c25adef + 4fdc788 commit 9795115

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

cmd/database/database_version.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package database
22

33
import (
4+
"fmt"
5+
"os"
6+
47
"github.com/civo/cli/common"
58
"github.com/civo/cli/config"
69
"github.com/civo/cli/utility"
710
"github.com/spf13/cobra"
8-
"os"
911
)
1012

1113
var dbVersionListCmd = &cobra.Command{
@@ -34,10 +36,14 @@ var dbVersionListCmd = &cobra.Command{
3436

3537
ow := utility.NewOutputWriter()
3638

39+
// Iterate through each database type and all its versions
3740
for dbName, versionDetails := range dbVersions {
38-
ow.StartLine()
39-
ow.AppendDataWithLabel("name", dbName, "Name")
40-
ow.AppendDataWithLabel("version", versionDetails[0].SoftwareVersion, "version")
41+
for _, version := range versionDetails {
42+
ow.StartLine()
43+
ow.AppendDataWithLabel("name", dbName, "Name")
44+
ow.AppendDataWithLabel("version", version.SoftwareVersion, "Version")
45+
ow.AppendDataWithLabel("default", fmt.Sprintf("%t", version.Default), "Default")
46+
}
4147
}
4248

4349
switch common.OutputFormat {

0 commit comments

Comments
 (0)