prisma: prisma migrate slow with MariaDB on Mac
Discussed in https://github.com/prisma/prisma/discussions/9840
<div type='discussions-op-text'>Originally posted by amcjen October 18, 2021
We’re running 3.2.0 and have 101 migrations. Whenever we run prisma migrate dev
to create a new migration with changes to our schema, it’s taking a really long time–like go-get-a-cup-of-coffee-and-enjoy-the-cup-of-coffee-before-it’s-done-running long.
Screenshot showing the time it took for our most recent migrate (920 seconds).
Anything we can do to mitigate this?
Trying to add a bit more context. We have 26 tables. Nothing too crazy, and no table has more than ~100 rows as this is a development db that frequently gets reset with default data from seed.
When we run npx prisma migrate reset --force
, it takes about 3.5 minutes to run all the migrations. I can watch each migration occur, and understandably, ones where CUIDs were introduced, or foreign keys were changed seem to take the longest.
However, it’s specifically npx prisma migrate dev
that takes over 15 minutes now. Since the migrations themselves only seem to take ~3 minutes, I’m not sure how to probe for what’s happening the other time during the migration.
Happy to provide additional information as needed!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (3 by maintainers)
macOS 11.6 on an M1 processor
MariaDB 10.6.4 arm64 (via Homebrew)
v16.6.2
@amcjen I just checked - we have received the schema folder. Thanks for sending it over!
The database resides on the same machine the migrations are running on, as it is a development box.
Happy to share the migrations folder and _prisma_migrations table content. Will email you directly.