You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For an Essential-* plan, this command upgrades the database's PostgreSQL version. For a Standard-tier and higher plan, this command unfollows the leader database before upgrading the PostgreSQL version.
17
-
To upgrade to another PostgreSQL version, use pg:copy instead
18
-
`)
16
+
We’re deprecating this command. To upgrade your database's Postgres version, use the new ${color.cmd('pg:upgrade:*')} subcommands. See https://devcenter.heroku.com/changelog-items/3179.
17
+
18
+
For an Essential-* 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.
19
+
`)
19
20
20
21
staticflags={
21
22
confirm: flags.string({char: 'c'}),
22
-
version: flags.string({char: 'v',description: 'PostgreSQL version to upgrade to'}),
23
+
version: flags.string({char: 'v',description: 'Postgres version to upgrade to'}),
We’re deprecating this command. To upgrade your database's Postgres version, use the new ${color.cmd('pg:upgrade:*')} subcommands. See https://devcenter.heroku.com/changelog-items/3179.
50
+
44
51
Destructive action
45
-
${color.addon(db.name)}will be upgraded to a newer PostgreSQL version, stop following ${origin}, and become writable.
52
+
You're upgrading ${color.addon(db.name)} to ${versionPhrase}. The database will stop following ${origin} and become writable.
46
53
47
54
This cannot be undone.
48
55
`))
49
-
}else{
56
+
}elseif(essentialNumPlan(db)){
50
57
awaitconfirmCommand(app,confirm,heredoc(`
58
+
We’re deprecating this command. To upgrade your database's Postgres version, use the new ${color.cmd('pg:upgrade:*')} subcommands. See https://devcenter.heroku.com/changelog-items/3179.
59
+
51
60
Destructive action
52
-
${color.addon(db.name)}will be upgraded to a newer PostgreSQL version.
61
+
You're upgrading ${color.addon(db.name)} to ${versionPhrase}.
53
62
54
63
This cannot be undone.
55
64
`))
65
+
}else{
66
+
ux.warn(heredoc(`
67
+
We’re deprecating this command. To upgrade your database's Postgres version, use the new ${color.cmd('pg:upgrade:*')} subcommands. See https://devcenter.heroku.com/changelog-items/3179.`,
68
+
))
69
+
ux.error(`You can only use ${color.cmd('heroku pg:upgrade')} on Essential-tier databases and follower databases on Standard-tier and higher plans.`)
56
70
}
57
71
58
-
constdata={version}
59
-
ux.action.start(`Starting upgrade of ${color.addon(db.name)}`)
Copy file name to clipboardExpand all lines: packages/cli/test/acceptance/commands-output.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -206,7 +206,7 @@ pg:settings:log-min-duration-statement The duration of each completed st
206
206
pg:settings:log-statement log_statement controls which SQL statements are logged.
207
207
pg:settings:track-functions track_functions controls tracking of function call counts and time used. Default is none.
208
208
pg:unfollow stop a replica from following and make it a writeable database
209
-
pg:upgrade For an Essential-* plan, this command upgrades the database's PostgreSQL version. For a Standard-tier and higher plan, this command unfollows the leader database before upgrading the PostgreSQL version.
209
+
pg:upgrade 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.
210
210
pg:vacuum-stats show dead rows and whether an automatic vacuum is expected to be triggered
it('refuses to upgrade legacy essential dbs',asyncfunction(){
19
41
nock('https://api.heroku.com')
20
42
.post('/actions/addon-attachments/resolve')
@@ -25,36 +47,72 @@ describe('pg:upgrade', function () {
25
47
'--confirm',
26
48
'myapp',
27
49
]).catch(error=>{
28
-
expect(error.message).to.equal('pg:upgrade is only available for Essential-* databases and follower databases on Standard-tier and higher plans.')
50
+
expect(error.message).to.equal(`You can only use ${color.cmd('heroku pg:upgrade')} on Essential-tier databases and follower databases on Standard-tier and higher plans.`)
29
51
})
30
52
})
31
53
32
-
it('upgrades db',asyncfunction(){
54
+
it('refuses to upgrade standard tier leader db',asyncfunction(){
expect(error.message).to.equal(`You can only use ${color.cmd('heroku pg:upgrade')} on Essential-tier databases and follower databases on Standard-tier and higher plans.`)
72
+
})
73
+
})
74
+
75
+
it('upgrades follower db with version flag',asyncfunction(){
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.
91
+
92
+
Destructive action
93
+
You're upgrading ${addon.name} to Postgres version 15. The database will stop following DATABASE and become writable.
94
+
95
+
This cannot be undone.
96
+
`)
97
+
98
+
awaitrunCommand(Cmd,[
99
+
'--app',
100
+
'myapp',
101
+
'--version',
102
+
'15',
50
103
])
104
+
105
+
expect(stripAnsi(uxPromptStub.args[0].toString())).contains('To proceed, type myapp')
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.
130
+
131
+
Destructive action
132
+
You're upgrading ${addon.name} to the latest supported Postgres version. The database will stop following DATABASE and become writable.
133
+
134
+
This cannot be undone.
135
+
`)
70
136
71
137
awaitrunCommand(Cmd,[
72
138
'--app',
73
139
'myapp',
74
-
'--confirm',
140
+
])
141
+
142
+
expect(stripAnsi(uxPromptStub.args[0].toString())).contains('To proceed, type myapp')
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.
171
+
172
+
Destructive action
173
+
You're upgrading ${essentialAddon.name} to the latest supported Postgres version.
174
+
175
+
This cannot be undone.
176
+
`)
177
+
178
+
awaitrunCommand(Cmd,[
179
+
'--app',
75
180
'myapp',
76
-
'--version',
77
-
'9.6',
78
181
])
182
+
183
+
expect(stripAnsi(uxPromptStub.args[0].toString())).contains('To proceed, type myapp')
0 commit comments