What problem does it solve?
Provide clear, production-ready guidance to design relational database schemas that are consistent, maintainable, and performant while avoiding common pitfalls like missing indexes, inconsistent naming, and unsafe migrations.
Core Features & Use Cases
- Naming and conventions: enforce snake_case tables and columns, canonical primary and foreign key patterns, and consistent index/constraint naming.
- Schema modeling: model 1:1, 1:N and explicit M:N relationships, choose between normalization and denormalization, and recommend JSON columns or STI patterns where appropriate.
- Operational rules: design indexes and composite keys, implement soft deletes and timestamps, define enums and state machines, and plan safe, non-destructive migrations for ORMs such as Prisma or Drizzle.
- Use Case: model an orders system with users, products, order_items, and product_categories including indexing, soft delete strategy, and migration steps for adding non-nullable columns.
Quick Start
Use the database-design skill to model a normalized schema for an orders system, specifying tables, primary and foreign keys, indexes, soft delete strategy, and migration steps.