database-schema

40docs's avatarfrom 40docs

Use when working with database models or migrations. Contains schema documentation and relationship patterns.

⭐0stars🔀0forks📁View on GitHub🕐Updated Dec 10, 2025

When & Why to Use This Skill

This Claude skill streamlines database management and architectural consistency by providing a centralized reference for schema documentation and relationship patterns. It ensures that developers adhere to project-specific conventions, such as UUID primary keys, soft-delete logic, and standardized model inheritance, significantly reducing errors during migrations and new model definitions.

Use Cases

  • Designing new database models: Automatically apply project conventions like BaseModel inheritance and mandatory timestamp fields when creating new entities.
  • Database Migrations: Reference existing schema patterns to ensure new migrations are compatible with the current architecture and relationship logic.
  • Relationship Mapping: Implementing complex foreign key relationships (e.g., one-to-many) using pre-defined Pythonic patterns to maintain data integrity.
  • Technical Documentation: Serving as a 'Quick Reference' for developers to verify table structures and field types without manually searching through large SQL files.
namedatabase-schema
descriptionUse when working with database models or migrations. Contains schema documentation and relationship patterns.

Database Schema Skill

Quick Reference

See references/schema.md for the complete schema.

Model Conventions

  • All models inherit from BaseModel
  • Use UUID for primary keys
  • Include created_at and updated_at timestamps
  • Soft delete via is_active flag

Relationship Pattern

class Pet(BaseModel):
    shelter_id = Column(UUID, ForeignKey('shelters.id'))
    shelter = relationship('Shelter', back_populates='pets')

When creating new models, always check references/schema.md first.