diff --git a/cmd/database/database.go b/cmd/database/database.go index b9840cf9..f80fa48d 100644 --- a/cmd/database/database.go +++ b/cmd/database/database.go @@ -23,12 +23,12 @@ func showDatabaseDeprecationWarnings(databases ...civogo.Database) { software := strings.ToLower(db.Software) if software == "mysql" && !mysqlWarning { - utility.Warning("MySQL databases are deprecated and will be removed in a future release. Please consider migrating to PostgreSQL.") + utility.Warning("MySQL databases are deprecated and will be removed in a future release. Please consider checking the documentation https://www.civo.com/docs/database/mysql/dump-mysql to understand how to keep using MySQL with Civo") mysqlWarning = true } if software == "postgresql" && strings.HasPrefix(db.SoftwareVersion, "14") && !pgWarning { - utility.Warning("PostgreSQL 14 is deprecated and will be removed in a future release. Please consider upgrading to a newer version.") + utility.Warning("PostgreSQL 14 is deprecated and will be removed in a future release. Please migrate to PostgreSQL 17. For migration guidance, see: https://www.civo.com/docs/database/postgresql/migrate-from-14-to-17") pgWarning = true } } @@ -69,7 +69,7 @@ func init() { dbCreateCmd.Flags().StringVarP(&networkID, "network", "n", "", "the network to use for the database") 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(&software, "software", "m", "PostgreSQL", "the software to use for the database.") dbCreateCmd.Flags().StringVarP(&softwareVersion, "version", "v", "", "the version of the software to use for the database.") dbCreateCmd.Flags().BoolVarP(&waitDatabase, "wait", "w", false, "a simple flag (e.g. --wait) that will cause the CLI to spin and wait for the database to be ACTIVE") diff --git a/cmd/database/database_create.go b/cmd/database/database_create.go index 8657b9dc..a0cd5aff 100644 --- a/cmd/database/database_create.go +++ b/cmd/database/database_create.go @@ -96,19 +96,17 @@ var dbCreateCmd = &cobra.Command{ os.Exit(1) } - // Set default software to MySQL if not specified if software == "" { - software = "mysql" + software = "postgresql" } + software = strings.ToLower(software) validSoftwares := map[string][]string{ - "mysql": {"mysql"}, "postgresql": {"postgresql", "psql"}, } apiSoftwareNames := map[string]string{ - "mysql": "MySQL", "postgresql": "PostgreSQL", } @@ -125,7 +123,7 @@ var dbCreateCmd = &cobra.Command{ } if !softwareIsValid { - utility.Error("The provided software name is not valid. valid options are mysql, psql or postgresql") + utility.Error("The provided software name is not valid. Valid options are psql or postgresql") os.Exit(1) } diff --git a/doc/DTABASE_BACKUP_RESTORE.md b/doc/DTABASE_BACKUP_RESTORE.md index 7cba94ac..6513ecd7 100644 --- a/doc/DTABASE_BACKUP_RESTORE.md +++ b/doc/DTABASE_BACKUP_RESTORE.md @@ -19,28 +19,23 @@ Manual backups are initiated by a user on-demand. These are useful for creating To manually create a backup, follow the steps outlined in the Usage section. -* Support: PostgreSQL, MySQL +* Support: PostgreSQL ### Restore Process The restore process allows you to recover your database from a previously created backup. -* Support: PostgreSQL, MySQL +* Support: PostgreSQL # CLI Operations -## Create MySQL and PostgreSQL database +## Create a PostgreSQL database ```bash ❯ civo database create postgres-demo --size g3.db.medium --software PostgreSQL --version 14 Database (postgres-demo) with ID 65dd8173-f754-4c6c-b50a-7ddb6d5446c5 has been created ``` -```bash -❯ civo database create mysql-demo --size g3.db.medium --software MySQL --version 8.0 -Database (mysql-demo) with ID 0d328d59-98c3-4f68-8025-5b1633a1c287 has been created -``` - ```bash ❯ civo database ls +--------+---------------+--------------+-------+------------+------------------+--------------+------+--------+ @@ -48,8 +43,6 @@ Database (mysql-demo) with ID 0d328d59-98c3-4f68-8025-5b1633a1c287 has been crea +--------+---------------+--------------+-------+------------+------------------+--------------+------+--------+ | 65dd81 | postgres-demo | g3.db.medium | 1 | PostgreSQL | 14 | 31.28.88.149 | 5432 | Ready | +--------+---------------+--------------+-------+------------+------------------+--------------+------+--------+ -| 0d328d | mysql-demo | g3.db.medium | 1 | MySQL | 8.0 | 31.28.88.184 | 3306 | Ready | -+--------+---------------+--------------+-------+------------+------------------+--------------+------+--------+ To get the credentials for a database, use `civo db credential ` ``` @@ -57,11 +50,12 @@ To get the credentials for a database, use `civo db credential ` ```bash ❯ civo database backups ls postgres-demo -❯ civo database backups ls mysql-demo ``` ## PostgreSQL +> **Note:** PostgreSQL 14 is deprecated and will be removed in a future release. Please migrate to PostgreSQL 17. For migration guidance, see: https://www.civo.com/docs/database/postgresql/migrate-from-14-to-17 + ### Create Scheduled Backup ```bash @@ -127,7 +121,7 @@ Warning: Are you sure you want to restore db postgres-demo from 20240131-095615F Restoring database postgres-demo from from backup 20240131-095615F ``` -## MySQL Backup +## MySQL Backup (Deprecated) ### Create