5 Replies
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. If this is a support-related question, please create a post in #support-community. If not, carry on! Thanks!
One simple answer: always use returns validator and args validators, and never remove fields. Only add or expand options (like making fields unions or optional).
Thanks for the tips
Is it a good to approach to make all fields in your database scheme optional?
Database schemas have different best practices than functions/apis.
Because you have full control over the database (vs. who calls your functions), ideally, you should try to have the most restrictive schema possible. This will prevent you from having code that checks if the field exists everywhere.
You can always run migrations over your data to clean it up to a good place: https://www.convex.dev/components/migrations
Thanks again!