What problem does it solve?
Serverpod data models are the foundation for type-safe serialization and ORM-backed database access, and this skill streamlines defining them in a single YAML source of truth.
Core Features & Use Cases
- Model definition in YAML (.spy.yaml): Create server and client Dart code from declarative model schemas.
- Serialization and schema generation: Generate serialization behavior, optional database tables, relations, enums, and exceptions.
- Database alignment via migrations: Ensure schema changes are propagated through the migration workflow when table definitions change.
- Common use cases: Define new entities, update fields safely for backward compatibility, add relations (one-to-one, one-to-many, many-to-many), and model custom exceptions sent to clients.
Quick Start
Update or create your model in a .spy.yaml file under your server lib/ directory, then run serverpod generate and (if tables changed) apply the corresponding migrations workflow from serverpod-migrations.