

If you’re like me, you use something like Postico or another Postgres GUI. Release_command = "./node_modules/typeorm/cli.js migration:run" We updated our deployment script by adding a deploy param to our fly.toml file: We previously ran migrations by connecting to the publicly accessible database url and running the migrations command over the wire. We did a lot of testing before hand on staging databases. Make sure you have a PR or deployment ready with these changes.


If you had extra config params like ssl: true, rejectUnauthorized: false make sure you remove those too.įly Postgres doesn’t need SSL since its shielded from the public internet, which means all the fancy things Heroku requires us to do are no longer necessary. If you had ?sslmode=true&pgsslmode=require in your connection string, remove it. Since Heroku Postgres has a publicly-accessible URL, there have always been extra SSL settings you had to add to your ORM config or connection string. If you have certain extension errors you need to install, we didn’t have to do that so you’re on your own. Make sure you look through the logs and confirm you don’t need to make a change. If you have less than 10gb of data, it should only take a couple minutes. The script can take anywhere from a couple minutes to hours depending on the size of your database. Once this is provisioned, you should be able to run the migration script: fly ssh console -C "migrate" -a postgres-migration You can leave off the database name and the dump will create it for you.
CONNECTING TO POSTICO HEROKU UPDATE
Make sure you update all values appropriately. To create your postgres database, run the following command. We recently successfully migrated away from Heroku Postgres to Fly Postgres.
