database-schema

40docs 的头像作者 40docs

处理数据库模型或迁移时使用。包含模式文档和关系模式。

📖 中文导读:处理数据库模型或迁移时使用。包含模式文档和关系模式。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: database-schema description: Use 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.