What problem does it solve?
This Skill guides teams to design robust, scalable database schemas by codifying naming conventions, migration rules, and data-integrity constraints to prevent drift and regressions.
Core Features & Use Cases
- Table Design: Every table MUST have: id (primary key), created_at, updated_at; ensure consistent UUIDs or auto-incremented IDs; support soft-delete via deleted_at when ADR requires it; use plural table names and snake_case column naming.
- Relationship Patterns: One-to-Many, Many-to-Many, One-to-One, and Self-referencing relationships with clear foreign-key usage and indexing strategies.
- Index Strategy & Data Integrity: Always index foreign keys; optimize for frequent WHERE clauses; use appropriate NOT NULL and CHECK constraints; avoid over-indexing.
- Migration Rules: One migration per logical change; migrations MUST be reversible (up/down); keep schema changes separate from data migrations; validate rollback.
- Query & Data Practices: Prefer parameterized queries; avoid SELECT *; apply consistent data types and defaults to ensure data quality.
- Use Case: When starting a project, apply these conventions to produce a coherent, maintainable schema with safe, auditable migrations.
Quick Start
Apply these conventions at project start to align tables, relationships, and migrations with ADR-driven standards.