Arun Kumar
07/07/2021, 7:18 AMRyan
07/07/2021, 7:38 AMprisma migrate deploy in your QA environment to apply all the migrations.Arun Kumar
07/07/2021, 7:41 AMRyan
07/07/2021, 10:49 AMprisma migrate dev
2. After this is done, you perform prisma migrate deploy on your QA to apply all the migrations that you create on dev.
3. This same process can be done when you are deploying on Prod.Arun Kumar
07/07/2021, 10:51 AMDennis
07/08/2021, 7:35 AMRyan
07/08/2021, 7:39 AMWhen I’m correct I need for that a local database? My production database runs in a kubernetes cluster and cannot eb acessed from outsideWhich command?
Arun Kumar
07/08/2021, 10:58 AMmigrate dev on local machine and it worked fine. And on the cloud I ran the migrate deploy but it throwed an error
3 migrations found in prisma/migrations
94
Error: P3009Ryan
07/08/2021, 11:01 AMArun Kumar
07/08/2021, 7:05 PMRyan
07/09/2021, 4:50 AMlocalhost.Ryan
07/09/2021, 4:52 AMArun Kumar
07/09/2021, 5:34 AM.env was checked into source code by mistake. Just removed it and ran it again. This time it didn't pickup the db URL from git hub actions secrets.
We have separate github workflow actions YAML files for dev and qa. In that we have env: and a run: gcloud run deploy section which accepts env variables.
How to make the DATABASE_URL in the below snippet to point to the dev URL in dev env and qa URL in qa env?
Also should we setup the env DATABASE_URL in the docker file as well?
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}Ryan
07/09/2021, 5:38 AMmigrate deploy? In GitHub Actions directly or in the Dockerfile?Arun Kumar
07/09/2021, 5:47 AMRyan
07/09/2021, 5:50 AMArun Kumar
07/09/2021, 5:50 AMENV PATH /app/node_modules/.bin:$PATHRyan
07/09/2021, 6:22 AMARG in this case:
ARG DATABASE_URL
And then while building your image:
docker build --build-args DATABASE_URL=${DATABASE_URL} -t image-name .Arun Kumar
07/09/2021, 6:46 AMrun: gcloud run deploy $SERVICE_NAME --project ${{ secrets.GCP_DEV_PROJECT_ID }} --set-env-vars DATABASE_URL=${{ secrets.DEV_DATABASE_URL }} --memory 2G --min-instances 1 --image $IMAGE_NAME --region us-west1 --allow-unauthenticated --platform managedRyan
07/09/2021, 6:56 AM