What problem does it solve?
This Skill automates the creation and optimization of PostgreSQL models using Sequelize, reducing boilerplate and errors in model definitions.
Core Features & Use Cases
- Model definition patterns for Sequelize with PostgreSQL, including primary keys, data types, field mappings, and sensible defaults.
- Association patterns (hasMany, belongsToMany, hasOne) with through tables and foreign keys to illustrate one-to-many, many-to-many, and one-to-one relationships.
- Validations, hooks, scopes, and indexing best practices to ensure data integrity and performant queries.
- Practical use cases for common domain models (e.g., User, Post, Comment) with guidance on migrations and naming conventions.
Quick Start
Define a Sequelize User model with fields id, email, firstName, lastName, status, and metadata, enable underscored naming, timestamps, and basic validations; then demonstrate a hasMany association to an Order model and a compound index on status and createdAt.