We have a problem with Prisma regarding the migrat...
# orm-help
o
We have a problem with Prisma regarding the migration processes, it seems as if
prisma migrate deploy
command doesn't actually migrate the data in the production unless we run the
prisma migrate dev
first and generated the local migrations folder; Is this behavior normal? If not, what some other ways we can migrate the data at deployment without migrating in development the second problem , when we run command
npx prisma migrate dev
it gives the following errors (The database server at `<url>`:`5432` was reached but timed out. ) however we increase connection limit and pool , but when we run command
npx prisma db push
, schema changed and applied without any problem .
πŸ‘ 1
r
@Omar Ghanim πŸ‘‹
prisma migrate deploy
needs migration files for it to work so you cannot run
deploy
without setting up migrations in development using
migrate dev
. This goes for any migration library where you need to create migrations in development and apply them in deployment. As for the second point, where exactly is your database hosted? Make sure that the development database is in the same geographic location from where you’re working to minimise latency.
βœ… 1
πŸŽ‰ 1
j
(If you just want to get the database to be the same as your Prisma Schema file, you can use
prisma db push
- but that is a very big hammer. In production you really do not want to use that but have migration files you checked, and then
deploy
these)
πŸŽ‰ 1
βœ… 1
o
thank you very much .. it's really helpful and works for me
πŸ’― 1
πŸ™Œ 1