diff --git a/commands/fdwsql.js b/commands/fdwsql.js index f6e149f..3e129c8 100644 --- a/commands/fdwsql.js +++ b/commands/fdwsql.js @@ -37,7 +37,7 @@ function * run (context, heroku) { const db = yield pg.fetcher(heroku).database(app, database) const addon = yield pg.fetcher(heroku).addon(app, database) - yield util.ensureNonStarterPlan(addon) + yield util.ensureEssentialTierPlan(addon) cli.log('CREATE EXTENSION IF NOT EXISTS postgres_fdw;') cli.log(`DROP SERVER IF EXISTS ${prefix}_db;`) cli.log(`CREATE SERVER ${prefix}_db diff --git a/commands/stats_reset.js b/commands/stats_reset.js index 23063e8..c6034e6 100644 --- a/commands/stats_reset.js +++ b/commands/stats_reset.js @@ -10,7 +10,7 @@ function * run (context, heroku) { const { database } = context.args const db = yield pg.fetcher(heroku).addon(app, database) - yield util.ensureNonStarterPlan(db) + yield util.ensureEssentialTierPlan(db) const host = pg.host(db) const rsp = yield heroku.put(`/client/v11/databases/${db.name}/stats_reset`, { host }) cli.log(rsp.message) diff --git a/commands/user_connections.js b/commands/user_connections.js index 4cf74c4..e5f6d03 100644 --- a/commands/user_connections.js +++ b/commands/user_connections.js @@ -11,7 +11,7 @@ function * run (context, heroku) { const { database } = context.args const db = yield pg.fetcher(heroku).addon(app, database) - yield util.ensureNonStarterPlan(db) + yield util.ensureEssentialTierPlan(db) const host = pg.host(db) const credentials = yield heroku.get(`/postgres/v0/databases/${db.name}/credentials`, { host: host }) diff --git a/lib/util.js b/lib/util.js index da42da5..539038e 100644 --- a/lib/util.js +++ b/lib/util.js @@ -19,9 +19,9 @@ You can install it by running: } } -function * ensureNonStarterPlan (db) { - if (db.plan.name.match(/(dev|basic)$/)) { - throw new Error('This operation is not supported by Hobby tier databases.') +function * ensureEssentialTierPlan (db) { + if (db.plan.name.match(/(dev|basic|essential-[0-9]+)$/)) { + throw new Error('This operation is not supported by Essential-tier databases.') } } @@ -41,6 +41,6 @@ function * newTotalExecTimeField (db) { module.exports = { ensurePGStatStatement: co.wrap(ensurePGStatStatement), - ensureNonStarterPlan: co.wrap(ensureNonStarterPlan), + ensureEssentialTierPlan: co.wrap(ensureEssentialTierPlan), newTotalExecTimeField: co.wrap(newTotalExecTimeField) }