How to change databases in an suspended app?

I was looking to take advantage of the new free tier postgres in a little hobby project. My plan was to suspend the app, run fly secrets unset DATABASE_URL, then attach the new free tier of DB.

Unfortunately I can’t unset the secret while an app is suspended.

❯ fly secrets unset DATABASE_URL                    
Error App 'my-app' is currently suspended. Suspended apps do not accept secret changes.

Changing it live fails, because the app blows up (and the deployment rollsback) when there isn’t a database present.

1 Like

Hi @josephl

You could try scaling to 0 instead of suspending your app. This should work as it’ll just do a release of 0 containers.

2 Likes

Thanks!