insats
insats2w ago

How do I run schema migrations for everyone in my team's dev env?

According to the official documentation for migrations, we're supposed to modify schema, then migrate, then modify schema again:
1. Modify your schema to allow old and new values. Typically this is adding a new optional field or marking a field as optional so it can be deleted. As part of this, update your code to handle both versions. 2. Define a migration to change the data to the new schema. 3. Push the migration and schema changes. 4. Run the migration(s) to completion. 5. Modify your schema and code to assume the new value. Pushing this change will only succeed once all the data matches the new schema. This is the default behavior for Convex, unless you disable schema validation.
To me, this seems extremely tedious and it seems it will require every team member to go through the process for their individual dev environments as well. It's also not clear how I'm supposed to commit such changes to the codebase, unless I make a step-by-step commit process where my team members check out each commit and perform the steps necessary. I'm coming from other systems such as migrate-mongo and realmdb where migrations are much simpler. Is it really this complicated or have I misunderstood it?
1 Reply
Convex Bot
Convex Bot2w ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!

Did you find this page helpful?