starter icon indicating copy to clipboard operation
starter copied to clipboard

Initial database setup in Railway

Open alex-alecu opened this issue 6 months ago • 3 comments

What's the best practice for setting up initially the database users in Railway?

I've tried creating a service that runs only migrations, but running ... triggers the following:

ERROR: Graphile Starter must run inside of a git versioned folder.

Which makes me believe that CONFIRM_DROP=true yarn setup:db is not intended ever for the prod db

alex-alecu avatar Jul 04 '25 12:07 alex-alecu

What is Railway?

No, you should not drop in production. There are instructions on deploying to Heroku here:

https://github.com/graphile/starter#deploying-to-heroku

Deploying to other environments would have similarities.

benjie avatar Jul 04 '25 13:07 benjie

The documentation just says to use Amazon RDS, nothing about setting up the initial users, structure.

In an automated, continuous delivery environment, what's the recommendation for setting the db structure?

alex-alecu avatar Jul 04 '25 14:07 alex-alecu

After following the setup instructions following the link above, on every release you should run:

yarn db migrate

as done in our Procfile for Heroku:

https://github.com/graphile/starter/blob/0b68eabc8ed414029594f40ca7bdcd8b46e17cb6/Procfile#L3

benjie avatar Jul 04 '25 16:07 benjie