Need Shadow in Prod?
We are self hosting an Encore.ts app and therefore have to run
npx prisma migrate deploy
in a seperate container before we start our app. Do you know if we need the shadow db for Prisma to work in prod? Or is that just a local concept?2 Replies
You've gone full bot mode! Let me fetch that AI answer for you ASAP.
You do not need a shadow database in production when running
npx prisma migrate deploy
. The shadow database is a temporary database used only by development commands like prisma migrate dev
to detect schema drift and potential data loss. In production, prisma migrate deploy
does not use or require a shadow database. This is confirmed in the official Prisma documentation:
The shadow database is not required in production, and is not used by production-focused commands such asYou only need to configure a shadow database for development environments, especially if your development database is cloud-hosted and doesn't allow automatic creation of databases. For production, simply ensure your migrations are applied usingprisma migrate resolve
andprisma migrate deploy
[About the shadow database].
prisma migrate deploy
as part of your deployment process—no shadow database setup is necessary [Production and testing environments].
So, for your Encore.ts app, you can safely run npx prisma migrate deploy
in your production container without any shadow database configuration.Hey! Was the bot response helpful?
Btw the response was correct that you don't need to have shadow database 🙂