database-schema-documentation by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill database-schema-documentation创建全面的数据库模式文档,包括实体关系图(ERD)、表定义、索引、约束和数据字典。
最小工作示例:
# 数据库模式文档
**数据库:** PostgreSQL 14.x
**版本:** 2.0
**最后更新:** 2025-01-15
**模式版本:** 20250115120000
## 概述
该数据库支持一个包含用户管理、产品目录、订单和支付处理的电子商务应用。
## 实体关系图
```mermaid
erDiagram
users ||--o{ orders : places
users ||--o{ addresses : has
users ||--o{ payment_methods : has
orders ||--|{ order_items : contains
orders ||--|| payments : has
products ||--o{ order_items : includes
products }o--|| categories : belongs_to
products ||--o{ product_images : has
products ||--o{ inventory : tracks
// ... (完整实现请参阅参考指南)
```
## 参考指南
`references/` 目录下的详细实现:
| 指南 | 内容 |
|---|---|
| [users](references/users.md) | users |
| [products](references/products.md) | products |
| [orders](references/orders.md) | orders |
| [order_items](references/orderitems.md) | order_items |
| [Enum Types](references/enum-types.md) | Enum Types, JSONB Structures |
## 最佳实践
### ✅ 建议
- 记录所有表和列
- 创建 ERD 图
- 记录索引和约束
- 包含示例数据
- 记录外键关系
- 展示 JSONB 字段结构
- 记录触发器和函数
- 包含迁移脚本
- 精确指定数据类型
- 记录性能注意事项
### ❌ 不建议
- 跳过约束文档
- 忘记对模式变更进行版本控制
- 忽略性能影响
- 跳过索引文档
- 忘记记录枚举值
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
每周安装量
141
仓库
GitHub 星标数
121
首次出现
Jan 21, 2026
安全审计
安装于
opencode124
gemini-cli121
codex115
claude-code114
cursor114
github-copilot103
Create comprehensive database schema documentation including entity relationship diagrams (ERD), table definitions, indexes, constraints, and data dictionaries.
Minimal working example:
# Database Schema Documentation
**Database:** PostgreSQL 14.x
**Version:** 2.0
**Last Updated:** 2025-01-15
**Schema Version:** 20250115120000
## Overview
This database supports an e-commerce application with user management, product catalog, orders, and payment processing.
## Entity Relationship Diagram
```mermaid
erDiagram
users ||--o{ orders : places
users ||--o{ addresses : has
users ||--o{ payment_methods : has
orders ||--|{ order_items : contains
orders ||--|| payments : has
products ||--o{ order_items : includes
products }o--|| categories : belongs_to
products ||--o{ product_images : has
products ||--o{ inventory : tracks
// ... (see reference guides for full implementation)
```
## Reference Guides
Detailed implementations in the `references/` directory:
| Guide | Contents |
|---|---|
| [users](references/users.md) | users |
| [products](references/products.md) | products |
| [orders](references/orders.md) | orders |
| [order_items](references/orderitems.md) | order_items |
| [Enum Types](references/enum-types.md) | Enum Types, JSONB Structures |
## Best Practices
### ✅ DO
- Document all tables and columns
- Create ERD diagrams
- Document indexes and constraints
- Include sample data
- Document foreign key relationships
- Show JSONB field structures
- Document triggers and functions
- Include migration scripts
- Specify data types precisely
- Document performance considerations
### ❌ DON'T
- Skip constraint documentation
- Forget to version schema changes
- Ignore performance implications
- Skip index documentation
- Forget to document enum values
Weekly Installs
141
Repository
GitHub Stars
121
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode124
gemini-cli121
codex115
claude-code114
cursor114
github-copilot103
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
116,600 周安装