Best Practices - Next JS Vercel Deployements with Supabase
Currently I'm thinking of having 3 environments, vercel has the idea of preview, staging, production:
- app-preview (used for localhost development & vercel preview builds)
- app-staging (main branch)
- app-production (production branch)
- make necessary database changes on localhost / docker
- create preview pr -> open pr instantly triggers deploy to preview db
- merge database pr -> triggers deploy to staging db
- build application logic making use of the database change
- create pr.....merge... deploy
- Does it make sense to even deploy preview changes on PR open? I notice the migration files can get pretty messy if you accidentally make a mistake. create table -> drop table -> create table.
- Is it common to have 100s or 1000s of migration files?
- Is anyone already doing this? Any tips of tricks for connecting supabase to vercel deployments?