How do you handle creating migrations in different...
# orm-help
c
How do you handle creating migrations in different feature branches simultaneously? If I create a migration in one feature branch, then create another branch from main and try creating another migration, I get an error saying there are missing migration files and the database needs to be reset. Then things go downhill from there....
1
f
Hey Chris, the current workflow needs a reset of the development DB when moving between branches so Migrate can apply the migration history to a pristine db schema. Would you be able to set up your dev environment in a way that resetting + seeding can happen when switching branches?
c
That's what I've been doing so far but it feels like more of a workaround than a workflow. I haven't tried Planetscale yet (using Postgres for this project) but I wonder if it makes this type of thing easier?
f
With PS you would not create a local migration history but instead base migrations entirely on the DB side of things. To bring your schema to PS you’d exclusively use
db push
j
Just a heads up, used both Postgres and PS in production with Prisma and from my experience using Postgres and a good seed script is much easier than using PlanetScale. The workflow of using
db push
with PS isn’t very nice and it’s harder to keep track of migrations
👍 1
c
I've read about at least one "PlanetScale for Postgres" service but can't remember any names, anyone know? I wonder if that would be a "best of both worlds" option.
f
Chris, what kind of multi branch workflow would you prefer?
c
Excellent question, I guess my desire is to be able to switch between branches without having to reset the database, but I'd have to think about how that could happen.
👍 1