Database Schema Documentation Table of Contents - Overview - When to Use - Quick Start - Reference Guides - Best Practices Overview Create comprehensive database schema documentation including entity relationship diagrams (ERD), table definitions, indexes, constraints, and data dictionaries. When to Use - Database schema documentation - ERD (Entity Relationship Diagrams) - Data dictionary creation - Table relationship documentation - Index and constraint documentation - Migration documentation - Database design specs Quick Start Minimal working example: mermaid erDiagram users ||--o{ orders :…

);\n\nALTER TABLE users\n ADD CONSTRAINT users_name_length\n CHECK (length(name) >= 2);\n```\n\n**Triggers:**\n\n```sql\n-- Update updated_at timestamp\nCREATE TRIGGER update_users_updated_at\n BEFORE UPDATE ON users\n FOR EACH ROW\n EXECUTE FUNCTION update_updated_at_column();\n```\n\n**Sample Data:**\n\n```sql\nINSERT INTO users (email, password_hash, name, email_verified)\nVALUES\n ('[email protected]', '$2b$12$...', 'John Doe', true),\n ('[email protected]', '$2b$12$...', 'Jane Smith', true);\n```\n\n---\n","content_type":"text/markdown; charset=utf-8","language":"markdown","size":2133,"content_sha256":"23e3dcb8e41b87de53bd33f5eff76b700b476e17d0bd2c69e2b89c50af4541a6"},{"filename":"scripts/validate-schema.sh","content":"#!/bin/bash\n# validate-schema.sh - Validate database schema\n# Usage: ./validate-schema.sh \u003cschema_file>\n\nset -euo pipefail\n\nSCHEMA_FILE=\"${{1:?Usage: $0 \u003cschema_file>}}\"\n\necho \"Validating schema: $SCHEMA_FILE\"\n\n# TODO: Add schema validation\n# - Check SQL syntax\n# - Verify foreign key references\n# - Check index definitions\n# - Validate naming conventions\n# - Check for missing constraints\n\necho \"Schema validation complete.\"\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":426,"content_sha256":"df4a785e3b4a890051c6095dd2238f29c149a91cf555c7cedffc0edc52b322bc"},{"filename":"templates/migration-template.sql","content":"-- Migration: [description]\n-- Created: [date]\n\n-- TODO: Customize for your migration framework\n\nBEGIN;\n\n-- Up migration\n-- TODO: Add schema changes\n-- CREATE TABLE IF NOT EXISTS ...\n-- ALTER TABLE ...\n\n-- Down migration (rollback)\n-- TODO: Add rollback statements\n-- DROP TABLE IF EXISTS ...\n\nCOMMIT;\n","content_type":"text/plain; charset=utf-8","language":"sql","size":302,"content_sha256":"f339b5b9269e9c6311faf330bf50143d2e10457b1126c3ba80df01d1d0c5b641"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"Database Schema Documentation","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Table of Contents","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Overview","type":"text","marks":[{"type":"link","attrs":{"href":"#overview","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"When to Use","type":"text","marks":[{"type":"link","attrs":{"href":"#when-to-use","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Quick Start","type":"text","marks":[{"type":"link","attrs":{"href":"#quick-start","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Reference Guides","type":"text","marks":[{"type":"link","attrs":{"href":"#reference-guides","title":null}}]}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Best Practices","type":"text","marks":[{"type":"link","attrs":{"href":"#best-practices","title":null}}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Overview","type":"text"}]},{"type":"paragraph","content":[{"text":"Create comprehensive database schema documentation including entity relationship diagrams (ERD), table definitions, indexes, constraints, and data dictionaries.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"When to Use","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Database schema documentation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"ERD (Entity Relationship Diagrams)","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Data dictionary creation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Table relationship documentation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Index and constraint documentation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Migration documentation","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Database design specs","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Quick Start","type":"text"}]},{"type":"paragraph","content":[{"text":"Minimal working example:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"markdown"},"content":[{"text":"# Database Schema Documentation\n\n**Database:** PostgreSQL 14.x\n**Version:** 2.0\n**Last Updated:** 2025-01-15\n**Schema Version:** 20250115120000\n\n## Overview\n\nThis database supports an e-commerce application with user management, product catalog, orders, and payment processing.\n\n## Entity Relationship Diagram\n\n```mermaid\nerDiagram\n users ||--o{ orders : places\n users ||--o{ addresses : has\n users ||--o{ payment_methods : has\n orders ||--|{ order_items : contains\n orders ||--|| payments : has\n products ||--o{ order_items : includes\n products }o--|| categories : belongs_to\n products ||--o{ product_images : has\n products ||--o{ inventory : tracks\n\n// ... (see reference guides for full implementation)\n```\n\n## Reference Guides\n\nDetailed implementations in the `references/` directory:\n\n| Guide | Contents |\n|---|---|\n| [users](references/users.md) | users |\n| [products](references/products.md) | products |\n| [orders](references/orders.md) | orders |\n| [order_items](references/orderitems.md) | order_items |\n| [Enum Types](references/enum-types.md) | Enum Types, JSONB Structures |\n\n## Best Practices\n\n### ✅ DO\n\n- Document all tables and columns\n- Create ERD diagrams\n- Document indexes and constraints\n- Include sample data\n- Document foreign key relationships\n- Show JSONB field structures\n- Document triggers and functions\n- Include migration scripts\n- Specify data types precisely\n- Document performance considerations\n\n### ❌ DON'T\n\n- Skip constraint documentation\n- Forget to version schema changes\n- Ignore performance implications\n- Skip index documentation\n- Forget to document enum values","type":"text"}]}]},"metadata":{"date":"2026-11-02","name":"database-schema-documentation","author":"@skillopedia","source":{"stars":375,"repo_name":"useful-ai-prompts","origin_url":"https://github.com/aj-geddes/useful-ai-prompts/blob/HEAD/skills/database-schema-documentation/SKILL.md","repo_owner":"aj-geddes","body_sha256":"ac904d8b2bb05903c631442b1659ecf684fcca819c7ecb899cb4437dcbedf241","cluster_key":"2c607a9403f3de37add7369fe35bfdb8c118d9aa6ee6583876b6245d5ba59f4d","clean_bundle":{"format":"clean-skill-bundle-v1","source":"aj-geddes/useful-ai-prompts/skills/database-schema-documentation/SKILL.md","text_bytes":10684,"source_commit":"3f5182cfd739fc113f4af5244a1cf342ad7f7911","skills_sh_rank":18118,"attachment_count":7,"text_attachments":7,"attachment_storage":"skill_attachments","binary_attachments":0},"cluster_size":1,"skill_md_path":"skills/database-schema-documentation/SKILL.md","import_metadata":{"date":"2026-11-02","author":"@skillopedia","version":"v1","category":"data-analytics","category_label":"Data"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"data-analytics","import_tag":"skills-sh-top20k-2026-11","description":"Document database schemas, ERD diagrams, table relationships, indexes, and constraints. Use when documenting database schema, creating ERD diagrams, or writing table documentation.\n"}},"renderedAt":1793671345542}

Database Schema Documentation Table of Contents - Overview - When to Use - Quick Start - Reference Guides - Best Practices Overview Create comprehensive database schema documentation including entity relationship diagrams (ERD), table definitions, indexes, constraints, and data dictionaries. When to Use - Database schema documentation - ERD (Entity Relationship Diagrams) - Data dictionary creation - Table relationship documentation - Index and constraint documentation - Migration documentation - Database design specs Quick Start Minimal working example: mermaid erDiagram users ||--o{ orders :…