3 months ago
I have pnpm run db:migrate in pre-deploy that runs my migrations created with drizzle. It only has one migration currently.
But it doesn't create any tables.
7 Replies
3 months ago
Link to the deployment please?
I managed to fix it with a workaround. When i have pnpm run db:migrate && pnpm run start in Custom Start Command then it works fine. Migrations are applied and service runs as expected.
When put pnpm run db:migrate into Pre-deploy command then my migrations are not applied.
I can recreate it for you if needed, let me know.
Actually, that only worked when i regenerated my migrations locally and then pushed them up. That triggered railway build and it worked fine - it created the tables in db and backend was started. But then when I deleted my tables and redeployed it didn't build the backend because tables are missing.
3 months ago
Your pre-deploy failing wouldn't be a platform issue so I'll pass this thread onto the community.