I’m migrating our API from heroku to Fly. I dockerized the app and now I need to get the app to run any pending migrations after a new release is deployed.
I saw that you could add something like this
[deploy]
release_command = "yarn run migrate-schema"
in the fly.toml file. Only “issue” is that this app hasn’t been created using a fly.toml file. Is there any way to run that command using flyctl?
What I mean is that I created the app using flyctl apps create --app xxxxx --org yyyy and a fly.toml did not get generated.
By the looks of it, I can just add fly ssh console -a xxxxxxx -C "yarn run migrate-schema" to my CI after the flyctl deploy command and migrations should run. Thank you so much for this!
Got it. Usually, the starter command would be fly launch which generates everything for you.
Since you already have an app you can get the fly.toml by running fly config save -a your-app-name then feel free to commit it. When you have that toml on the current working directory you don’t need to put -a app-name on commands anymore