Skip to content

fix: cx updates for pg:upgrade:* commands #3281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 10, 2025

Conversation

kpremkumar
Copy link

This PR makes some tiny changes to the messages displayed in the new pg:upgrade:* commands as recommended by the cx team.

Refer to https://docs.google.com/document/d/1FEIQPkWRggz_XWzU3PRI6pFg00TwUKIjqft4IGzCOsY/edit?usp=sharing for more info on the pg:upgrade:* commands.

Testing

kpremkumar@kpremku-ltm9a2z cli % ./bin/run pg:upgrade:dryrun --help                               
simulates a Postgres version upgrade on a Standard-tier and higher leader database by creating and upgrading a follower database. Heroku sends the results of the test upgrade via email.

USAGE
  $ heroku pg:upgrade:dryrun [DATABASE] -a <value> [-c <value>] [-v <value>]

ARGUMENTS
  DATABASE  config var containing the connection string, unique name, ID, or alias of the database. To access another app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
            DATABASE_URL.

FLAGS
  -a, --app=<value>      (required) app to run command against
  -c, --confirm=<value>
  -v, --version=<value>  Postgres version to upgrade to

DESCRIPTION
  simulates a Postgres version upgrade on a Standard-tier and higher leader database by creating and upgrading a follower database. Heroku sends the results of the test upgrade via email.

kpremkumar@kpremku-ltm9a2z cli % ./bin/run pg:upgrade:run --help 
starts a Postgres version upgrade

USAGE
  $ heroku pg:upgrade:run [DATABASE] -a <value> [-c <value>] [-v <value>] [-r <value>]

ARGUMENTS
  DATABASE  config var containing the connection string, unique name, ID, or alias of the database. To access another app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
            DATABASE_URL.

FLAGS
  -a, --app=<value>      (required) app to run command against
  -c, --confirm=<value>
  -r, --remote=<value>   git remote of app to use
  -v, --version=<value>  Postgres version to upgrade to

DESCRIPTION
  starts a Postgres version upgrade

  On Essential-tier databases, this command upgrades the database's Postgres version.

  On Standard-tier and higher leader databases, this command runs a previously scheduled Postgres version upgrade. You must run pg:upgrade:prepare before this command to schedule a version upgrade.

  On follower databases, this command unfollows the leader database before upgrading the follower's Postgres version.


EXAMPLES
  # Upgrade an Essential-tier database to a specific version

    $ heroku pg:upgrade:run postgresql-curved-12345 --version 14 --app myapp

  # Upgrade a Standard-tier follower database to the latest supported version

    $ heroku pg:upgrade:run HEROKU_POSTGRESQL_BLUE_URL --app myapp

  # Run a previously scheduled upgrade on a Standard-tier leader database

    $ heroku pg:upgrade:run DATABASE_URL --app myapp
kpremkumar@kpremku-ltm9a2z cli % ./bin/run pg:upgrade:prepare --help 
prepares the upgrade for Standard-tier and higher leader databases and schedules it for the next available maintenance window. To start a version upgrade on Essential-tier and follower databases, use heroku pg:upgrade:run instead.

USAGE
  $ heroku pg:upgrade:prepare [DATABASE] -a <value> [-c <value>] [-v <value>]

ARGUMENTS
  DATABASE  config var containing the connection string, unique name, ID, or alias of the database. To access another app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
            DATABASE_URL.

FLAGS
  -a, --app=<value>      (required) app to run command against
  -c, --confirm=<value>
  -v, --version=<value>  Postgres version to upgrade to

DESCRIPTION
  prepares the upgrade for Standard-tier and higher leader databases and schedules it for the next available maintenance window. To start a version upgrade on Essential-tier and follower databases, use heroku pg:upgrade:run
  instead.
kpremkumar@kpremku-ltm9a2z cli % ./bin/run pg:upgrade --help      
We're deprecating this command. To upgrade your database's Postgres version, use the new pg:upgrade:* subcommands. See https://devcenter.heroku.com/changelog-items/3179.

USAGE
  $ heroku pg:upgrade [DATABASE] -a <value> [-c <value>] [-v <value>] [-r <value>]

ARGUMENTS
  DATABASE  config var containing the connection string, unique name, ID, or alias of the database. To access another app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
            DATABASE_URL.

FLAGS
  -a, --app=<value>      (required) app to run command against
  -c, --confirm=<value>
  -r, --remote=<value>   git remote of app to use
  -v, --version=<value>  Postgres version to upgrade to

DESCRIPTION
  We're deprecating this command. To upgrade your database's Postgres version, use the new pg:upgrade:* subcommands. See https://devcenter.heroku.com/changelog-items/3179.

  For an Essential-tier plan, this command upgrades the database's Postgres version. For a Standard-tier and higher plan, this command unfollows the leader database before upgrading the Postgres version.


COMMANDS
  pg:upgrade:cancel   cancels a scheduled upgrade. You can't cancel a version upgrade that's in progress.
  pg:upgrade:dryrun   simulates a Postgres version upgrade on a Standard-tier and higher leader database by creating and upgrading a follower database. Heroku sends the results of the test upgrade via email.
  pg:upgrade:prepare  prepares the upgrade for Standard-tier and higher leader databases and schedules it for the next available maintenance window. To start a version upgrade on Essential-tier and follower databases, use heroku
                      pg:upgrade:run instead.
  pg:upgrade:run      starts a Postgres version upgrade
  pg:upgrade:wait     provides the status of an upgrade and blocks it until the operation is complete

kpremkumar@kpremku-ltm9a2z cli % 

@kpremkumar kpremkumar changed the base branch from main to pg-upgrade-enhancements April 10, 2025 17:26
@kpremkumar kpremkumar marked this pull request as ready for review April 10, 2025 17:29
@kpremkumar kpremkumar requested a review from a team as a code owner April 10, 2025 17:29
@kpremkumar kpremkumar requested a review from justinwilaby April 10, 2025 17:29
Copy link
Contributor

@justinwilaby justinwilaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kpremkumar kpremkumar force-pushed the pg-upgrade-enhancements branch from 9083f9c to 7794415 Compare April 10, 2025 17:37
@kpremkumar kpremkumar merged commit a87699b into pg-upgrade-enhancements Apr 10, 2025
8 checks passed
@kpremkumar kpremkumar deleted the cx-updates branch April 10, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants