Skip to content

Commit

Permalink
Minor tweaks (#310)
Browse files Browse the repository at this point in the history
Co-authored-by: Haardik Dharma <haardik@civo.com>
  • Loading branch information
haardikdharma10 and haardikdharma10 authored Apr 24, 2023
1 parent 26bed9a commit 992d4ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func init() {
dbCreateCmd.Flags().StringVarP(&rulesFirewall, "firewall-rules", "u", "", "the firewall rules to use for the database")
dbCreateCmd.Flags().StringVarP(&size, "size", "s", "g3.db.small", "the size of the database. You can list available DB sizes by `civo size list -s database`")
dbCreateCmd.Flags().StringVarP(&software, "software", "m", "MySQL", "the software to use for the database. One of: MySQL, PostgreSQL. Please make sure you use the correct capitalisation.")
dbCreateCmd.Flags().StringVarP(&softwareVersion, "version", "v", "8.0", "the version of the software to use for the database.")
dbCreateCmd.Flags().StringVarP(&softwareVersion, "version", "v", "", "the version of the software to use for the database.")

dbUpdateCmd.Flags().IntVarP(&nodes, "nodes", "", 0, "the number of nodes for the database")
dbUpdateCmd.Flags().StringVarP(&firewallID, "firewall", "", "", "the firewall to use for the database")
Expand Down
13 changes: 9 additions & 4 deletions cmd/database/database_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,23 @@ var dbCreateCmd = &cobra.Command{
softwareVersion = "8.0"
}

if software == "PostgreSQL" && softwareVersion == "" {
softwareVersion = "14"
}

softwareIsValid := false
softwareVersionIsValid := false
if software != "" {
for swName, version := range dbVersions {
if swName == software {
softwareIsValid = true
}
for i, v := range version {
if v.SoftwareVersion == version[i].SoftwareVersion {
softwareVersionIsValid = true
for i, v := range version {
if v.SoftwareVersion == version[i].SoftwareVersion {
softwareVersionIsValid = true
}
}
}

}
}

Expand Down

0 comments on commit 992d4ab

Please sign in to comment.