docs icon indicating copy to clipboard operation
docs copied to clipboard

Strategy to avoid duplication in version controlling migrations

Open tvvignesh opened this issue 6 years ago • 2 comments

Hi. In the microservices setup I have, so far, I have been having the migrations generated and kept along with my service code. But, to have better separation of concerns and have a proper CI/CD pipeline, I want to separate out the service as well as the database migrations to 2 repos.

The only problem I have is that, both the service and the database uses schema.prisma file. Service for running prisma2 generate and DB for running prisma2 migrate and thus, if I change the schema.prisma file, I have to change in 2 places leading to duplication and possible mistakes.

Is there any way to avoid this or any better strategy to separate it? With service in 1 repo and migrations in another repo with their own CI/CD pipelines.

tvvignesh avatar Jan 23 '20 18:01 tvvignesh

Moving to prisma/prisma repo since this is a product question about schema modularity.

tomhoule avatar Nov 05 '20 10:11 tomhoule

We believe this should be solved with tooling and probably we could have some best practices documented around that.

floelhoeffel avatar Feb 17 '22 10:02 floelhoeffel