how does one automatically migrate db without pre-deploy actions?
Am using github branch auto deploy and just bumped into this post https://help.railway.app/feedback/pre-and-post-deployment-actions-2c2a4b35. Realised there's no way to run
db:migrate
command. Why is something fundamental like this not taken care of? Is there a workaround?11 Replies
Project ID:
N/A
run
db:migrate
in your start commandwhat if i have multiple server replicas? i have to make sure db:migrate command is guarding against concurrent db:migrate run?
have a single service do the migrations
you would have your main app service with all its replicas, and another migrator service that does the migrations and exits
is there a way to ensure this single service runs db migrate first? only then deploy the others with the auto deploy? i guess can only be done via github actions with railway cli?
railway does not have a way to define what services run first
i have seen software have a wait for migrations job thats runs before the app starts
i guess i probably reading the wrong doc https://docs.railway.app/reference/deployments can't seem to find the deployment order thing
there is no way to define deployment order at this time
railway does have a way to define what services run firstwhat's this referring to?
im so sorry
bad typo, my bad
oh ok... thx