Overview

This site documents the DirtView database schema, including table purpose, columns, relationships, security expectations, and operational behavior.

Project: DirtView
Database: PostgreSQL / Supabase
Documentation Status: Working Schema Reference
Last Updated: 11 Apr 2026
Global Tenant Project Immutable Proposed Reviewed

Core Concepts

Start here if you are new to the schema or need the shared mental model before reading individual table pages.

Global Admin Layer

Table Scope Purpose Status
super_admins
Global Reviewed
Global Internal DirtView platform operators with cross-tenant administrative power Reviewed
admin_audit_log
Global Immutable Reviewed
Global Append-only audit trail of all super-admin actions Reviewed
feature_flags
Global Tenant Override Proposed
Global / Tenant Feature toggles for controlled rollout, operational control, and tenant-specific overrides Proposed

Tenant & Identity

Table Scope Purpose Status
tenants
Tenant Proposed
Tenant Customer organizations and tenant-level configuration root Proposed
profiles
Global Identity Proposed
Global User Profile Base authenticated person profile Proposed
tenant_memberships
Tenant Proposed
Tenant User membership inside a specific tenant Proposed
employees
Tenant Planned
Tenant Business employee records that may or may not map to login-enabled users Planned

RBAC

Table Scope Purpose Status
roles Tenant Tenant-defined role catalog Proposed
permissions Global Catalog Atomic permission definitions Proposed
role_permissions Tenant Role-to-permission mapping Proposed
user_company_roles Tenant Tenant-level default role assignment Proposed
project_members Project Project membership access boundary Proposed
user_project_roles Project Project-level role overrides Proposed
project_module_access Project / Module Fine-grained module access inside a project Proposed

Projects

Table Scope Purpose Status
projectsProjectProject root recordProposed
project_contactsProjectProject contact directoryProposed
distribution_groupsTenant / ProjectReusable workflow notification groupsProposed
distribution_group_membersTenant / ProjectInternal or external recipients in a groupProposed

Files & Drawings

Table Scope Purpose Status
filesTenant / ProjectFile metadata registryProposed
file_linksTenantAssociates files to resourcesProposed
file_scan_resultsTenantMalware/virus scan historyProposed
drawing_setsProjectLogical grouping of drawing revisionsProposed
drawing_versionsProject / VersionUploaded revisions of a drawing setProposed
drawing_sheetsProject / SheetConfirmed sheets extracted from a versionProposed
drawing_calloutsProject / SheetDetected or created drawing calloutsProposed
drawing_annotationsProject / SheetUser markups and measurement annotationsProposed
drawing_sheet_linksProject / SheetResolved links between sheetsProposed

Workflow Engine

Table Scope Purpose Status
rfisProjectMain RFI business recordProposed
rfi_threadsProject / RFIRFI conversation and history entriesProposed
form_templatesTenantReusable form definitionsProposed
form_submissionsProjectDraft or submitted form instancesProposed
notificationsTenantNotification delivery recordsProposed

Operations & Control

Table Scope Purpose Status
audit_log
Tenant Immutable
Tenant Tenant-scoped audit history Proposed
token_revocationsTenantImmediate access invalidation recordsProposed
background_job_runsGlobal / TenantApplication-visible async job execution historyProposed
external_guest_invitesTenant / ProjectInvitations sent to outside collaboratorsProposed
external_guest_access_grantsTenant / ProjectScoped external access rules after invite acceptanceProposed