Skip to main content

Database Schema

All PKs are UUID. All timestamps are timestamptz UTC. All agency-scoped tables are enforced via AgencyAwareRepository.

Auth & Users

TableKey columns
agenciesid, name, slug, agency_type (psap/company), timezone, is_active
usersid, agency_id, role_id, email, password_hash, first_name, last_name, is_active, last_login_at
rolesid, name, slug, permissions (jsonb)
user_transport_preferencesid, user_id, transport_channel_id, priority_order, delivery_mode, config_override (jsonb, encrypted)
jwt_refresh_tokensid, user_id, token_hash, expires_at, revoked_at
api_keysid, agency_id, name, key_hash, key_prefix, scopes (jsonb), last_used_at, expires_at
command_connectionsid, psap_agency_id, api_key_hash, ack_mode (poll/callback), public_url, last_seen_at

CFS

TableKey columns
cfs_configurationsid, agency_id, inbox_path, poll_interval_seconds, file_pattern, parser_class, field_mappings (jsonb)
cfs_importsid, cfs_configuration_id, filename, file_hash, record_count, status
cfs_incidentsid, cfs_configuration_id, external_cfs_id, caller_name, caller_phone, description, address, raw_xml*, linked_incident_id

*Encrypted at rest.

Incidents & Notifications

TableKey columns
incidentsid, agency_id, priority (irod/critical/dangerous/routine_special), status (open/acknowledged/resolved/closed), title, description, address*
incident_agenciesincident_id, agent_agency_id — which companies are on this incident
notificationsid, incident_id, notified_user_id, ack_status (pending/acked), ack_source, escalation_due_at, escalation_cancelled_at
notification_deliveriesid, notification_id, transport_channel_id, transport_type_slug, send_status, attempt_count, external_message_id

*Encrypted at rest.

Transport & Rules

TableKey columns
transport_typesid, name, slug, supports_inbound_ack, config_schema (jsonb), platform_config (jsonb, encrypted)
transport_channelsid, agency_id, transport_type_id, name, config (jsonb, encrypted)
notification_rulesid, agency_id, transport_channel_id, priority_filter, type_filter, time_start, time_end
escalation_rulesid, agency_id, priority_filter, ack_timeout_seconds, escalation_order (jsonb), notify_psap_user_ids (jsonb)

Audit & Communication Log

TableKey columns
incident_communicationsid, incident_id, notification_id, communication_type, direction, content*, payload_snapshot (jsonb, no credentials), sender/receiver context fields, created_at only — no updated_at, append-only
audit_logsid, agency_id, user_id, action, entity_type, entity_id, before (jsonb), after (jsonb) — immutable

*Encrypted at rest.