#updating Schema: Schema validation failed
4 messages · Page 1 of 1 (latest)
The issue you see is that your existing data doesn't have the field, so it can't be required (yet). Options are to delete the invalid documents or update them.
The steps to update them look like:
- Make it optional and push
- Set a value for all documents
- Make it required
Related posts: https://stack.convex.dev/intro-to-migrations
https://stack.convex.dev/migrating-data-with-mutations
If you don't care about correctness while developing and want to just push the schema and update them manually on the dashboard, you can set schemaValidation: false in your schema definition, then push, update the data, then optionally turn schema validation back on.