2 months ago
set up railway pr environment to use staging environment db
Pinned Solution
2 months ago
Project settings > Environments > Enable PR environments and set the PR environment to use staging.
7 Replies
2 months ago
Project settings > Environments > Enable PR environments and set the PR environment to use staging.
2 months ago
It seems to create a completely new db deployment with a separate volume.
For example, on my staging env my volume contains 6GB
On the PR env it's using a different volume that's 1 GB
Attachments
2 months ago
Is it possible to have this separate PR environment "talk to" the mysql db service in my staging environment?
2 months ago
No. They're in separate environments for a reason.
You can, however, use the public URL from the MySQL database service but you'd be charged egress fees. But if something were to go wrong in your staging environment, you should hope that your prod database is still working fine.
2 months ago
is it possible to automatically set the generated PR environment to use the public URL from the MySQL database service of my primary staging environment?
basically trying to avoid having to copy over an entire staging db just for a PR env
2 months ago
You can use the public API (https://railway.com/graphiql) to set environment variables.
Status changed to Solved noahd • about 2 months ago