Replies: 1 comment 1 reply
-
Hi @pizza7311 👋 Using Prisma Migrate can help solve this problem. Prisma Migrate is a database schema migration tool that enables you to keep your database schema in sync with your Prisma schema, and version control for your database schema. When you make changes to your Prisma schema, you can generate a new migration with Prisma Migrate. This migration can be committed to your version control system (like Git), allowing your teammates to pull the changes and apply the migration to their local databases. This way, each teammate's changes can be applied sequentially without overwriting each other's work. Here's a basic workflow for incorporating changes from collaborators:
Migrations are applied in the same order as they were created. The creation date is part of the migration subfolder name - for example, Please note that this guide does not apply for MongoDB. Instead of |
Beta Was this translation helpful? Give feedback.
-
Question
Hello. i am using mysql with prisma while developing with my team.
Our team uses one database to develop each feature. and only uses
prisma db push
to synchronize schema.The problem is when each teammates are pushing schema to database previous works is overwritten
For example here's the original schema.
and teammates make each other's branches and update schema
this is my schema
and this is team's schema
If i push the schema, prisma will create a new table. after that, my teammate finish his work and push schema to database and my works will overwritten. i haven't used
prisma migration dev
, but can migration solve this problem? or there's any other solution?Beta Was this translation helpful? Give feedback.
All reactions