Suggestions in reducing the number of migration files #24101
Unanswered
lilingxi01
asked this question in
Q&A
Replies: 1 comment
-
Hi @lilingxi01 👋 You can squash multiple migration files into a single migration. This can be useful in a scenario like yours where you have many small and frequent changes to the database schema during development. Squashing migrations can help avoid unnecessary intermediate steps in the final migration history that will be pushed. Kindly look at this section of the docs for migrating cleanly from a development environment. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
When developing the database, we run
prisma migrate dev --name a_sample_name
every time we want to make some modifications. Sometimes we can have 20+ modifications on a table as data complexity grows. This ends up getting us a bunch of folders in/prisma/migrations
. Any suggestions in avoiding having too many migration folders? Any method to combine multiple dev migrations into one before deploying to prod? Or is this an optimal approach?Context: we use
prisma migrate
instead ofprisma db push
because we use CI for automatically deploying schema to production database.Thank you!
Beta Was this translation helpful? Give feedback.
All reactions