Skip to content

chore(schema): generate PostgreSQL schema documentation #417

Closed

Description

@mforce

Goal

Make the deployed PostgreSQL schema discoverable and reviewable without treating EF Core's CLR model as the complete source of truth.

Scope

  • Generate a readable ERD committed under docs/.
  • Generate a companion schema catalog with tables, columns/types/nullability/defaults, primary and unique keys, foreign keys/delete actions, check constraints, indexes (including predicates and expression indexes), and relationships.
  • Derive both artifacts from an ephemeral PostgreSQL database migrated by the repository migrations, so raw SQL migration details such as expression/partial indexes are represented.
  • Provide a deterministic developer/CI-friendly generator and a check mode that detects stale generated artifacts.
  • Add tests/guards for generator determinism and coverage of PostgreSQL-specific index details.
  • Add an AGENTS.md rule: every schema migration must regenerate and commit the documentation; generated artifacts are never hand-edited.

Non-goals

  • No changes to application data model or production database.
  • No live database credentials or production schema introspection.
  • No editing or regenerating the frozen InitialCreate migration.

Acceptance criteria

  • The generated ERD is readable in GitHub and links to the complete catalog.
  • The catalog includes every table, FK relationship, PK/unique key, check constraint, index definition, and index predicate/expression in the migration-created Postgres schema.
  • A clean checkout can generate the exact committed output using documented prerequisites.
  • CI/test verification fails when the generated documentation is stale after a schema change.
  • The workflow and maintenance rule are documented.

Activity

  1. added 14 commits that reference this issue on Aug 8, 2026
  2. 91 remaining items

  3. added 2 commits that reference this issue on Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions