Skip to content

Data model

The system uses 38 PostgreSQL tables (PostGIS-enabled). Each is defined in lib/db/src/schema/ and generated below directly from that schema.

admin_actions

ColumnTypeNullableKeyReferences
iduuidnoPK
actor_user_iduuidyesFK→ users.id
actor_org_iduuidyesFK→ organizations.id
actiontextno
target_typetextyes
target_idtextyes
beforejsonbyes
afterjsonbyes
reasontextyes
iptextyes
tstimestamp with time zoneno

Indexes: admin_actions_ts_idx, admin_actions_action_idx, admin_actions_actor_idx, admin_actions_target_idx

alerts

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
asset_iduuidyesFK→ assets.id
user_iduuidyesFK→ users.id
hotspot_idtextyes
cluster_iduuidyesFK→ fire_clusters.id
levelalert_levelno
titletextno
bodytextno
sourcealert_sourceno
statusalert_statusno
issued_attimestamp with time zoneno
expires_attimestamp with time zoneyes
acked_attimestamp with time zoneyes
metadatajsonbyes

Indexes: alerts_org_idx, alerts_asset_idx, alerts_user_idx, alerts_hotspot_idx, alerts_cluster_idx, alerts_status_idx, alerts_issued_at_idx, alerts_active_dedup_uniq, alerts_active_cluster_dedup_uniq, alerts_broadcast_dedup_uniq

assets

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
owner_user_iduuidnoFK→ users.id
nametextno
addresstextno
locationgeometry(Point, 4326)no
areageometry(Geometry, 4326)yes
property_typeproperty_typeno
structurestructure_kindno
balbal_ratingno
statusrisk_levelno
metadatajsonbyes
created_attimestamp with time zoneno
updated_attimestamp with time zoneno

Indexes: assets_org_idx, assets_owner_idx, assets_location_gist, assets_area_gist

audit_log

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidyesFK→ organizations.id
user_iduuidyesFK→ users.id
actiontextno
resourcetextyes
metadatajsonbyes
tstimestamp with time zoneno

Indexes: audit_log_ts_idx, audit_log_action_idx, audit_log_user_idx

broadcasts

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
levelalert_levelno
titletextno
bodytextno
locationgeometry(Point, 4326)yes
radius_mintegeryes
areageometry(Geometry, 4326)yes
reasontextno
recipient_countintegerno
valid_fromtimestamp with time zoneno
expires_attimestamp with time zoneyes
revoked_attimestamp with time zoneyes
revoked_by_user_iduuidyesFK→ users.id
created_by_user_iduuidyesFK→ users.id
created_attimestamp with time zoneno

Indexes: broadcasts_org_idx, broadcasts_location_gist, broadcasts_area_gist, broadcasts_created_at_idx

checkin_sessions

ColumnTypeNullableKeyReferences
iduuidnoPK
owner_user_iduuidnoFK→ users.id
started_attimestamp with time zoneno
closed_attimestamp with time zoneyes

Indexes: checkin_sessions_owner_idx

checkin_statuses

ColumnTypeNullableKeyReferences
iduuidnoPK
session_iduuidnoFK→ checkin_sessions.id
contact_iduuidnoFK→ family_contacts.id
statuscheckin_statusno
responded_attimestamp with time zoneyes

Indexes: checkin_statuses_session_idx, checkin_statuses_contact_idx

device_tokens

ColumnTypeNullableKeyReferences
iduuidnoPK
user_iduuidnoFK→ users.id
tokentextno
platformtextno
app_versiontextyes
registered_attimestamp with time zoneno
last_used_attimestamp with time zoneyes
revoked_attimestamp with time zoneyes

Indexes: device_tokens_user_idx, device_tokens_token_unique

email_verifications

ColumnTypeNullableKeyReferences
iduuidnoPK
user_iduuidnoFK→ users.id
token_hashtextno
purposetextno
expires_attimestamp with time zoneno
used_attimestamp with time zoneyes
created_attimestamp with time zoneno

Indexes: email_verifications_token_hash_unique, email_verifications_user_purpose_idx

escalation_events

ColumnTypeNullableKeyReferences
iduuidnoPK
alert_iduuidyesFK→ alerts.id
leveltextno
reasontextno
statustextno
assigned_org_iduuidyesFK→ organizations.id
acknowledged_by_user_iduuidyesFK→ users.id
acknowledged_attimestamp with time zoneyes
resolved_by_user_iduuidyesFK→ users.id
resolved_attimestamp with time zoneyes
created_attimestamp with time zoneno

Indexes: escalation_events_alert_uniq, escalation_events_status_idx, escalation_events_created_at_idx

evacuation_routes

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
asset_iduuidnoFK→ assets.id
primary_nametextno
backup_nametextno
destinationtextno
distance_kmdouble precisionno
eta_minutesintegerno
hazard_countintegerno
water_stopsintegerno
refugesintegerno
notesjsonbno
primary_pathjsonbno
backup_pathjsonbno
poisjsonbno
cached_attimestamp with time zoneno

Indexes: evacuation_routes_org_idx, evacuation_routes_asset_idx

exclusion_zones

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
kindtextno
locationgeometry(Point, 4326)yes
radius_mintegeryes
areageometry(Geometry, 4326)yes
labeltextyes
reasontextyes
valid_fromtimestamp with time zoneno
expires_attimestamp with time zoneyes
revoked_attimestamp with time zoneyes
revoked_by_user_iduuidyesFK→ users.id
created_by_user_iduuidyesFK→ users.id
created_attimestamp with time zoneno

Indexes: exclusion_zones_org_idx, exclusion_zones_location_gist, exclusion_zones_area_gist, exclusion_zones_active_idx

family_contacts

ColumnTypeNullableKeyReferences
iduuidnoPK
owner_user_iduuidnoFK→ users.id
nametextno
roletextno
mobiletextno
initialstextno
tinttextno
created_attimestamp with time zoneno

Indexes: family_contacts_owner_idx

fire_cluster_observations

ColumnTypeNullableKeyReferences
iduuidnoPK
cluster_iduuidnoFK→ fire_clusters.id
org_iduuidnoFK→ organizations.id
observed_attimestamp with time zoneno
centroidgeometry(Point, 4326)no
footprintgeometry(Polygon, 4326)yes
hotspot_countintegerno
total_frp_mwdouble precisionyes
intensityfire_intensityno
movement_bearing_degdouble precisionyes
movement_speed_kmhdouble precisionyes
created_attimestamp with time zoneno

Indexes: fire_cluster_obs_cluster_observed_idx, fire_cluster_obs_org_idx, fire_cluster_obs_observed_idx, fire_cluster_obs_centroid_gist

fire_clusters

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
statustextno
sourcetextno
centroidgeometry(Point, 4326)no
footprintgeometry(Polygon, 4326)yes
hotspot_countintegerno
total_frp_mwdouble precisionyes
max_confidencetextyes
intensityfire_intensityno
prev_centroidgeometry(Point, 4326)yes
movement_bearing_degdouble precisionyes
movement_speed_kmhdouble precisionyes
merged_into_iduuidyes
parent_cluster_iduuidyes
incident_iduuidyes
first_observed_attimestamp with time zoneno
last_observed_attimestamp with time zoneno
last_evaluated_attimestamp with time zoneno
resolved_attimestamp with time zoneyes
lineagejsonbno
metadatajsonbyes
created_attimestamp with time zoneno
updated_attimestamp with time zoneno

Indexes: fire_clusters_org_idx, fire_clusters_centroid_gist, fire_clusters_footprint_gist, fire_clusters_status_idx, fire_clusters_last_observed_idx, fire_clusters_incident_idx

fire_incidents

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
sourcetextno
external_idtextyes
nametextyes
categorytextyes
statustextyes
alert_leveltextyes
locationgeometry(Point, 4326)no
perimetergeometry(Geometry, 4326)yes
size_hadouble precisionyes
council_areatextyes
regiontextyes
agency_updated_attimestamp with time zoneyes
observed_attimestamp with time zoneno
ai_eligiblebooleanno
attributiontextyes
rawjsonbyes
created_attimestamp with time zoneno
updated_attimestamp with time zoneno

Indexes: fire_incidents_org_idx, fire_incidents_location_gist, fire_incidents_perimeter_gist, fire_incidents_source_idx, fire_incidents_alert_level_idx, fire_incidents_observed_at_idx, fire_incidents_source_external_unique

fire_predictions

ColumnTypeNullableKeyReferences
iduuidnoPK
cluster_iduuidnoFK→ fire_clusters.id
org_iduuidnoFK→ organizations.id
made_attimestamp with time zoneno
horizon_minutesintegerno
model_versiontextno
enginetextno
predicted_geomgeometry(Polygon, 4326)no
predicted_head_latdouble precisionyes
predicted_head_lngdouble precisionyes
inputsjsonbno
created_attimestamp with time zoneno

Indexes: fire_predictions_cluster_idx, fire_predictions_org_idx, fire_predictions_made_at_idx, fire_predictions_model_horizon_idx

fire_spread_snapshots

ColumnTypeNullableKeyReferences
iduuidnoPK
fire_iduuidnoFK→ fires.id
org_iduuidnoFK→ organizations.id
sourcetextno
wind_dir_degintegeryes
wind_kmhdouble precisionno
ffdidouble precisionyes
valid_fromtimestamp with time zoneno
valid_totimestamp with time zoneno
payloadjsonbno
computed_attimestamp with time zoneno
expires_attimestamp with time zoneno

Indexes: fire_spread_snapshots_fire_uq, fire_spread_snapshots_org_idx, fire_spread_snapshots_expires_idx

fire_static_masks

ColumnTypeNullableKeyReferences
iduuidnoPK
locationgeometry(Point, 4326)no
radius_mintegerno
labeltextyes
sourcetextno
created_attimestamp with time zoneno

Indexes: fire_static_masks_location_gist, fire_static_masks_source_idx

fire_threats

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
asset_iduuidnoFK→ assets.id
owner_user_iduuidnoFK→ users.id
fire_iduuidnoFK→ fires.id
cluster_iduuidyesFK→ fire_clusters.id
hotspot_external_idtextyes
statustextno
current_severitytextno
current_leveltextyes
eta_minutesintegeryes
eta_minutes_lowintegeryes
eta_minutes_highintegeryes
distance_kmdouble precisionno
bearing_degdouble precisionyes
ros_kmhdouble precisionyes
prediction_sourcetextno
predicted_worstjsonbyes
first_detected_attimestamp with time zoneno
last_evaluated_attimestamp with time zoneno
last_notified_severitytextyes
last_notified_leveltextyes
last_notified_attimestamp with time zoneyes
quiet_cyclesintegerno
resolved_attimestamp with time zoneyes
trajectoryjsonbno
metadatajsonbyes

Indexes: fire_threats_asset_fire_uq, fire_threats_org_idx, fire_threats_owner_idx, fire_threats_fire_idx, fire_threats_cluster_idx, fire_threats_status_idx, fire_threats_last_eval_idx

fires

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
sourcetextno
external_idtextyes
satellite_codetextyes
sensor_versiontextyes
observed_attimestamp with time zoneno
confidencetextyes
frp_mwdouble precisionyes
nametextyes
regiontextyes
intensityfire_intensityno
locationgeometry(Point, 4326)no
cluster_iduuidyesFK→ fire_clusters.id
wind_kmhintegeryes
wind_directiontextyes
risk_scoreintegeryes
distance_kmdouble precisionyes
bearingtextyes
eta_minutesintegeryes
detected_attimestamp with time zoneno
updated_attimestamp with time zoneno

Indexes: fires_org_idx, fires_location_gist, fires_intensity_idx, fires_observed_at_idx, fires_cluster_idx, fires_source_external_unique

forecast_points

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
locationgeometry(Point, 4326)yes
sourcetextno
observed_attimestamp with time zoneyes
hour_labeltextno
valid_attimestamp with time zoneno
risk_scoreintegerno
wind_kmhintegerno
wind_direction_degdouble precisionyes
temp_cdouble precisionno
relative_humiditydouble precisionyes
ffdidouble precisionyes
danger_leveltextyes
notetextyes
created_attimestamp with time zoneno

Indexes: forecast_points_org_idx, forecast_points_location_gist, forecast_points_valid_at_idx, forecast_points_source_idx

ingest_cycles

ColumnTypeNullableKeyReferences
iduuidnoPK
sourcetextno
statustextno
started_attimestamp with time zoneno
finished_attimestamp with time zoneno
duration_msintegerno
fetchedintegeryes
insertedintegeryes
updatedintegeryes
deletedintegeryes
metadatajsonbyes
error_texttextyes

Indexes: ingest_cycles_source_idx, ingest_cycles_finished_at_idx

invitations

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
role_iduuidnoFK→ roles.id
emailcitextno
token_hashtextno
statustextno
invited_by_user_iduuidyesFK→ users.id
expires_attimestamp with time zoneno
accepted_attimestamp with time zoneyes
accepted_by_user_iduuidyesFK→ users.id
created_attimestamp with time zoneno

Indexes: invitations_token_hash_unique, invitations_org_idx, invitations_email_idx, invitations_status_idx

jurisdictions

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidyesFK→ organizations.id
parent_iduuidyesFK→ jurisdictions.id
leveltextno
nametextno
boundarygeometry(Geometry, 4326)yes
created_by_user_iduuidyesFK→ users.id
created_attimestamp with time zoneno

Indexes: jurisdictions_org_idx, jurisdictions_parent_idx, jurisdictions_boundary_gist

membership_grants

ColumnTypeNullableKeyReferences
iduuidnoPK
membership_iduuidnoFK→ memberships.id
capabilitytextno
max_recipientsintegeryes
max_km2integeryes
jurisdiction_iduuidyesFK→ jurisdictions.id
valid_fromtimestamp with time zoneno
expires_attimestamp with time zoneyes
revoked_attimestamp with time zoneyes
revoked_by_user_iduuidyesFK→ users.id
granted_by_user_iduuidyesFK→ users.id
created_attimestamp with time zoneno

Indexes: membership_grants_membership_idx, membership_grants_capability_idx, membership_grants_active_uniq

memberships

ColumnTypeNullableKeyReferences
iduuidnoPK
user_iduuidnoFK→ users.id
org_iduuidnoFK→ organizations.id
role_iduuidnoFK→ roles.id
created_attimestamp with time zoneno
verified_attimestamp with time zoneyes
verified_by_user_iduuidyesFK→ users.id
verification_notetextyes
jurisdiction_iduuidyesFK→ jurisdictions.id

Indexes: memberships_user_org_role_unique, memberships_user_idx, memberships_org_idx

notification_deliveries

ColumnTypeNullableKeyReferences
iduuidnoPK
alert_iduuidnoFK→ alerts.id
user_iduuidnoFK→ users.id
channeltextno
statustextno
reasontextyes
device_countintegerno
attempted_attimestamp with time zoneno
delivered_attimestamp with time zoneyes
metadatajsonbyes

Indexes: notification_deliveries_alert_idx, notification_deliveries_user_idx, notification_deliveries_attempted_idx, notification_deliveries_channel_status_idx

notification_preferences

ColumnTypeNullableKeyReferences
user_iduuidnoPK→ users.id
alerts_enabledbooleanno
quiet_hours_start_utcintegeryes
quiet_hours_end_utcintegeryes
min_severitytextno
web_push_enabledbooleanno
updated_attimestamp with time zoneno

organizations

ColumnTypeNullableKeyReferences
iduuidnoPK
slugtextno
nametextno
kindorg_kindno
created_attimestamp with time zoneno

Indexes: organizations_slug_unique

places

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
kindplace_kindno
nametextno
locationgeometry(Point, 4326)no
statustextno
openplace_openno
capacitytextyes
phonetextyes
notestextyes
sourcetextno
external_idtextyes
distance_kmdouble precisionyes
bearingbearing_diryes

Indexes: places_org_idx, places_kind_idx, places_location_gist, places_source_external_uniq

prediction_costs

ColumnTypeNullableKeyReferences
iduuidnoPK
prediction_iduuidnoFK→ predictions.id
org_iduuidnoFK→ organizations.id
user_iduuidyesFK→ users.id
sourcetextno
cpu_secondsintegerno
s3_putsintegerno
cost_auddouble precisionno
created_attimestamp with time zoneno

Indexes: prediction_costs_prediction_idx, prediction_costs_org_idx, prediction_costs_user_idx, prediction_costs_created_idx

prediction_etas

ColumnTypeNullableKeyReferences
iduuidnoPK
prediction_iduuidnoFK→ predictions.id
asset_iduuidnoFK→ assets.id
org_iduuidnoFK→ organizations.id
distance_kmdouble precisionno
bearing_degintegerno
rate_of_spread_kmhdouble precisionno
alignment_factordouble precisionno
slope_multiplierdouble precisionno
eta_minutesintegerno
eta_minutes_lowintegerno
eta_minutes_highintegerno
severitytextno
confidencedouble precisionno
methodtextno
computed_attimestamp with time zoneno

Indexes: prediction_etas_prediction_idx, prediction_etas_asset_idx, prediction_etas_org_idx, prediction_etas_prediction_asset_uq

prediction_scores

ColumnTypeNullableKeyReferences
iduuidnoPK
prediction_iduuidnoFK→ fire_predictions.id
cluster_iduuidnoFK→ fire_clusters.id
org_iduuidnoFK→ organizations.id
scored_attimestamp with time zoneno
model_versiontextno
horizon_minutesintegerno
containmentdouble precisionyes
ioudouble precisionyes
position_error_kmdouble precisionyes
eta_error_mindouble precisionyes
in_footprintbooleanyes
observation_iduuidyes
observed_attimestamp with time zoneyes
created_attimestamp with time zoneno

Indexes: prediction_scores_prediction_uq, prediction_scores_cluster_idx, prediction_scores_org_idx, prediction_scores_model_horizon_idx, prediction_scores_scored_idx

predictions

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
owner_user_iduuidyesFK→ users.id
kindprediction_kindno
bboxgeometry(Polygon, 4326)no
valid_fromtimestamp with time zoneno
valid_totimestamp with time zoneno
params_hashtextno
statusprediction_statusno
output_uritextyes
metadatajsonbyes
expires_attimestamp with time zoneno
created_attimestamp with time zoneno

Indexes: predictions_kind_hash_unique, predictions_org_idx, predictions_owner_idx, predictions_bbox_gist, predictions_valid_idx, predictions_expires_idx

roles

ColumnTypeNullableKeyReferences
iduuidnoPK
slugrole_slugno
descriptiontextyes

Indexes: roles_slug_unique

simulation_jobs

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
prediction_iduuidyesFK→ predictions.id
owner_user_iduuidyesFK→ users.id
paramsjsonbno
params_hashtextno
statusjob_statusno
priorityintegerno
attemptsintegerno
errortextyes
started_attimestamp with time zoneyes
finished_attimestamp with time zoneyes
created_attimestamp with time zoneno

Indexes: simulation_jobs_org_idx, simulation_jobs_owner_idx, simulation_jobs_status_idx, simulation_jobs_params_hash_idx

users

ColumnTypeNullableKeyReferences
iduuidnoPK
org_iduuidnoFK→ organizations.id
emailcitextno
display_nametextyes
external_idtextyes
auth_providerauth_providerno
auth_provider_user_idtextyes
is_service_accountbooleanno
password_hashtextyes
email_verified_attimestamp with time zoneyes
phonetextyes
phone_verified_attimestamp with time zoneyes
created_attimestamp with time zoneno
last_login_attimestamp with time zoneyes
token_revoked_beforetimestamp with time zoneyes

Indexes: users_email_unique, users_phone_unique, users_provider_subject_unique, users_org_idx