Migrations taking too long
Hi,
I'm rewriting this since I think I may have written in the wrong channel, sorry.
I've followed the instruction to create a baseline migration as shown here: https://www.prisma.io/docs/orm/prisma-migrate/getting-started
This works good but now when I try to create a new migration it takes forever (~15 mins) to run (pnpm exec prisma migrate dev --name testing)
I have to say that the database is around 70 tables and is running in a docker container using the official mysql image.
Info regarding Prisma:
Attached additional screenshot.
Thank you very much
Getting started with Prisma Migrate | Prisma Documentation
Learn how to migrate your schema in a development environment using Prisma Migrate.
7 Replies
Hello @zaloster 👋
Have you tried squashing your migrations?
It should be helpful in reducing the time taken for generating a new migration
https://www.prisma.io/docs/orm/prisma-migrate/workflows/squashing-migrations#creating-a-clean-history-in-a-production-environment
Squashing migrations | Prisma Documentation
How to squash multiple migration files into a single migration
hi Nurul, thanks for replying. The thing is that there is not mucha to squash. There is only the initial sql file with the 70 table schemas.
Oh! I thought you had a long list of migrations which might be causing this delay.
that one was resolved using
npx prisma migrate resolve --applied 0_init
no, just starting using it with an existing database
I was able to find a related GitHub Issue:
https://github.com/prisma/prisma/issues/22092
I believe you are reporting the same behaviour
GitHub
prisma migrate dev
very slow even after squash of migrations · Is...Bug description Hi we have a fairly large model (~150 tables & ~1800 columns) and we decided to squash our migrations in the hope of having some speed improvements. But still the the prisma mig...
Can you run this command and share the time you are observing?
This is the output
DEBUG="prisma:migrate*" pnpm exec prisma migrate dev --skip-generate
Using pnpm just in case it matters