Skip to content

Database tables

This page lists the 151 tables of the database, generated from the Drizzle schema in packages/db/src/schema. 133 of them belong to a company and carry tenant_id; row level security keeps each company to its own rows (see Tenant isolation). Objects the schema cannot express, such as functions and triggers, live in the hand-written migrations of packages/db/migrations.

Module Tables
Platform 48
Attract 11
Recruit 49
Compliance 37
People 2
Fleet 1
Operations 3

Defined in packages/db/src/schema/messaging.ts. Policies: application_draft_reminders_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
draft_id uuid Yes
email text Yes
job_id uuid No References jobs
locale text Yes
first_sent_at timestamp with time zone No
second_sent_at timestamp with time zone No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/audit-log.ts.

Column Type Required Key
id uuid Yes Primary
occurred_at timestamp with time zone Yes Primary
tenant_id uuid No
actor_type text Yes
actor_user_id uuid No
actor_name text No
session_id uuid No
action text Yes
entity_type text Yes
entity_id uuid No
request_id text No
ip inet No
user_agent text No
changes jsonb No

Defined in packages/db/src/schema/automation.ts. Policies: automation_rule_actions_app_all, automation_rule_actions_gate_insert.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
rule_id uuid Yes References automation_rules
position smallint Yes
action_type text Yes
wait_minutes integer Yes
params jsonb Yes
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/automation.ts. Policies: automation_rule_versions_app_all, automation_rule_versions_gate_insert.

Column Type Required Key
tenant_id uuid Yes Primary, References tenants
rule_id uuid Yes Primary, References automation_rules
version integer Yes Primary
snapshot jsonb Yes
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/automation.ts. Policies: automation_rules_app_all, automation_rules_gate_insert, automation_rules_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
module_key module_key Yes
name text Yes
trigger_type text Yes
trigger_params jsonb Yes
conditions jsonb Yes
enabled boolean Yes
is_system boolean Yes
system_key text No
version integer Yes
created_by_user_id uuid No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/automation.ts. Policies: automation_run_actions_app_all, automation_run_actions_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
run_id uuid Yes References automation_runs
position smallint Yes
action_type text Yes
wait_minutes integer Yes
scheduled_for timestamp with time zone No
status text Yes
result_reason text No
result_detail text No
message_id uuid No
message_created_at timestamp with time zone No
attempts smallint Yes
executed_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/automation.ts. Policies: automation_runs_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
rule_id uuid Yes References automation_rule_versions
rule_version integer Yes References automation_rule_versions
event_id uuid No
event_occurred_at timestamp with time zone No
event_type text Yes
dedupe_key text Yes
application_id uuid No References applications
person_id uuid No
run_day date Yes
chain_depth smallint Yes
status text Yes
cancel_reason text No
finished_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/automation.ts. Policies: broadcast_recipients_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
broadcast_id uuid Yes References broadcasts
candidate_id uuid Yes References candidates
status text Yes
skip_reason text No
message_id uuid No
message_created_at timestamp with time zone No
processed_at timestamp with time zone No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/automation.ts. Policies: broadcasts_app_all, broadcasts_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
channel text Yes
template_id uuid Yes References message_templates
smart_list_id uuid No
smart_list_name text Yes
filter_text text No
status text Yes
scheduled_for timestamp with time zone No
audience_count integer No
recipient_count integer No
excluded_no_consent integer No
excluded_opted_out integer No
excluded_no_destination integer No
excluded_suppressed integer No
excluded_daily_cap integer No
segments_estimate integer No
cost_estimate_cents integer No
segment_price_e4 integer No
sent_count integer Yes
delivered_count integer Yes
failed_count integer Yes
reply_count integer Yes
opt_out_count integer Yes
stats_refreshed_at timestamp with time zone No
created_by_user_id uuid No
sent_by_user_id uuid No
started_at timestamp with time zone No
completed_at timestamp with time zone No
canceled_at timestamp with time zone No
cancel_reason text No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/messaging.ts. Policies: conversations_app_all, conversations_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
candidate_id uuid No References candidates
channel text Yes
external_address text No
status text Yes
dismissed_at timestamp with time zone No
assignee_user_id uuid No
assignee_set_manually boolean Yes
last_message_at timestamp with time zone No
last_message_preview text No
last_message_direction text No
last_inbound_at timestamp with time zone No
unread_count integer Yes
has_unread boolean No
reply_token_hash bytea No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/automation.ts. Policies: domain_event_failures_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
event_id uuid Yes
event_occurred_at timestamp with time zone Yes
event_type text Yes
consumer text Yes
attempts smallint Yes
last_error text No
failed_at timestamp with time zone Yes
resolved_at timestamp with time zone No

Defined in packages/db/src/schema/domain-events.ts.

Column Type Required Key
id uuid Yes Primary
occurred_at timestamp with time zone Yes Primary
tenant_id uuid Yes
event_type text Yes
entity_type text Yes
entity_id uuid Yes
candidate_id uuid No
application_id uuid No
person_id uuid No
actor_user_id uuid No
payload jsonb Yes
chain_depth smallint Yes
lane text Yes
dispatch_status text Yes
dispatched_at timestamp with time zone No

Defined in packages/db/src/schema/messaging.ts. Policies: email_suppressions_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
email text Yes
reason text Yes
source_message_id uuid No
source_message_created_at timestamp with time zone No
detail text No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/messaging.ts. Policies: email_unsubscribe_links_app_all, email_unsubscribe_links_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
token_hash bytea Yes
email text Yes
message_id uuid No
message_created_at timestamp with time zone No
used_at timestamp with time zone No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/file-access-log.ts.

Column Type Required Key
id uuid Yes Primary
occurred_at timestamp with time zone Yes Primary
tenant_id uuid Yes
file_id uuid Yes
vault text Yes
actor_type text Yes
actor_user_id uuid No
public_link_kind text No
public_link_id uuid No
purpose text Yes
ip inet No
user_agent text No
request_id text No

Defined in packages/db/src/schema/files.ts. Policies: files_app_all, files_app_vault.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
vault text Yes
storage_key text Yes
original_name text Yes
content_type text Yes
size_bytes bigint Yes
sha256 bytea Yes
uploaded_via text Yes
uploaded_by_user_id uuid No
public_link_kind text No
public_link_id uuid No
uploaded_ip inet No
entity_type text Yes
entity_id uuid Yes
status text Yes
superseded_by_file_id uuid No References files
superseded_at timestamp with time zone No
retained_at timestamp with time zone No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/tables.ts. Policies: invitations_app_all, invitations_gate_select, invitations_gate_update.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
email text Yes
role_id uuid Yes References roles
token_hash bytea Yes
invited_by_user_id uuid No References users
expires_at timestamp with time zone Yes
accepted_at timestamp with time zone No
accepted_user_id uuid No References users
revoked_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/tables.ts. Policies: landing_leads_gate_insert, landing_leads_gate_select, landing_leads_gate_update.

Column Type Required Key
id uuid Yes Primary
full_name text Yes
email text Yes
company_name text Yes
phone text No
fleet_size integer No
message text No
locale text Yes
utm_source text No
utm_medium text No
utm_campaign text No
ip inet No
user_agent text No
notified_at timestamp with time zone No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/tables.ts. Policies: lead_api_keys_app_all, lead_api_keys_gate_select, lead_api_keys_gate_update.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
key_prefix text Yes
key_hash bytea Yes
created_by_user_id uuid No References users
last_used_at timestamp with time zone No
revoked_at timestamp with time zone No
revoked_by_user_id uuid No References users
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/tables.ts. Policies: memberships_app_delete, memberships_app_select, memberships_app_update, memberships_gate_insert, memberships_gate_select, memberships_staff_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
user_id uuid Yes References users
role_id uuid Yes References roles
status text Yes
invited_by_user_id uuid No References users
last_selected_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/messaging.ts. Policies: message_idempotency_keys_app_all.

Column Type Required Key
tenant_id uuid Yes Primary, References tenants
idempotency_key text Yes Primary
message_id uuid Yes
message_created_at timestamp with time zone Yes
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/messaging.ts. Policies: message_provider_refs_app_all, message_provider_refs_gate_select.

Column Type Required Key
provider text Yes Primary
provider_message_id text Yes Primary
tenant_id uuid Yes References tenants
message_id uuid Yes
message_created_at timestamp with time zone Yes
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/messaging.ts. Policies: message_template_defaults_app_select, message_template_defaults_gate_select, message_template_defaults_owner_all.

Column Type Required Key
system_key text Yes Primary
channel text Yes Primary
name text Yes
subject_en text No
subject_es text No
body_en text Yes
body_es text Yes
variables text[] Yes
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/messaging.ts. Policies: message_templates_app_all, message_templates_gate_insert, message_templates_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
channel text Yes
suggested_stage_id uuid No References pipeline_stages
subject_en text No
subject_es text No
body_en text Yes
body_es text No
variables text[] Yes
is_system boolean Yes
system_key text No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/messaging.ts. Policies: message_usage_monthly_app_all, message_usage_monthly_staff_select.

Column Type Required Key
tenant_id uuid Yes Primary, References tenants
month date Yes Primary
channel text Yes Primary
origin text Yes Primary
messages integer Yes
segments integer Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/messages.ts.

Column Type Required Key
id uuid Yes Primary
created_at timestamp with time zone Yes Primary
tenant_id uuid Yes
conversation_id uuid No
direction text Yes
channel text Yes
origin text No
status text Yes
status_reason text No
provider_error_code text No
provider_error_message text No
subject text No
body text Yes
from_address text No
to_address text No
segments smallint No
encoding text No
locale text No
template_id uuid No
sent_by_user_id uuid No
idempotency_key text No
provider text No
provider_message_id text No
queue_priority smallint Yes
send_after timestamp with time zone No
attempts smallint Yes
sent_at timestamp with time zone No
delivered_at timestamp with time zone No
failed_at timestamp with time zone No
canceled_at timestamp with time zone No
replied_at timestamp with time zone No
replied_by_user_id uuid No
opted_out_at timestamp with time zone No
is_first_contact boolean Yes
application_id uuid No
automation_rule_id uuid No
sequence_id uuid No
broadcast_id uuid No
interview_id uuid No
attachments jsonb No

Defined in packages/db/src/schema/messaging.ts. Policies: messaging_settings_app_all, messaging_settings_gate_insert, messaging_settings_gate_select, messaging_settings_staff_select, messaging_settings_staff_update.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
sms_number text No
sms_provider text No
sms_provider_sender_id text No
a2p_status text Yes
a2p_status_changed_at timestamp with time zone No
sms_rate_per_second smallint Yes
reply_to_email text No
send_window_start_minute smallint Yes
send_window_end_minute smallint Yes
first_message_any_hour boolean Yes
remind_abandoned_drafts boolean Yes
auto_sms_daily_cap smallint Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/tables.ts. Policies: password_reset_tokens_gate_delete, password_reset_tokens_gate_insert, password_reset_tokens_gate_select, password_reset_tokens_gate_update.

Column Type Required Key
id uuid Yes Primary
user_id uuid Yes References users
token_hash bytea Yes
requested_ip inet No
expires_at timestamp with time zone Yes
used_at timestamp with time zone No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/tables.ts. Policies: permissions_app_select, permissions_gate_select, permissions_owner_all.

Column Type Required Key
id uuid Yes Primary
key text Yes
module_key module_key Yes
description text Yes
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/platform-audit-log.ts.

Column Type Required Key
id uuid Yes Primary
occurred_at timestamp with time zone Yes Primary
actor_type text Yes
staff_id uuid No
session_id uuid No
action text Yes
entity_type text Yes
entity_id uuid No
tenant_id uuid No
request_id text No
ip inet No
user_agent text No
changes jsonb No

Defined in packages/db/src/schema/messaging.ts. Policies: platform_messaging_settings_app_select, platform_messaging_settings_owner_all, platform_messaging_settings_staff_select, platform_messaging_settings_staff_update.

Column Type Required Key
id boolean Yes Primary
sms_segment_price_e4 integer No
updated_by_staff_id uuid No References platform_staff
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/platform-staff.ts. Policies: platform_staff_staff_insert, platform_staff_staff_select, platform_staff_staff_update.

Column Type Required Key
id uuid Yes Primary
email text Yes
full_name text Yes
password_salt bytea Yes
password_verifier bytea Yes
password_params text Yes
status text Yes
created_by_staff_id uuid No References platform_staff
last_login_at timestamp with time zone No
password_changed_at timestamp with time zone Yes
removed_at timestamp with time zone No
removed_by_staff_id uuid No References platform_staff
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/platform-staff.ts. Policies: platform_staff_invitations_staff_insert, platform_staff_invitations_staff_select, platform_staff_invitations_staff_update.

Column Type Required Key
id uuid Yes Primary
email text Yes
token_hash bytea Yes
invited_by_staff_id uuid Yes References platform_staff
expires_at timestamp with time zone Yes
accepted_at timestamp with time zone No
accepted_staff_id uuid No References platform_staff
revoked_at timestamp with time zone No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/platform-staff.ts. Policies: platform_staff_sessions_staff_delete, platform_staff_sessions_staff_insert, platform_staff_sessions_staff_select, platform_staff_sessions_staff_update.

Column Type Required Key
id uuid Yes Primary
staff_id uuid Yes References platform_staff
token_hash bytea Yes
ip inet No
user_agent text No
created_at timestamp with time zone Yes
last_seen_at timestamp with time zone Yes
expires_at timestamp with time zone Yes

Defined in packages/db/src/schema/tables.ts. Policies: role_permissions_app_all, role_permissions_gate_insert, role_permissions_owner_all.

Column Type Required Key
tenant_id uuid Yes Primary
role_id uuid Yes Primary, References roles
permission_id uuid Yes Primary, References permissions
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/tables.ts. Policies: roles_app_all, roles_gate_insert, roles_gate_select, roles_owner_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
description text No
system_key text No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/files.ts. Policies: sensitive_data_reveals_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
user_id uuid Yes
user_name text Yes
subject_type text Yes
subject_id uuid Yes
field text Yes
row_id uuid No
context text Yes
ip inet No
user_agent text No
request_id text No
occurred_at timestamp with time zone Yes

Defined in packages/db/src/schema/automation.ts. Policies: sequence_enrollments_app_all, sequence_enrollments_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
sequence_id uuid Yes References sequences
candidate_id uuid Yes References candidates
application_id uuid No References applications
status text Yes
next_step smallint Yes
next_send_at timestamp with time zone No
steps_sent smallint Yes
last_sent_at timestamp with time zone No
exit_reason text No
enrolled_via text Yes
enrolled_by_user_id uuid No
finished_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/automation.ts. Policies: sequence_steps_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
sequence_id uuid Yes References sequences
position smallint Yes
wait_minutes integer Yes
channel text Yes
template_id uuid Yes References message_templates
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/automation.ts. Policies: sequences_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
status text Yes
exit_on_reply boolean Yes
exit_on_stage_change boolean Yes
exit_on_closed boolean Yes
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/tables.ts. Policies: sessions_app_delete, sessions_app_insert, sessions_app_select, sessions_app_update, sessions_gate_delete, sessions_gate_select, sessions_gate_update.

Column Type Required Key
id uuid Yes Primary
user_id uuid Yes References users
token_hash bytea Yes
active_tenant_id uuid No
ip inet No
user_agent text No
created_at timestamp with time zone Yes
last_seen_at timestamp with time zone Yes
expires_at timestamp with time zone Yes

Defined in packages/db/src/schema/signing.ts. Policies: signing_envelopes_app_all, signing_envelopes_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
kind text Yes
title text Yes
locale text Yes
application_id uuid No References applications
person_id uuid No References people
source_type text Yes
source_id uuid Yes
template_type text No
template_id uuid No
template_version integer No
content jsonb Yes
content_sha256 bytea Yes
document_file_id uuid No References files
document_sha256 bytea No
final_file_id uuid No References files
final_sha256 bytea No
status text Yes
expires_at timestamp with time zone No
sent_at timestamp with time zone No
completed_at timestamp with time zone No
declined_at timestamp with time zone No
decline_reason text No
canceled_at timestamp with time zone No
canceled_by_user_id uuid No
cancel_reason text No
created_by_user_id uuid No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/signing.ts. Policies: signing_events_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
envelope_id uuid Yes References signing_envelopes
signer_id uuid No References signing_signers
event_type text Yes
actor_type text Yes
actor_user_id uuid No
ip inet No
user_agent text No
detail text No
occurred_at timestamp with time zone Yes

Defined in packages/db/src/schema/signing.ts. Policies: signing_signatures_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
envelope_id uuid Yes References signing_envelopes
signer_id uuid Yes References signing_signers
typed_name text Yes
signed_at timestamp with time zone Yes
ip inet Yes
user_agent text No
identified_via text Yes
session_id uuid No
user_id uuid No
consent_text_id uuid Yes References legal_texts
consent_text_version integer Yes
consent_text_locale text Yes
consent_text_validated boolean Yes
document_sha256 bytea Yes
form_values jsonb No
supplement_sha256 bytea No

Defined in packages/db/src/schema/signing.ts. Policies: signing_signers_app_all, signing_signers_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
envelope_id uuid Yes References signing_envelopes
signing_order smallint Yes
role text Yes
display_name text Yes
email text No
user_id uuid No
token_hash bytea No
token_expires_at timestamp with time zone No
status text Yes
first_viewed_at timestamp with time zone No
signed_at timestamp with time zone No
declined_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/tables.ts. Policies: tenant_modules_app_select, tenant_modules_app_update, tenant_modules_gate_insert, tenant_modules_staff_select, tenant_modules_staff_update.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
module_key module_key Yes
enabled boolean Yes
changed_by_user_id uuid No References users
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/tables.ts. Policies: tenants_app_select, tenants_app_update, tenants_gate_insert, tenants_gate_select, tenants_staff_select.

Column Type Required Key
id uuid Yes Primary
name text Yes
status text Yes
timezone text Yes
default_locale text Yes
address_line1 text No
address_line2 text No
city text No
state text No
postal_code text No
usdot_number text No
mc_number text No
operation_scope text No
driver_license_scope text No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/tables.ts. Policies: users_app_select, users_app_update, users_gate_insert, users_gate_select, users_gate_update.

Column Type Required Key
id uuid Yes Primary
email text Yes
password_hash text Yes
full_name text Yes
locale text Yes
timezone text Yes
status text Yes
email_verified_at timestamp with time zone No
password_changed_at timestamp with time zone Yes
last_login_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/attract.ts. Policies: application_drafts_app_all, application_drafts_gate_delete, application_drafts_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
token_hash bytea Yes
job_id uuid No References jobs
locale text Yes
current_step smallint Yes
payload jsonb Yes
email text No
tracked_link_id uuid No References tracked_links
source_channel text No
utm_source text No
utm_medium text No
utm_campaign text No
utm_term text No
utm_content text No
resume_sent_at timestamp with time zone No
resume_code_hash bytea No
resume_code_expires_at timestamp with time zone No
expires_at timestamp with time zone Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/attract.ts. Policies: application_screening_answers_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
application_id uuid Yes References applications
question_id uuid Yes References job_screening_questions
submission_no smallint Yes
answer_bool boolean No
answer_number numeric(12, 2) No
answer_text text No
answer_values text[] No
passed boolean No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/attract.ts. Policies: campaigns_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
channel text Yes
job_id uuid No References jobs
starts_on date No
ends_on date No
status text Yes
search_text text No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/attract.ts. Policies: career_sites_app_all, career_sites_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
slug text Yes
title text No
intro_text text No
logo_object_key text No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/attract.ts. Policies: job_screening_questions_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
job_id uuid Yes References jobs
position smallint Yes
question_type text Yes
standard_key text No
prompt_en text Yes
prompt_es text Yes
is_required boolean Yes
option_values text[] Yes
option_labels_en text[] Yes
option_labels_es text[] Yes
knockout_expected_bool boolean No
knockout_min_number numeric(12, 2) No
knockout_allowed_values text[] No
knockout_match text No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/attract.ts. Policies: jobs_app_all, jobs_search_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
title text Yes
driver_type text Yes
equipment_type text Yes
route_type text Yes
terminal_id uuid No References terminals
states_served text[] Yes
pay_min_cents integer No
pay_max_cents integer No
pay_unit text No
min_experience_years smallint No
required_endorsements text[] Yes
benefits text No
description text No
status text Yes
public_slug text No
published_at timestamp with time zone No
knockout_to_review boolean Yes
search_text text No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/attract.ts. Policies: lead_touches_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
candidate_id uuid Yes References candidates
application_id uuid Yes References applications
capture_channel text Yes
source_channel text Yes
source_detail text No
campaign_id uuid No References campaigns
tracked_link_id uuid No References tracked_links
referrer_person_id uuid No References people
utm_source text No
utm_medium text No
utm_campaign text No
utm_term text No
utm_content text No
external_id text No
api_key_id uuid No References lead_api_keys
import_batch_id uuid No References import_batches
candidate_existed boolean Yes
occurred_at timestamp with time zone Yes

Defined in packages/db/src/schema/attract.ts. Policies: referral_program_settings_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
enabled boolean Yes
default_bonus_cents integer Yes
payout_rule text No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/attract.ts. Policies: referrals_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
referrer_person_id uuid Yes References people
application_id uuid Yes References applications
bonus_cents integer Yes
status text Yes
created_via text Yes
created_by_user_id uuid No References users
eligible_at timestamp with time zone No
decided_at timestamp with time zone No
decided_by_user_id uuid No References users
decision_note text No
paid_at timestamp with time zone No
paid_by_user_id uuid No References users
payment_note text No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/attract.ts. Policies: tracked_link_daily_stats_app_all.

Column Type Required Key
tenant_id uuid Yes Primary, References tenants
tracked_link_id uuid Yes Primary, References tracked_links
day date Yes Primary
clicks integer Yes
applications_started integer Yes
applications_submitted integer Yes

Defined in packages/db/src/schema/attract.ts. Policies: tracked_links_app_all, tracked_links_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
kind text Yes
campaign_id uuid No References campaigns
referrer_person_id uuid No References people
label text Yes
code text Yes
job_id uuid No References jobs
channel text Yes
utm_source text No
utm_medium text No
utm_campaign text No
utm_term text No
utm_content text No
created_by_user_id uuid No References users
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: application_reasons_app_all, application_reasons_gate_insert, application_reasons_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
applies_to text Yes
code text No
name text Yes
is_system boolean Yes
position smallint Yes
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: application_stage_changes_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
application_id uuid Yes References applications
from_stage_id uuid No References pipeline_stages
to_stage_id uuid Yes References pipeline_stages
changed_by_user_id uuid No References users
changed_at timestamp with time zone Yes
from_status text No
to_status text No
reason_id uuid No References application_reasons
reason_note text No
seconds_in_from_stage integer No
job_id uuid No References jobs
recruiter_user_id uuid No
source_channel text No

Defined in packages/db/src/schema/recruit.ts. Policies: applications_app_all, applications_gate_sync_select, applications_gate_sync_update.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
candidate_id uuid Yes References candidates
job_id uuid No References jobs
stage_id uuid Yes References pipeline_stages
status text Yes
stage_entered_at timestamp with time zone Yes
move_version integer Yes
closed_at timestamp with time zone No
closed_reason_id uuid No References application_reasons
closed_note text No
furthest_stage_id uuid No References pipeline_stages
recruiter_user_id uuid No
source_channel text Yes
source_detail text No
first_touch_channel text Yes
capture_channel text Yes
screening_result text No
passed_after_knockout_at timestamp with time zone No
score smallint No
score_max smallint No
score_version text No
score_computed_at timestamp with time zone No
score_breakdown jsonb No
first_contact_at timestamp with time zone No
campaign_id uuid No References campaigns
tracked_link_id uuid No References tracked_links
first_touch_campaign_id uuid No References campaigns
utm_source text No
utm_medium text No
utm_campaign text No
utm_term text No
utm_content text No
referrer_person_id uuid No References people
hire_previous_person_state jsonb No
first_response_seconds integer No
first_response_at timestamp with time zone No
scorecard_average numeric(3, 2) No
scorecard_recommendation text No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: calendar_busy_blocks_app_all, calendar_busy_blocks_staff_delete, calendar_busy_blocks_staff_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
connection_id uuid Yes References calendar_connections
user_id uuid Yes
starts_at timestamp with time zone Yes
ends_at timestamp with time zone Yes
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: calendar_connections_app_all, calendar_connections_gate_select, calendar_connections_staff_select, calendar_connections_staff_update.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
user_id uuid Yes References memberships
provider text Yes
account_email text Yes
external_calendar_id text No
access_token_encrypted bytea No
refresh_token_encrypted bytea No
token_expires_at timestamp with time zone No
status text Yes
last_error text No
last_error_at timestamp with time zone No
last_synced_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: calendar_provider_configs_gate_select, calendar_provider_configs_staff_delete, calendar_provider_configs_staff_insert, calendar_provider_configs_staff_select, calendar_provider_configs_staff_update.

Column Type Required Key
provider text Yes Primary
client_id text Yes
client_secret_encrypted bytea Yes
account_type text No
updated_by_staff_id uuid No References platform_staff
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: candidate_call_logs_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
candidate_id uuid Yes References candidates
application_id uuid No References applications
outcome text Yes
note text No
callback_at timestamp with time zone No
task_id uuid No References recruit_tasks
user_id uuid No References users
called_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: candidate_consents_app_all, candidate_consents_gate_sync_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
candidate_id uuid Yes References candidates
application_id uuid No References applications
channel text Yes
granted boolean Yes
consent_text_id uuid No References consent_texts
consent_text text No
consent_text_version integer No
locale text No
captured_via text Yes
captured_by_user_id uuid No References users
ip inet No
user_agent text No
captured_at timestamp with time zone Yes
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: candidate_events_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
candidate_id uuid Yes References candidates
application_id uuid No References applications
event_type text Yes
actor_user_id uuid No References users
from_user_id uuid No
to_user_id uuid No
field_name text No
old_value text No
new_value text No
old_value_kept boolean No
related_candidate_id uuid No References candidates
related_person_id uuid No References people
person_created boolean No
person_link_created boolean No
interview_id uuid No References interviews
occurred_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: candidate_identifiers_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
candidate_id uuid Yes References candidates
kind text Yes
value text Yes
origin text Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: candidate_notes_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
candidate_id uuid Yes References candidates
application_id uuid No References applications
body text Yes
author_user_id uuid No References users
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes
edited_at timestamp with time zone No

Defined in packages/db/src/schema/recruit.ts. Policies: candidate_smart_lists_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
owner_user_id uuid Yes References users
name text Yes
visibility text Yes
filter_text text Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: candidates_app_all, candidates_gate_sync_select, candidates_gate_sync_update, candidates_search_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
first_name text Yes
last_name text No
full_name text No
email text No
phone text No
city text No
state text No
cdl_class text No
endorsements text[] Yes
experience_years smallint No
source_channel text Yes
source_detail text No
recruiter_user_id uuid No
postal_code text No
preferred_locale text No
merged_into_candidate_id uuid No References candidates
motivation_home_time smallint No
motivation_pay smallint No
motivation_routes smallint No
motivation_equipment smallint No
motivation_note text No
last_activity_at timestamp with time zone No
last_call_at timestamp with time zone No
person_id uuid No References people
search_text text No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-applications.ts. Policies: driver_application_accidents_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_application_id uuid Yes References driver_applications
position smallint Yes
accident_on date Yes
nature text Yes
fatalities smallint Yes
injuries smallint Yes
hazmat_released boolean No
city text No
state text No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-applications.ts. Policies: driver_application_addresses_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_application_id uuid Yes References driver_applications
position smallint Yes
address_line1 text Yes
address_line2 text No
city text Yes
state text Yes
postal_code text Yes
country text Yes
date_from date Yes
date_to date No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-applications.ts. Policies: driver_application_answers_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_application_id uuid Yes References driver_applications
question_key text Yes
answer boolean Yes
explanation text No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-applications.ts. Policies: driver_application_change_requests_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_application_id uuid Yes References driver_applications
revision_invalidated integer Yes
envelope_id uuid Yes References signing_envelopes
note text Yes
requested_by_user_id uuid Yes
requested_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-applications.ts. Policies: driver_application_consents_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_application_id uuid Yes References driver_applications
revision integer Yes
text_key text Yes
legal_text_id uuid Yes References legal_texts
text_version integer Yes
text_validated boolean Yes
accepted_at timestamp with time zone Yes
ip inet Yes
user_agent text No

Defined in packages/db/src/schema/driver-applications.ts. Policies: driver_application_documents_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_application_id uuid Yes References driver_applications
position smallint Yes
doc_kind text Yes
file_id uuid Yes References files
replaced_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-applications.ts. Policies: driver_application_employments_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_application_id uuid Yes References driver_applications
position smallint Yes
employer_name text Yes
address_line1 text No
city text No
state text No
postal_code text No
country text Yes
phone text No
contact_name text No
contact_email text No
position_held text No
date_from date Yes
date_to date No
reason_for_leaving text No
subject_to_fmcsrs boolean Yes
safety_sensitive_dot_testing boolean Yes
operated_cmv boolean Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-applications.ts. Policies: driver_application_experience_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_application_id uuid Yes References driver_applications
position smallint Yes
equipment_type text Yes
other_description text No
date_from date No
date_to date No
approx_miles integer No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-applications.ts. Policies: driver_application_gaps_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_application_id uuid Yes References driver_applications
date_from date Yes
date_to date Yes
explanation text Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-applications.ts. Policies: driver_application_licenses_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_application_id uuid Yes References driver_applications
position smallint Yes
country text Yes
state text Yes
number_ciphertext bytea Yes
number_last4 text Yes
number_lookup_hash bytea Yes
license_class text Yes
is_cdl boolean Yes
endorsements text[] Yes
expires_on date Yes
held_from date No
held_to date No
is_current boolean Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-applications.ts. Policies: driver_application_violations_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_application_id uuid Yes References driver_applications
position smallint Yes
violation_on date Yes
offense text Yes
location text No
vehicle_type text No
penalty text No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-applications.ts. Policies: driver_applications_app_all, driver_applications_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
application_id uuid Yes References applications
candidate_id uuid Yes References candidates
status text Yes
revision integer Yes
current_step smallint Yes
furthest_step smallint Yes
locale text Yes
token_hash bytea No
token_expires_at timestamp with time zone No
link_sent_at timestamp with time zone No
link_canceled_at timestamp with time zone No
sent_by_user_id uuid No
carrier_name text No
carrier_address text No
legal_first_name text No
legal_middle_name text No
legal_last_name text No
name_suffix text No
ssn_ciphertext bytea No
ssn_last4 text No
ssn_lookup_hash bytea No
date_of_birth_ciphertext bytea No
phone text No
email text No
applying_for_cdl_vehicle boolean No
operated_cmv_before boolean No
history_years_required smallint No
no_accidents boolean No
no_violations boolean No
signing_envelope_id uuid No References signing_envelopes
submitted_on date No
signed_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: import_batch_rows_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
batch_id uuid Yes References import_batches
row_number integer Yes
phase text Yes
outcome text Yes
error_code text No
error_field text No
raw_values text[] Yes

Defined in packages/db/src/schema/recruit.ts. Policies: import_batches_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
created_by_user_id uuid No References users
file_name text Yes
file_object_key text No
file_format text Yes
file_size_bytes integer Yes
status text Yes
column_headers text[] Yes
column_fields text[] Yes
job_id uuid No References jobs
initial_stage_id uuid No References pipeline_stages
recruiter_mode text Yes
recruiter_user_id uuid No
default_source_channel text Yes
total_rows integer Yes
processed_rows integer Yes
created_count integer Yes
existing_count integer Yes
error_count integer Yes
preview_create_count integer No
preview_existing_count integer No
preview_error_count integer No
error_file_object_key text No
failure_message text No
started_at timestamp with time zone No
finished_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: interview_reminders_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
interview_id uuid Yes References interviews
kind text Yes
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: interview_scorecard_ratings_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
scorecard_id uuid Yes References interview_scorecards
position smallint Yes
criterion_name text Yes
criterion_description text No
weight smallint Yes
rating smallint No
comment text No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: interview_scorecards_app_all, interview_scorecards_gate_sync_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
interview_id uuid Yes References interviews
application_id uuid Yes References applications, interviews
template_id uuid No References scorecard_templates
template_name text Yes
status text Yes
recommendation text No
overall_comment text No
weighted_average numeric(3, 2) No
author_user_id uuid No
submitted_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: interview_settings_app_all, interview_settings_gate_insert, interview_settings_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
reminder_first_minutes integer Yes
reminder_second_minutes integer Yes
waitlist_offer_minutes integer Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: interview_type_recruiters_app_all.

Column Type Required Key
tenant_id uuid Yes Primary, References tenants
interview_type_id uuid Yes Primary, References interview_types
user_id uuid Yes Primary, References memberships
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: interview_types_app_all, interview_types_gate_insert, interview_types_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
duration_minutes smallint Yes
location_kind text Yes
location_detail text No
min_notice_minutes integer Yes
buffer_minutes smallint Yes
max_per_day smallint No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: interview_waitlist_app_all, interview_waitlist_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
application_id uuid Yes References applications
interview_type_id uuid Yes References interview_types
recruiter_user_id uuid No
status text Yes
offered_at timestamp with time zone No
offer_expires_at timestamp with time zone No
offered_starts_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: interviews_app_all, interviews_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
application_id uuid Yes References applications
recruiter_user_id uuid Yes
interview_type_id uuid Yes References interview_types
starts_at timestamp with time zone Yes
ends_at timestamp with time zone Yes
status text Yes
booked_by text Yes
booked_by_user_id uuid No
rescheduled_from_interview_id uuid No References interviews
candidate_confirmed_at timestamp with time zone No
location_kind text Yes
location_detail text No
status_changed_at timestamp with time zone No
status_changed_by_user_id uuid No
cancel_reason text No
ics_uid uuid Yes
ics_sequence integer Yes
external_provider text No
external_event_id text No
external_sync_status text Yes
external_sync_error text No
external_synced_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: lead_distribution_rule_recruiters_app_all.

Column Type Required Key
tenant_id uuid Yes Primary, References tenants
rule_id uuid Yes Primary, References lead_distribution_rules
user_id uuid Yes Primary, References memberships
position smallint Yes

Defined in packages/db/src/schema/recruit.ts. Policies: lead_distribution_rules_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
position smallint Yes
enabled boolean Yes
mode text Yes
job_id uuid No References jobs
states text[] Yes
source_channels text[] Yes
last_assigned_user_id uuid No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: lead_merge_reviews_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
primary_candidate_id uuid Yes References candidates
other_candidate_id uuid Yes References candidates
application_id uuid No References applications
conflict_kind text Yes
status text Yes
resolved_at timestamp with time zone No
resolved_by_user_id uuid No References users
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-applications.ts. Policies: person_identity_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
person_id uuid Yes References people
ssn_ciphertext bytea No
ssn_last4 text No
ssn_lookup_hash bytea No
date_of_birth_ciphertext bytea No
license_number_ciphertext bytea No
license_number_last4 text No
license_number_lookup_hash bytea No
license_expires_on date No
source_driver_application_id uuid No References driver_applications
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: pipeline_stages_app_all, pipeline_stages_gate_insert, pipeline_stages_gate_select, pipeline_stages_gate_update.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
position smallint Yes
color text Yes
kind text Yes
is_system boolean Yes
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: recruit_tasks_app_all, recruit_tasks_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
title text Yes
description text No
due_at timestamp with time zone No
assignee_user_id uuid No
candidate_id uuid No References candidates
application_id uuid No References applications
status text Yes
created_by_user_id uuid No References users
completed_by_user_id uuid No References users
completed_at timestamp with time zone No
overdue_notified_at timestamp with time zone No
origin text Yes
person_id uuid No References people
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: recruiter_availability_exceptions_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
user_id uuid Yes References memberships
day date Yes
start_minute smallint Yes
end_minute smallint Yes
note text No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: recruiter_availability_windows_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
user_id uuid Yes References memberships
weekday smallint Yes
start_minute smallint Yes
end_minute smallint Yes
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: recruiter_calendar_settings_app_all, recruiter_calendar_settings_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
user_id uuid Yes References memberships
timezone text Yes
ics_token_hash bytea No
ics_token_created_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/recruit.ts. Policies: recruiter_limits_app_all.

Column Type Required Key
tenant_id uuid Yes Primary, References tenants
user_id uuid Yes Primary, References memberships
max_active_candidates integer Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: scheduling_links_app_all, scheduling_links_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
application_id uuid Yes References applications
interview_type_id uuid Yes References interview_types
recruiter_user_id uuid No
token_hash bytea Yes
expires_at timestamp with time zone Yes
revoked_at timestamp with time zone No
created_by_user_id uuid No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: scorecard_template_criteria_app_all, scorecard_template_criteria_gate_insert.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
template_id uuid Yes References scorecard_templates
position smallint Yes
name text Yes
description text No
weight smallint Yes
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: scorecard_template_jobs_app_all.

Column Type Required Key
tenant_id uuid Yes Primary, References tenants
job_id uuid Yes Primary, References jobs
template_id uuid Yes References scorecard_templates
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/scheduling.ts. Policies: scorecard_templates_app_all, scorecard_templates_gate_insert, scorecard_templates_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
is_default boolean Yes
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: compliance_alert_recipients_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
user_id uuid Yes References memberships
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: compliance_digest_sends_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
user_id uuid Yes
digest_on date Yes
kind text Yes
item_count integer Yes
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/compliance.ts. Policies: compliance_document_types_app_all, compliance_document_types_gate_insert, compliance_document_types_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
description text No
applies_to text[] Yes
required_when text Yes
default_validity_months smallint No
section text Yes
employment_types text[] No
blocks_eligibility boolean Yes
responsible_party text Yes
system_key text No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: compliance_export_subjects_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
export_id uuid Yes References compliance_exports
driver_file_id uuid Yes References driver_files

Defined in packages/db/src/schema/driver-files.ts. Policies: compliance_exports_app_all, compliance_exports_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
requested_by_user_id uuid Yes
requested_by_name text Yes
scope_kind text Yes
filter_terminal_id uuid No
filter_driver_type text No
filter_phase text No
filter_terminated_from date No
filter_terminated_to date No
include_previous_versions boolean Yes
show_full_identifiers boolean Yes
status text Yes
progress_done integer Yes
progress_total integer Yes
storage_key text No
file_name text No
size_bytes bigint No
sha256 bytea No
error text No
completed_at timestamp with time zone No
expires_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: compliance_item_events_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
item_id uuid Yes References compliance_items
event_type text Yes
from_status text No
to_status text Yes
actor_type text Yes
actor_user_id uuid No
actor_name text No
note text No
expires_on date No
file_id uuid No References files
occurred_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: compliance_item_files_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
item_id uuid Yes References compliance_items
file_id uuid Yes References files
side text Yes
added_via text Yes
added_by_user_id uuid No
added_at timestamp with time zone Yes
superseded_at timestamp with time zone No

Defined in packages/db/src/schema/driver-files.ts. Policies: compliance_items_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_file_id uuid Yes References driver_files
rule_id uuid No References compliance_rules
document_type_id uuid No References compliance_document_types
credential_id uuid No References person_credentials
source_key text No
instance_key text Yes
file_scope text Yes
is_blocking boolean Yes
responsible_party text Yes
status text Yes
due_on date No
expires_on date No
submitted_at timestamp with time zone No
reviewed_at timestamp with time zone No
reviewed_by_user_id uuid No
review_note text No
rejection_reason text No
waiver_reason text No
not_applicable_reason text No
last_alert_milestone smallint No
weekly_notice_count smallint Yes
last_weekly_notice_on date No
version integer Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/compliance.ts. Policies: compliance_rule_settings_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
rule_id uuid Yes References compliance_rules
enabled boolean Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/compliance.ts. Policies: compliance_rule_validations_staff_insert, compliance_rule_validations_staff_select.

Column Type Required Key
id uuid Yes Primary
rule_id uuid No References compliance_rules
consent_text_id uuid No References consent_texts
system_message_text_id uuid No References system_message_texts
legal_text_id uuid No References legal_texts
action text Yes
staff_id uuid Yes References platform_staff
occurred_at timestamp with time zone Yes

Defined in packages/db/src/schema/compliance.ts. Policies: compliance_rules_app_select, compliance_rules_gate_select, compliance_rules_owner_all, compliance_rules_staff_select, compliance_rules_staff_update.

Column Type Required Key
id uuid Yes Primary
code text Yes
name text Yes
description text No
applies_to text[] Yes
required_when text Yes
default_validity_months smallint No
regulation_citation text No
is_optional boolean Yes
sort_order smallint Yes
validation_status text Yes
validated_at timestamp with time zone No
item_kind text Yes
file_scope text Yes
section text Yes
employment_types text[] No
due_within_days_of_hire smallint No
recurrence_months smallint No
max_validity_months smallint No
retention_basis text Yes
retention_months smallint No
fulfillment text Yes
screening_kind text No
drug_alcohol_record_type text No
responsible_party text Yes
retired_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: compliance_settings_app_all, compliance_settings_gate_insert, compliance_settings_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
alert_days smallint[] Yes
expiring_soon_days smallint Yes
screening_overdue_days smallint Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/compliance.ts. Policies: consent_texts_app_select, consent_texts_owner_all, consent_texts_staff_select, consent_texts_staff_update.

Column Type Required Key
id uuid Yes Primary
channel text Yes
locale text Yes
version integer Yes
body text Yes
validation_status text Yes
validated_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: contract_documents_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_file_id uuid Yes References driver_files
template_id uuid No References contract_templates
template_name text Yes
kind text Yes
employment_type text No
signers text Yes
packet_id uuid No
signing_envelope_id uuid Yes References signing_envelopes
compliance_item_id uuid No References compliance_items
status text Yes
sent_at timestamp with time zone Yes
completed_at timestamp with time zone No
created_by_user_id uuid No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: contract_template_fields_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
template_id uuid Yes References contract_templates
position smallint Yes
field_key text Yes
label_en text Yes
label_es text No
field_type text Yes
choices text[] No
is_required boolean Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: contract_templates_app_all, contract_templates_gate_insert, contract_templates_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
kind text Yes
employment_type text No
body_en text Yes
body_es text No
variables text[] Yes
signers text Yes
in_admission_packet boolean Yes
document_type_id uuid No References compliance_document_types
version integer Yes
is_sample boolean Yes
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: driver_files_app_all, driver_files_gate_select, driver_files_gate_sync_select, driver_files_gate_sync_update.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
application_id uuid No References applications
person_id uuid No References people
driver_type text Yes
employment_type text No
phase text Yes
hired_on date No
start_on date No
terminated_on date No
retention_ends_on date No
retention_decision text No
closed_at timestamp with time zone No
replaced_by_driver_file_id uuid No References driver_files
status text Yes
eligible boolean Yes
ineligible_reasons text[] Yes
missing_count smallint Yes
blocking_open_count smallint Yes
awaiting_review_count smallint Yes
next_expiration_on date No
blocked_since date No
waits_on_driver boolean Yes
waits_on_company boolean Yes
waits_on_previous_employer boolean Yes
compliance_hold boolean Yes
computed_at timestamp with time zone No
version integer Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/drug-alcohol.ts. Policies: drug_alcohol_access_log_app_insert, drug_alcohol_access_log_app_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
user_id uuid Yes
user_name text Yes
access_kind text Yes
person_id uuid No
application_id uuid No
record_id uuid No
file_id uuid No
ip inet No
user_agent text No
request_id text No
occurred_at timestamp with time zone Yes

Defined in packages/db/src/schema/drug-alcohol.ts. Policies: drug_alcohol_employer_answers_app_insert, drug_alcohol_employer_answers_app_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
record_id uuid Yes References drug_alcohol_records
question_key text Yes
answer text Yes
detail text No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/drug-alcohol.ts. Policies: drug_alcohol_records_app_insert, drug_alcohol_records_app_select, drug_alcohol_records_app_update, drug_alcohol_records_gate_sync_select, drug_alcohol_records_gate_sync_update.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
person_id uuid No References people
application_id uuid No References applications
record_type text Yes
record_on date Yes
result_code text Yes
result_class text Yes
not_cleared boolean Yes
note text No
file_id uuid No References files
retention_rule_id uuid No References drug_alcohol_retention_rules
retention_ends_on date No
retention_decision text No
retention_decided_at timestamp with time zone No
retention_decided_by_user_id uuid No
retention_decision_reason text No
recorded_via text Yes
recorded_by_user_id uuid No
screening_request_id uuid No References screening_requests
safety_history_request_id uuid No References safety_history_requests
signing_signature_id uuid No References signing_signatures
voided_at timestamp with time zone No
voided_by_user_id uuid No
void_reason text No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/drug-alcohol.ts. Policies: drug_alcohol_retention_rules_app_select, drug_alcohol_retention_rules_gate_select, drug_alcohol_retention_rules_owner_all.

Column Type Required Key
id uuid Yes Primary
record_type text Yes
result_class text Yes
retention_basis text Yes
retention_months smallint Yes
rule_id uuid Yes References compliance_rules
regulation_citation text No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/compliance.ts. Policies: legal_texts_app_select, legal_texts_owner_all, legal_texts_staff_select, legal_texts_staff_update.

Column Type Required Key
id uuid Yes Primary
text_key text Yes
locale text Yes
version integer Yes
title text Yes
body text Yes
regulation_citation text No
validation_status text Yes
validated_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: offer_templates_app_all, offer_templates_gate_insert, offer_templates_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
employment_type text No
body_en text Yes
body_es text No
variables text[] Yes
version integer Yes
is_sample boolean Yes
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: offers_app_all, offers_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
application_id uuid Yes References applications
template_id uuid No References offer_templates
template_name text Yes
locale text Yes
employment_type text Yes
start_on date No
pay_text text No
benefits_text text No
terminal_id uuid No References terminals
status text Yes
expires_at timestamp with time zone No
signing_envelope_id uuid No References signing_envelopes
sent_at timestamp with time zone No
viewed_at timestamp with time zone No
decided_at timestamp with time zone No
decline_reason text No
created_by_user_id uuid No
withdrawn_by_user_id uuid No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: onboarding_plans_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
person_id uuid Yes References people
application_id uuid No References applications
template_id uuid No References onboarding_templates
template_name text Yes
status text Yes
basis_hire_on date No
basis_start_on date No
total_count smallint Yes
done_count smallint Yes
completed_at timestamp with time zone No
completed_by_user_id uuid No
canceled_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: onboarding_tasks_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
plan_id uuid Yes References onboarding_plans
position smallint Yes
title text Yes
description text No
assignee_kind text Yes
assignee_user_id uuid No
due_on date No
is_required boolean Yes
status text Yes
skip_reason text No
recruit_task_id uuid No References recruit_tasks
compliance_item_id uuid No References compliance_items
contract_document_id uuid No References contract_documents
linked_contract_template_id uuid No
completed_at timestamp with time zone No
completed_by_user_id uuid No
completed_via text No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: onboarding_template_tasks_app_all, onboarding_template_tasks_gate_insert.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
template_id uuid Yes References onboarding_templates
position smallint Yes
title text Yes
description text No
assignee_kind text Yes
assignee_user_id uuid No
due_offset_days smallint Yes
due_basis text Yes
is_required boolean Yes
linked_rule_id uuid No References compliance_rules
linked_document_type_id uuid No References compliance_document_types
linked_contract_template_id uuid No References contract_templates
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: onboarding_templates_app_all, onboarding_templates_gate_insert, onboarding_templates_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
person_role text No
employment_type text No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: person_credentials_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
person_id uuid Yes References people
kind text Yes
endorsement_code text No
credential_type text No
name text No
number text No
expires_on date No
file_id uuid No References files
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: portal_links_app_all, portal_links_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
candidate_id uuid No References candidates
person_id uuid No References people
token_hash bytea Yes
revoked_at timestamp with time zone No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: retention_decisions_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_file_id uuid Yes References driver_files
decision text Yes
reason text No
new_retention_ends_on date No
decided_by_user_id uuid Yes
decided_by_name text No
decided_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: safety_history_attempts_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
request_id uuid Yes References safety_history_requests
kind text Yes
attempted_on date Yes
note text No
message_id uuid No
message_created_at timestamp with time zone No
logged_by_user_id uuid No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: safety_history_requests_app_all, safety_history_requests_gate_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_file_id uuid Yes References driver_files
employment_id uuid Yes References driver_application_employments
authorization_envelope_id uuid Yes References signing_envelopes
authorization_file_id uuid Yes References files
employer_name text Yes
employer_address text No
employed_from date Yes
employed_to date No
contact_email text Yes
asks_drug_alcohol boolean Yes
status text Yes
token_hash bytea No
token_expires_at timestamp with time zone No
sent_at timestamp with time zone Yes
deadline_on date Yes
reminder_count smallint Yes
next_reminder_at timestamp with time zone No
answered_at timestamp with time zone No
closed_at timestamp with time zone No
created_by_user_id uuid No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: safety_history_response_accidents_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
response_id uuid Yes References safety_history_responses
accident_on date Yes
city text No
state text No
injuries smallint No
fatalities smallint No
hazmat_released boolean No
description text No
created_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: safety_history_responses_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
request_id uuid Yes References safety_history_requests
response_kind text Yes
employed_from date No
employed_to date No
position_held text No
had_accidents boolean No
responder_name text Yes
responder_title text No
responder_company text No
responder_phone text No
signing_signature_id uuid Yes References signing_signatures
drug_alcohol_section_submitted boolean Yes
submitted_at timestamp with time zone Yes

Defined in packages/db/src/schema/driver-files.ts. Policies: screening_requests_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
driver_file_id uuid Yes References driver_files
compliance_item_id uuid No References compliance_items
kind text Yes
state_code text No
cycle_key text Yes
status text Yes
assignee_user_id uuid No
requested_on date No
requested_via text No
received_on date No
outcome text No
result_file_id uuid No References files
reviewed_on date No
reviewed_by_user_id uuid No
reviewed_by_name text No
review_note text No
next_due_on date No
exam_on date No
medical_expires_on date No
examiner_name text No
examiner_registry_number text No
registry_checked_on date No
road_test_on date No
road_test_vehicle_type text No
road_test_examiner_name text No
road_test_equivalent text No
equivalent_issued_on date No
signing_envelope_id uuid No References signing_envelopes
created_by_user_id uuid No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/compliance.ts. Policies: system_message_texts_app_select, system_message_texts_owner_all, system_message_texts_staff_select, system_message_texts_staff_update.

Column Type Required Key
id uuid Yes Primary
text_key text Yes
locale text Yes
version integer Yes
body text Yes
validation_status text Yes
validated_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/people.ts. Policies: people_app_all, people_search_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
first_name text Yes
last_name text Yes
full_name text No
email text No
phone text No
role text Yes
employment_type text Yes
terminal_id uuid No References terminals
manager_person_id uuid No References people
start_date date No
status text Yes
user_id uuid No
cdl_class text No
endorsements text[] Yes
license_state text No
home_city text No
home_state text No
hired_from_application_id uuid No
search_text text No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/people.ts. Policies: terminals_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
address_line1 text Yes
address_line2 text No
city text Yes
state text Yes
postal_code text Yes
timezone text Yes
manager_person_id uuid No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/fleet.ts. Policies: vehicles_app_all, vehicles_search_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
unit_number text Yes
vehicle_type text Yes
vin text No
model_year smallint No
make text No
model text No
plate_number text No
plate_state text No
ownership text Yes
terminal_id uuid No References terminals
odometer_miles integer No
capacity_lbs integer No
status text Yes
search_text text No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/operations.ts. Policies: customer_contacts_app_all.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
customer_id uuid Yes References customers
name text Yes
title text No
email text No
phone text No
is_primary boolean Yes
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/operations.ts. Policies: customers_app_all, customers_search_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
customer_type text Yes
mc_number text No
dot_number text No
billing_address_line1 text No
billing_address_line2 text No
billing_city text No
billing_state text No
billing_postal_code text No
payment_terms_days smallint No
credit_limit_cents bigint No
status text Yes
search_text text No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes

Defined in packages/db/src/schema/operations.ts. Policies: locations_app_all, locations_search_select.

Column Type Required Key
id uuid Yes Primary
tenant_id uuid Yes References tenants
name text Yes
customer_id uuid No References customers
address_line1 text Yes
address_line2 text No
city text Yes
state text Yes
postal_code text Yes
latitude numeric(8, 6) No
longitude numeric(9, 6) No
hours text No
instructions text No
contact_name text No
contact_phone text No
contact_email text No
search_text text No
archived_at timestamp with time zone No
created_at timestamp with time zone Yes
updated_at timestamp with time zone Yes