deploy.release_command guaranteed to run on primary?

Was reading Fly Postgres — Fly Postgres v0.2.5 and came across:

It is safe to use MyApp.Repo.Local because on Fly.io, migrations are run in the primary region that already has direct access to the writable database.

I’m having trouble finding a source/docs for this. Is this a public guarantee?

This is not documented, it’s true. You’ll need to set PRIMARY_REGION=dfw on your app for this to work.

EDIT: This is now documented: App Configuration (fly.toml)

1 Like