Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove addon when attached with multiple names on Heroku?

Tags:

heroku

We're migrating some things around and needed to attach the same database using two different environment variables temporarily. Now that we migrated, I would like to remove the attachment, but sadly, the Heroku command-line client says that I have an ambiguous identifier:

$ heroku addons --app $APP_SOURCE

Add-on                                                          Plan         Price     State
──────────────────────────────────────────────────────────────  ───────────  ────────  ───────
heroku-postgresql (...)                    hobby-basic  $9/month  created
 ├─ as DATABASE
 ├─ as HEROKU_POSTGRESQL_ORANGE
 ├─ as DATABASE on stb-crds-rails-sf app
 ├─ as SHARETHEBUS_RAILS_DATABASE on stb-crds-rails-sf app
 └─ as SHARETHEBUS_RAILS_DATABASE_URL on stb-crds-rails-sf app


$ heroku addons:detach --app stb-crds-rails-sf $ADDON_NAME
 ▸    Ambiguous identifier; multiple matching attachments found: DATABASE, SHARETHEBUS_RAILS_DATABASE, SHARETHEBUS_RAILS_DATABASE_URL.

I tried also tried heroku addons:detach --app stb-crds-rails-sf $ADDON_NAME --as SHARETHEBUS_RAILS_DATABASE_URL and heroku addons:detach --app stb-crds-rails-sf $ADDON_NAME SHARETHEBUS_RAILS_DATABASE_URL, but the command-line says the last arguments are unexpected.

What are our options to remove the extra addons?

like image 608
François Beausoleil Avatar asked Sep 16 '25 23:09

François Beausoleil


1 Answers

Turns out you can use the variable name instead of the addon name:

$ heroku addons:detach SHARETHEBUS_RAILS_DATABASE_URL
like image 150
François Beausoleil Avatar answered Sep 21 '25 03:09

François Beausoleil