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.
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 runningprisma2 generate
and DB for runningprisma2 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.