EvaE
Convex Community12mo ago
12 replies
Eva

Recommended migrations workflow for local environments

We're using the Convex migrations component and I've read through the Intro to Migrations guide—super helpful, thank you!

I'm wondering what the recommended workflow is for ensuring that migrations are run on individual developers' local environments? E.g, right now, we have an established workflow for running migrations in production, and that works fine. But once a schema change is pushed to main and pulled down to a developer's local environment, running
convex dev
will fail without the necessary migration.

In past roles, my teams have had a generic
npm run migrate
or similar function to handle running any new or un-run migrations. Can we setup Convex this way with the migrations component to prevent devs from encountering a broken schema? Bonus points if this is something that can be integrated into
predev
or
seed.ts
so they don't have to manually run a migration at all...
Convex
Framework for long running data migrations of live data.
Migrations
There are as many ways to migrate data as there are databases, but here’s some basic information to set the stage.
Intro to Migrations
Was this page helpful?