Closed ehmatthes closed 10 months ago
This should be simpler to fix after working through Fly deployments, #263. We'll call heroku create
, and look for a db. If it doesn't exist, we'll create one.
heroku addons
to see what's created for me (I'm guessing a mini postgres, because of my older heroku account that still qualifies for auto provisioning a db).% heroku create
Creating app... done, ⬢ desolate-shore-27436
https://desolate-shore-27436-3a63a9188e3c.herokuapp.com/ | https://git.heroku.com/desolate-shore-27436.git
(.venv) eric@Erics-Mac-Studio dsd-dev-project_pg1o3 % heroku addons
No add-ons for app desolate-shore-27436.
This looks like I'm not getting a db auto-provisioned.
git push heroku main
.remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 33.6M
remote: -----> Launching...
remote: ! The following add-ons were automatically provisioned: heroku-postgresql. These add-ons may incur additional cost, which is prorated to the second. Run `heroku addons` for more info.
Postgres database was auto-provisioned:
% heroku addons
Add-on Plan Price Max Price State
────────────────────────────────────────── ──── ──────────── ───────── ───────
heroku-postgresql (postgresql-curly-63375) mini ~$0.007/hour $5/month created
└─ as DATABASE
The table above shows add-ons and the attachments to the current app (pacific-sands-48013) or other apps.
heroku create
, then create a db. Will it auto-provision a second, redundant db? (Do this with a manual push from a dev project.)remote: -----> Compressing...
remote: Done: 33.6M
remote: -----> Launching...
remote: ! The following add-ons were automatically provisioned: . These add-ons may incur additional cost, which is prorated to the second. Run `heroku addons` for more info.
remote: Released v8
Does not auto-provision a db if it finds an existing one. This is confirmed by running heroku addons
again after the push, and finding just the one db that I manually created.
heroku addons:create heroku-postgresql
idempotent? Try this. (It is not idempotent; makes sense, can use two dbs for a single app.) % heroku create
Creating app... done, ⬢ polar-ocean-42915
https://polar-ocean-42915-4c1ec37e8ebe.herokuapp.com/ | https://git.heroku.com/polar-ocean-42915.git
(.venv) eric@Erics-Mac-Studio dsd-dev-project_pg1o3 % heroku addons
No add-ons for app polar-ocean-42915.
(.venv) eric@Erics-Mac-Studio dsd-dev-project_pg1o3 % heroku addons:create heroku-postgresql:mini
Creating heroku-postgresql:mini on ⬢ polar-ocean-42915... ~$0.007/hour (max $5/month)
Database has been created and is available
! This database is empty. If upgrading, you can transfer
! data from another database with pg:copy
Created postgresql-lively-93073 as DATABASE_URL
Use heroku addons:docs heroku-postgresql to view documentation
(.venv) eric@Erics-Mac-Studio dsd-dev-project_pg1o3 % heroku addons:create heroku-postgresql:mini
Creating heroku-postgresql:mini on ⬢ polar-ocean-42915... ~$0.007/hour (max $5/month)
Database has been created and is available
! This database is empty. If upgrading, you can transfer
! data from another database with pg:copy
Created postgresql-clear-50368 as HEROKU_POSTGRESQL_BLACK_URL
Use heroku addons:docs heroku-postgresql to view documentation
(.venv) eric@Erics-Mac-Studio dsd-dev-project_pg1o3 % heroku addons
Add-on Plan Price Max Price State
─────────────────────────────────────────── ──── ──────────── ───────── ───────
heroku-postgresql (postgresql-clear-50368) mini ~$0.007/hour $5/month created
└─ as HEROKU_POSTGRESQL_BLACK
heroku-postgresql (postgresql-lively-93073) mini ~$0.007/hour $5/month created
└─ as DATABASE
The table above shows add-ons and the attachments to the current app (polar-ocean-42915) or other apps.
heroku create
and heroku addons:create heroku-postgresql:mini
. apps:info
, look for postgres db; create one if it doesn't exist. (Assume this is the only add-on?)create
call, if a database doesn't already exist.I haven't tested any of these on Linux in a while. Let's start here.
heroku open
doesn't work, but maybe a configuration issue on my end?)heroku login
to work.
Heroku only auto-provisions a Postgres db for users whose accounts were created before 5/15/23. This means deployments will fail for anyone with a new Heroku account:
Task list