Skip to content

Commit e9472e1

Browse files
committed
nits
1 parent e32d3b0 commit e9472e1

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

packages/cli/src/commands/pg/upgrade/dryrun.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,17 @@ export default class Upgrade extends Command {
3636
ux.error(`You can only use ${color.cmd('pg:upgrade:*')} commands on Essential-* and higher plans.`)
3737

3838
if (essentialNumPlan(db))
39-
ux.error(`You can't use ${color.cmd('pg:upgrade:dryrun')} on Essential tier databases. You can only use this command on Standard-tier and higher leader databases.`)
39+
ux.error(`You can't use ${color.cmd('pg:upgrade:dryrun')} on Essential-tier databases. You can only use this command on Standard-tier and higher leader databases.`)
4040

41+
const versionPhrase = version ? heredoc(`Postgres version ${version}`) : heredoc('the latest supported Postgres version')
4142
const {body: replica} = await this.heroku.get<PgDatabase>(`/client/v11/databases/${db.id}`, {hostname: pgHost()})
4243
if (replica.following)
4344
ux.error(`You can't use ${color.cmd('pg:upgrade:dryrun')} on follower databases. You can only use this command on Standard-tier and higher leader databases.`)
4445

45-
if (version)
46-
await confirmCommand(app, confirm, heredoc(`
47-
Destructive action
48-
This command starts a test upgrade for ${color.addon(db.name)} to Postgres version ${version}.
49-
`))
50-
else
51-
await confirmCommand(app, confirm, heredoc(`
46+
await confirmCommand(app, confirm, heredoc(`
5247
Destructive action
53-
This command starts a test upgrade for ${color.addon(db.name)} to the latest supported Postgres version.
54-
`))
48+
This command starts a test upgrade for ${color.addon(db.name)} to ${versionPhrase}.
49+
`))
5550

5651
try {
5752
const data = {version}

packages/cli/test/unit/commands/pg/upgrade/dryrun.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ describe('pg:upgrade:dryrun', function () {
6868
'--confirm',
6969
'myapp',
7070
]).catch(error => {
71-
expect(error.message).to.equal(`You can't use ${color.cmd('pg:upgrade:dryrun')} on Essential tier databases. You can only use this command on Standard-tier and higher leader databases.`)
71+
expect(error.message).to.equal(`You can't use ${color.cmd('pg:upgrade:dryrun')} on Essential-tier databases. You can only use this command on Standard-tier and higher leader databases.`)
7272
})
7373
})
7474

0 commit comments

Comments
 (0)