Overview

This site documents the database tables used by the DirtView platform. Each table page explains the purpose of the table, key columns, relationships, access/security rules, and how it is used in the application.

Project: DirtView
Database: PostgreSQL / Supabase
Documentation Status: Proposed Schema v2
Last Updated: 11 Apr 2026

Global Admin Layer

Table Scope Purpose Status
super_admins Global Internal DirtView staff accounts with privileged platform access Proposed
admin_audit_log Global Immutable audit log of all super-admin actions Proposed
feature_flags Global / Tenant Feature toggles for rollouts, overrides, and operational controls Proposed
impersonation_sessions Global Tracks support/debug user impersonation sessions Planned

Tenant & Identity

Table Scope Purpose Status
tenants Tenant Customer organizations and tenant-level settings Proposed
tenant_domains Tenant Custom domain mappings for tenant subdomain/domain routing Planned
profiles Global User Profile Base app-level profile linked to authenticated users Proposed
tenant_memberships Tenant User membership records within a tenant Proposed

RBAC

Table Scope Purpose Status
roles Tenant Tenant-defined roles including default and custom roles Planned
permissions Global Catalog Normalized permission definitions across company, project, and module scopes Planned
role_permissions Tenant Maps roles to permissions Planned
user_company_roles Tenant Company-level role assignment for a tenant member Planned
project_members Project Membership assignment of users to projects Planned
user_project_roles Project Project-specific role overrides Planned
project_module_access Project Module-level permissions within a project Planned

Employees

Table Scope Purpose Status
employees Tenant Employee profiles and business records Planned
certifications Tenant Employee certifications and expiry tracking Planned
employee_project_assignments Project Employee assignment to projects Planned

Projects

Table Scope Purpose Status
projects Tenant Project records and metadata Planned
project_contacts Project Key project contacts and external parties Planned
distribution_groups Tenant / Project Mailing and notification groups Planned
distribution_group_members Tenant / Project Members of distribution groups Planned

Files & Storage

Table Scope Purpose Status
files Tenant Central file metadata registry Planned
file_links Tenant Associates files with resource records Planned
file_scan_results Tenant Virus/malware scan results for uploaded files Planned

Drawings

Table Scope Purpose Status
drawing_sets Project Logical drawing sets uploaded for a project Planned
drawing_versions Project Version history for a drawing set Planned
drawing_sheets Project OCR-confirmed sheets extracted from a drawing version Planned
drawing_callouts Project Detected and linked drawing callouts Planned
drawing_annotations Project Markup, comments, and measurement annotations on sheets Planned

External Guests

Table Scope Purpose Status
external_guest_invites Tenant / Project Invitations sent to external collaborators Planned
external_guest_access_grants Tenant / Project Scoped access rules for external guests Planned

Audit & Operations

Table Scope Purpose Status
audit_log Tenant Immutable tenant-scoped user action log Planned
token_revocations Tenant Immediate session invalidation and forced logout tracking Planned
background_job_runs Global / Tenant Application-visible async job execution status Planned