Skip to main content

Database

Last reviewed: 2026-05-13
Maintained by: Engineering

Zgrid uses a migration-driven PostgreSQL schema.

Current shape

  • PostgreSQL is the system database in local and hosted environments.
  • Ongoing schema changes are defined in database/migrations.
  • database/schema.snapshot.sql is the checked-in snapshot used for drift validation.
  • API runtime access is handled through apps/api/src/db.

Domain grouping

The current schema is organized around a few major domains:

  • auth and session state
  • organizations, buildings, and unit hierarchy
  • operational work such as issues and service requests
  • subscriptions, billing, and provider webhook state
  • privacy, audit, and retention support

For a repository-state inventory of those domains, see ../99-reference/features-inventory.md.