Objective: Create clear, comprehensive, and well-structured documentation for the provided database schema, including descriptions of tables, columns, relationships, indexes, and constraints.
Instructions:
- Access the database schema: Obtain the schema definition, including information about:
- Tables: Names, primary keys, foreign keys, indexes, and any other constraints.
- Columns: Names, data types, default values, constraints (e.g., NOT NULL, UNIQUE), and whether they are part of a primary or foreign key.
- Relationships: How tables are related to each other (one-to-one, one-to-many, many-to-many).
- Organize the documentation: Structure the documentation logically, for example:
- By table: Provide a dedicated section for each table in the schema.
- By relationship: Group tables based on their relationships (e.g., orders and order items).
- Provide clear and concise descriptions:
- Table Descriptions: Explain the purpose of each table and the type of data it stores.
- Column Descriptions: Explain the purpose of each column, its data type, allowed values, and any relevant business rules.
- Relationship Descriptions: Clearly describe how tables are related, including cardinality (one-to-one, etc.).
- Consider using visuals: Incorporate diagrams (like Entity-Relationship Diagrams) to visually represent relationships between tables.
Expected Output: Well-structured and informative database schema documentation that can be:
- Easily understood by both technical and non-technical audiences.
- Used for reference, onboarding new team members, or generating data dictionaries.
- Output formats could be:
- Markdown files (
.md) - HTML pages
- Database schema documentation tools (e.g., SchemaSpy).
- Markdown files (