Design and generate Convex database schemas with proper validation, indexes, and relationships. Use when creating schema.ts or modifying table definitions.
Design and generate Convex database schemas with proper validation, indexes, and relationships. Provides schema templates and patterns for one-to-many, many-to-many, and hierarchical relationships using ID references instead of nesting Includes validator reference for all Convex types (v.string(), v.id(), v.union(), etc.) and guidance on when to use arrays versus relational structures Covers index strategy with single-field and compound index examples for common query patterns Offers migration patterns for converting nested data structures to flat, relational designs following Convex best practices Convex Schema Builder Build well-structured Convex schemas following best practices for relationships, indexes, and validators. When to Use Creating a new convex/schema.ts file Adding tables to existing schema Designing data model relationships Adding or optimizing indexes Converting nested data to relational structure Schema Design Principles Document-Relational: Use flat documents with ID references, not deep nesting Index Foreign Keys: Always index fields used in lookups (userId, teamId, etc.) Limit Arrays: Only use arrays for small, bounded collections (<8192 items) Type Safety: Use strict validators with v.* types
don't have the plugin yet? install it then click "run inline in claude" again.