ACPixel
ACPixel
TTCTheo's Typesafe Cult
Created by ACPixel on 4/25/2023 in #questions
PlanetScale deployments when using T3, prisma, and vercel
Hey friends! I'm working on a T3 based app that I have been working on for a while now, and I'm trying to get the production environment setup. I would like to use vercel to deploy along with PlanetScale for the database, but I'm finding a lack of information on how to deal with migrations on new deployments. My ideal scenario is that when I merge anything into my main branch on GitHub, when vercel deploys the new site it also migrates any prisma schema changes to the main PlanetScale branch. However I can't seem to find any good information on how to automate this. At the moment it seems like I need to create a planetscale branch from the cli, create a deploy-request, accept that request, then merge my PR, so vercel deploys. This just doesn't seem like the "right" way to do it. Unfortunately in every prisma/planetscale video I've watched, they always explain the initial setup, but never anything about what to do after that first deployment. I did also watch Theo's FROM 0 TO PROD FOR $0 video, but unless I missed something, he's just using prisma db push before uploading his code and is also using the dev DB for local development. Ideally I would also like to have a development DB that is used for vercel preview deployments but that is something I can figure out after I figure out the correct way to deal with the main DB deployments. I feel like this is a relatively common scenario so I'm quite confused as to why I can't find any information on it, but any help would be greatly appreciated.
5 replies