Issue
When using heroku addons:detach
command, for example: heroku addons:detach HEROKU_POSTGRESQL_BRONZE --app sushi
It is failing with the below error:
HEROKU_POSTGRESQL_BRONZE --app sushi
Detaching HEROKU_POSTGRESQL_BRONZE to postgresql-contoured-xxxxx from ⬢ sushi... !
▸ Cannot destroy last attachment to billing app for resource postgresql-contoured-xxxx
Resolution
-
You can only use the
addons:detach
command for addons which have been attached to an app withheroku addons:attach
. -
heroku addons:attach
is only used for attaching add-ons which have already been provisioned to another app. i.e they are still billed against the original app and are available to be used by both apps. -
If you want to delete this addon/database you should use
heroku addons:destroy
. -
You can read more about this here: Attaching an add-on to another app