set up railway pr environment to use staging environment db
jeffreyq
PROOP

2 months ago

set up railway pr environment to use staging environment db

Solved$20 Bounty

Pinned Solution

Project settings > Environments > Enable PR environments and set the PR environment to use staging.

7 Replies

Project settings > Environments > Enable PR environments and set the PR environment to use staging.


jeffreyq
PROOP

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


Yes, this is a completely separate environment.


jeffreyq
PROOP

2 months ago

Is it possible to have this separate PR environment "talk to" the mysql db service in my staging environment?


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.


jeffreyq
PROOP

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


You can use the public API (https://railway.com/graphiql) to set environment variables.


Status changed to Solved noahd about 2 months ago


Loading...