9 months ago
I copied this hono/bun/postgres/drizzle template locally https://railway.app/template/hIiRi5 and renamed and cloned the repo locally. How do I run the db migrations/seeding locally using railway up commands?
railway up bun run db:generate
does not work but if I copy the public db url to a .env file, I'm able to connect to the db via my CLI.
0 Replies
9 months ago
projectID: a2ca1487-d15e-47b9-9817-8cf2ec0824f7
9 months ago
you have to use railway run not railway up, railway up deploys
For example
railway run npm start
9 months ago
yep still running into an error.
railway run bun run dev
$ bun run --watch src/index.ts
Started server http://localhost:3000
40 | res = resolve
41 | rej = reject
42 | }).catch((err) => {
43 | // replace the stack trace that leads to `TCP.onStreamRead` with one that leads back to the
44 | // application that created the query
45 | Error.captureStackTrace(err)
^
ECONNREFUSED: Failed to connect
errno: 8
syscall: "connect"
at /Users/artivilla/Documents/figma-extensions/print-shop-server/node_modules/pg-pool/index.js:45:11
at processTicksAndRejections (native:1:1)
im 'not sure how to make my server service connect to the db service.
9 months ago
if the server is running locally i can still make it point to the same public postgres db yeah?
9 months ago
you would indeed need to use the public database URL when developing locally
9 months ago
so my guess is you have to create a .env file and set to DATABASEURL manually to DATABASEPUBLIC_URL. you can't do railway run here
9 months ago
correct
9 months ago
ty! getting a hang of this thing. already getting my friends on it.
9 months ago
love to hear that!