Maverick Docs
Technical Reference

Database Schema

Every table, column, index, and constraint from SQL migrations

351 migrations | 272 tables | 616 indexes

Migrations

#FileTables
001001_create_core_tables.sqluser_workspace_access, client_registry, client_settings, client_pricing, client_costs, monthly_revenue_snapshots, client_zipcodes
002002_create_contact_pipeline.sqlraw_contacts, verified_contacts, weekly_batches, upload_audit_log, debounce_usage
003003_create_scraping_jobs.sqlscraping_jobs, scraping_job_logs, agent_runs, agent_errors, site_credentials
004004_create_lead_management.sqlclient_leads
005005_create_email_infrastructure.sqlemail_accounts, email_account_metadata, email_account_polling
006006_create_user_profiles.sqluser_profiles
006006_optimize_raw_contacts.sql(alter/index only)
007007_fix_raw_contacts_schema.sql(alter/index only)
008008_create_filter_rules.sqlclient_filter_rules
009009_add_missing_verified_fields.sql(alter/index only)
010010_create_default_filter_rules.sql(alter/index only)
011011_add_email_bison_workspace_mapping.sql(alter/index only)
012012_add_bison_campaign_id.sql(alter/index only)
013013_create_vault_functions.sql(alter/index only)
014014_update_site_credentials_schema.sql(alter/index only)
015015_create_credential_audit_log.sqlcredential_audit_log
016016_create_scraping_job_batches.sqlscraping_job_batches
017017_create_campaign_metrics.sqlcampaign_metrics
018018_add_duplicate_detection_indexes.sql(alter/index only)
018018_create_debounce_bulk_jobs.sqldebounce_bulk_jobs
019019_add_credential_to_jobs.sql(alter/index only)
020020_create_task_progress_tables.sqlfiltering_tasks, verification_tasks
021021_add_workspace_contact_fields.sql(alter/index only)
022022_tighten_rls_policies.sql(alter/index only)
023023_create_pipeline_runs.sqlpipeline_runs
024024_add_month_filter_to_stats.sql(alter/index only)
025025_add_upload_status_to_verified_contacts.sql(alter/index only)
026026_update_pipeline_stats_with_upload_status.sql(alter/index only)
027027_email_bison_account_sync.sql(alter/index only)
028028_campaign_metrics_progress.sql(alter/index only)
029029_client_leads_bison_sync.sql(alter/index only)
030030_client_targets.sqlclient_targets
031031_crm_webhook_integration.sqlcrm_delivery_log, slack_notifications_sent, lead_replies, webhook_delivery_log, webhook_health
032032_master_contacts_integration.sqlhome_value_codes
033033_campaign_crm_routing.sqlcampaign_crm_routing
034034_add_csv_processing_status.sql(alter/index only)
035035_add_month_leading_indexes.sql(alter/index only)
035035_create_tasks_table.sqltasks
035035_reply_response_tracking.sql(alter/index only)
036036_auto_reply_config.sqlauto_reply_config, auto_reply_log
037037_thomas_migration_compat.sqlreply_templates, sent_replies, sma_policies, client_metrics, monthly_daily_revenue_history
038038_add_bounce_alert_throttle.sql(alter/index only)
038038_daily_revenue_unique_index.sql(alter/index only)
039039_extra_data_and_bison_field_mapping.sql(alter/index only)
039039_unique_workspace_lead_email.sql(alter/index only)
040040_add_source_type_to_contact_stats.sql(alter/index only)
041041_backfill_source_type_scraped.sql(alter/index only)
041041_bison_source_of_truth.sql(alter/index only)
042042_pipeline_stats_all_months.sql(alter/index only)
042042_workspace_stats_cache.sqlworkspace_stats_cache
043043_analyze_and_index_for_performance.sql(alter/index only)
044044_pipeline_stats_cache_table.sqlpipeline_stats_cache
045045_workspace_daily_stats.sqlworkspace_daily_stats
046046_backfill_client_type.sql(alter/index only)
047047_mx_checked_at.sql(alter/index only)
048048_infrastructure_orders.sqlreseller_configs, infrastructure_orders, infrastructure_order_events
049049_normalize_pipeline_stages.sql(alter/index only)
050050_sma_policies_rls.sql(alter/index only)
051051_workspace_access_rls_helper.sql(alter/index only)
052052_onboarding_drafts.sqlonboarding_drafts
053053_agent_conversations.sqlagent_threads, agent_messages
054054_infrastructure_action_items_rpc.sql(alter/index only)
055055_fix_warmup_disabled_count.sql(alter/index only)
056056_fix_action_items_jsonb_cast.sql(alter/index only)
057057_fix_reseller_warmup_periods.sql(alter/index only)
058058_domain_tracking.sql(alter/index only)
059059_task_events.sqltask_events
060060_hall_of_fame.sqlhall_of_fame_nominations, hall_of_fame_votes
060060_tasks_v2.sqltask_activity
062062_increment_daily_interested.sql(alter/index only)
063063_normalize_contact_names_trigger.sql(alter/index only)
064064_reply_ai_upgrade.sqlai_generation_log, prompt_eval_results
064064_week_bucket_not_null.sql(alter/index only)
065065_crm_destinations.sqlcrm_destinations
065065_reply_templates_unique_workspace.sql(alter/index only)
066066_crm_routing_flag.sql(alter/index only)
067067_burnt_domains_root_domain_grouping.sql(alter/index only)
068068_dedup_aggregation_functions.sql(alter/index only)
069069_client_registry_excluded_zips.sql(alter/index only)
070070_zip_inclusion_mode.sql(alter/index only)
071071_raw_contacts_bypass_routing.sql(alter/index only)
072072_resources.sqlresources, resource_requests
073073_revenue_adjustments.sqlrevenue_refunds, revenue_referrals
073073_task_timeline.sqltask_timeline
074074_client_registry_slack_webhook_commercial.sql(alter/index only)
074074_task_timeline_more_events.sql(alter/index only)
075075_user_profiles_slack_user_id.sql(alter/index only)
076076_slack_event_dedup.sqlslack_event_dedup
076076_verified_contacts_provider.sql(alter/index only)
077077_account_counter_safety.sql(alter/index only)
078078_dedup_campaign_metrics.sql(alter/index only)
079079_audit_phase_a_config_tables.sqlaudit_verticals, audit_recommendation_rules, audit_sync_state
080080_audit_phase_a_rank_tables.sqlaudit_rank_by_subject, audit_rank_by_pitch, audit_rank_by_parent_template, audit_rank_by_master_template, audit_rank_by_step, audit_rank_by_sender_combo, audit_rank_by_sender_domain, audit_rank_by_sender_local_pattern
081081_audit_phase_a_action_tables.sqlaudit_recommendations, audit_deployments, audit_outcomes
081081_xpressdocs_bulk_backfill.sqlxpressdocs_backfill_jobs
082082_audit_phase_a_replies_origins.sqlaudit_replies, audit_origins
083083_audit_phase_a_step_stats.sqlaudit_step_stats
083083_lead_replies_sender_email.sql(alter/index only)
084084_audit_phase_a_senders.sqlaudit_senders
084084_email_account_daily_stats.sqlemail_account_daily_stats
085085_audit_phase_a_origin_outcome.sql(alter/index only)
086086_audit_phase_a_briefings.sqlaudit_briefings
087087_workspace_volume_tracking.sqlworkspace_volume_tracking
088088_drop_volume_tracking_check.sql(alter/index only)
089089_audit_client_category.sql(alter/index only)
090090_billing_audit.sqlbilling_subscriptions, billing_receipts, billing_disputes
091091_billing_reconciliation_columns.sql(alter/index only)
092092_vendor_id_dedup_per_month.sql(alter/index only)
093093_client_registry_slack_webhook_url_commercial.sql(alter/index only)
094094_audit_step_stats_current.sql(alter/index only)
095095_audit_rank_by_pitch_sample_subject.sql(alter/index only)
095095_qualifying_question_conversion.sql(alter/index only)
096096_audit_commercial_recommendation_rules.sql(alter/index only)
097097_audit_stage_runs.sqlaudit_stage_runs
098098_client_registry_exclude_from_dashboard.sql(alter/index only)
099099_scraped_renewal_backfill_rpc.sql(alter/index only)
100100_scraped_renewal_rpc_renewal_formatted.sql(alter/index only)
102102_webhook_ingress_status.sql(alter/index only)
103103_billing_first_interested_rpc.sql(alter/index only)
109109_interested_format_promotions.sqlinterested_format_promotions
110110_email_accounts_mx_checked_at.sql(alter/index only)
111111_dob_backfill_rpc.sql(alter/index only)
112112_infrastructure_summary_rpc.sql(alter/index only)
113113_audit_workspace_pitches.sqlaudit_workspace_pitches
113113_raw_contacts_source_type_datamoon.sql(alter/index only)
114114_audit_audience_stats.sqlaudit_audience_stats
115115_carrier_list_scrub.sqlcarrier_scrub_runs, carrier_affiliations
116116_carrier_scrub_slack_channel.sql(alter/index only)
117117_spam_block_events.sqlspam_block_events
118118_email_conversation_operating_intake_setup.sqloperating_source_accounts, operating_source_events, operating_threads, operating_thread_messages, operating_source_artifacts, operating_intake_runs
118118_slack_operating_intake_capture.sqlslack_conversations, slack_users, slack_events_raw, slack_messages, slack_ingest_runs
119119_client_operating_timeline.sqloperating_timeline_events, operating_timeline_event_links, operating_timeline_export_runs
119119_slack_operating_intake_phase_c_autonomy.sqlslack_channel_policies, slack_channel_coverage_events, operating_intake_items, brain_writeback_queue
120120_client_operating_timeline_view_security.sql(alter/index only)
120120_infra_order_pipeline_v2.sqlclient_onboardings, onboarding_steps
121121_client_onboardings_form_fields.sql(alter/index only)
121121_email_verification_second_pass_queue.sqlemail_verification_second_pass_queue
121121_operating_indexing_engine.sqloperating_entities, operating_entity_matches, operating_intake_classifications, operating_intake_review_items, operating_intake_writebacks, operating_digest_runs
122122_infra_orders_workspace_ingest.sql(alter/index only)
122122_operating_knowledge_promotion.sqloperating_entity_aliases, operating_process_taxonomy, operating_timeline_events, operating_timeline_event_links, operating_promotion_runs, operating_brain_patch_candidates
122122_slack_operating_intake_phase_c_fk_indexes.sql(alter/index only)
123123_client_onboardings_expected_domains.sql(alter/index only)
123123_operating_timeline_event_link_replacement_rpc.sql(alter/index only)
124124_operating_knowledge_promotion_index_cleanup.sql(alter/index only)
125125_operating_timeline_source_first_shape.sql(alter/index only)
126126_brain_patch_path_resolution.sql(alter/index only)
127127_message_context_wiring.sql(alter/index only)
128128_operating_backfill_controller.sqloperating_backfill_jobs, operating_backfill_items
129129_purge_cross_workspace_stat_pollution.sqlstat_pollution_backup_2026_07
130130_purge_volume_tracking_gaudio_copies_0619.sql(alter/index only)
131131_daily_audit_engine.sqlaudit_rules, audit_findings
132132_client_status_onboarding.sql(alter/index only)
133133_operating_timeline_summary_repair_backup.sqloperating_timeline_summary_repair_backup
134134_auto_forward_dropped_producers.sqlauto_forward_config, auto_forward_log
135135_expected_domains_per_provider.sql(alter/index only)
136136_reseller_tags_per_provider.sql(alter/index only)
137137_rename_limits_set_to_warmup_running.sql(alter/index only)
138138_mailbox_counts_per_provider.sql(alter/index only)
139139_chicago_bucket_time_series.sql(alter/index only)
140140_infrastructure_orders_bison_campaign_id.sql(alter/index only)
141141_orders_first_spine.sqlinfra_reconciliation_runs
143143_workspace_diagnostics.sqldiagnostics_runs, workspace_diagnostics_findings, bison_campaign_snapshots
144144_purge_schrauf_phantom_campaign_stats.sql(alter/index only)
145145_channel_client_attribution.sql(alter/index only)
145145_purge_audit_phantom_rows_polluted_workspaces.sql(alter/index only)
146146_email_accounts_order_link.sql(alter/index only)
147147_internal_panels_reseller_configs.sql(alter/index only)
148148_client_registry_google_chat_webhook.sql(alter/index only)
148148_daily_sending_target_audit.sql(alter/index only)
149149_diagnostics_runs_skipped.sql(alter/index only)
150150_audience_rebuild_per_workspace.sql(alter/index only)
151151_client_announcements.sqlclient_announcements, announcement_deliveries, announcement_reads, announcement_email_optouts, announcement_extra_recipients
151151_order_send_activity.sqlorder_send_activity
152152_announcements_webhook_column.sql(alter/index only)
152152_order_send_activity_limit_tracking.sql(alter/index only)
153153_drop_announcement_extra_recipients.sql(alter/index only)
153153_infra_workspace_daily.sqlinfra_workspace_daily
153153_sensor_repair.sql(alter/index only)
154154_announcement_event_engine.sqlannouncement_event_policies
154154_disconnect_state.sqlsender_disconnect_state
155155_announcement_pipeline_enrollment.sqlannouncement_pipeline_enrollment
155155_ramp_executor_rule.sql(alter/index only)
156156_account_deletion_queue.sqlaccount_deletion_queue
157157_reseller_values_confirmed.sql(alter/index only)
158158_burnt_cohorts.sqlburnt_cohorts
159159_send_failure_spike.sql(alter/index only)
160160_summary_freshness.sql(alter/index only)
161161_burnt_domains_warmup_score_gate.sql(alter/index only)
162162_resources_workspace_targeting.sql(alter/index only)
162162_spam_block_events_dsn_body.sql(alter/index only)
163163_burnt_domains_warmup_score_connected_only.sql(alter/index only)
164164_volume_tracking_failed_sends.sql(alter/index only)
165165_burnt_domains_drop_warmup_score_gate.sql(alter/index only)
165165_failed_send_definition_stopped.sql(alter/index only)
165165_reseller_disconnect_slack_channel.sql(alter/index only)
166166_sending_while_prelive.sql(alter/index only)
166166_warmup_health.sqlwarmup_health
167167_announcement_email_override.sql(alter/index only)
168168_client_metrics_measurement_status.sql(alter/index only)
169169_bounce_storm_counts_rpc.sql(alter/index only)
170170_reconnect_attempt_state.sql(alter/index only)
171171_reconnect_domain_exclusions.sqlreconnect_domain_exclusions
172172_ms365_panel_tracking.sqlms365_panels
173173_expired_token_snapshot.sqlexpired_token_snapshot
174174_shared_preferred_zips.sql(alter/index only)
175175_hall_of_fame_quality_gate.sql(alter/index only)
176176_undeliverable_sends_tracking.sql(alter/index only)
177177_reconnect_daily_cohort.sqlreconnect_daily_cohort
178178_reconnect_priority.sql(alter/index only)
178178_schedule_timezone_rule.sql(alter/index only)
178178_windowed_leaderboards.sql(alter/index only)
179179_raw_contacts_scrub_index.sql(alter/index only)
180180_maverick_mcp_registry.sqlmcp_users, mcp_audit_log, key_candidates, mcp_audit_runs, mcp_audit_findings
181181_bounce_wave_autodetach.sql(alter/index only)
182182_revoke_vault_rpc_grants.sql(alter/index only)
183183_job_runs.sqljob_runs
184184_kpi_shadow_compare.sqlkpi_shadow_compare
185185_workspace_window_stats.sqlworkspace_window_stats
186186_intraday_pacing.sqlintraday_snapshots
187187_audience_renewal_timing_and_reply_timing.sqlaudit_reply_timing_stats
188188_audience_income_net_worth.sql(alter/index only)
189189_mcp_known_causes.sqlmcp_known_causes
202608211200202608211200_schema_migrations_ledger.sqlschema_migrations
202608251200202608251200_mcp_mailbox_upload_rule.sql(alter/index only)
202608251730202608251730_registry_identity_integrity.sql(alter/index only)
202608261500202608261500_interested_review_gate.sqlinterested_review_queue
202608271300202608271300_client_registry_lead_cap_exempt.sql(alter/index only)
202609021030202609021030_increment_daily_interested_update_only.sql(alter/index only)
202609050012202609050012_mcp_internal_table_access.sql(alter/index only)
202609061200202609061200_client_registry_bison_instance_maverick_2.sql(alter/index only)
202609071900202609071900_bison_tokens_team_id_per_instance.sql(alter/index only)
202609081700202609081700_tasks_slack_outbound_switch.sql(alter/index only)
202609081710202609081710_mcp_users_user_profile_id.sql(alter/index only)
202609091700202609091700_task_proposals.sqltask_proposal_batches, task_proposals
202609091800202609091800_task_proposal_pending_review.sql(alter/index only)
202609091810202609091810_task_collaborators.sql(alter/index only)
202609091900202609091900_task_bot_events.sqltask_bot_events
202609091910202609091910_task_bot_events_observer_route.sql(alter/index only)
202609100900202609100900_close_wide_open_rls_policies.sql(alter/index only)
202609100901202609100901_email_accounts_instance_identity.sql(alter/index only)
202609100905202609100905_email_accounts_drop_global_sender_unique.sql(alter/index only)
202609100910202609100910_account_sync_waves_presence.sqlaccount_sync_waves
202609100920202609100920_bison_status_canon_check.sql(alter/index only)
202609100925202609100925_account_sync_waves_drift_blocked_status.sql(alter/index only)
202609100930202609100930_summary_presence_rpc.sql(alter/index only)
202609101300202609101300_nurture_queue.sqlnurture_candidates
202609101400202609101400_task_bot_events_task_ids.sql(alter/index only)
202609101700202609101700_nurture_rejected_status.sql(alter/index only)
202609101800202609101800_nurture_send_attempt.sql(alter/index only)
202609101900202609101900_nurture_claims_and_send_check.sql(alter/index only)
202609102000202609102000_nurture_followup_source.sql(alter/index only)
202609111300202609111300_nurture_later_and_review_link.sql(alter/index only)
202609141200202609141200_bison_status_canon_tighten.sql(alter/index only)
202609141200202609141200_nurture_greet_and_links.sql(alter/index only)
202609151100202609151100_present_tag_dimension_rpcs.sql(alter/index only)
202609151130202609151130_task_person_labels.sqltask_person_labels
202609151200202609151200_nurture_targeting.sql(alter/index only)
202609151817202609151817_kpi_client_controls.sqlkpi_client_settings_audit
202609152000202609152000_per_workspace_tag_rpcs.sql(alter/index only)
202609160900202609160900_lifecycle_aggregate_rpcs.sql(alter/index only)
202609161000202609161000_lifecycle_provider_caps.sql(alter/index only)
202609162100202609162100_nurture_lab_runs.sqlnurture_lab_runs
202609171200202609171200_domain_daily_stats.sqldomain_daily_stats, domain_stats_runs
202609172330202609172330_domain_stats_absent.sql(alter/index only)
202609181200202609181200_domain_stats_read_rpcs.sql(alter/index only)
202609181230202609181230_tasks_dm_channel_pin.sql(alter/index only)
202609181400202609181400_infra_account_targets.sqlinfra_sizing_standards, client_infra_targets, infra_targets_audit
202609181600202609181600_drop_unused_raw_contacts_indexes.sql(alter/index only)
202609182000202609182000_domain_burn_by_workspace.sql(alter/index only)
202609190300202609190300_domain_burn_client_lane.sql(alter/index only)
202609191200202609191200_registrar_roster.sqlregistrar_accounts, registrar_domains, registrar_secret_reveals, registrar_burn_seeds
202609191210202609191210_registrar_roster_seed_burn.sql(alter/index only)
202609191500202609191500_aip_ws2_mailin_vendor_orders.sqlinfra_vendor_orders, infra_vendor_tickets, infra_sender_moves, infra_credstore_pulls
202609191900202609191900_registrar_roster_burn_signals.sql(alter/index only)
202609200800202609200800_aip_ws1_pipeline_ledger.sqlinfra_pipeline_steps
202609200900202609200900_aip_ws4_domain_purchase_plans.sqldomain_purchase_plans, domain_purchase_items
202609200910202609200910_aip_ws4_domain_dns_intents.sqldomain_dns_intents
202609201000202609201000_aip_ws3_ms365_provisioning_registry.sqlms365_provisioning_runs, ms365_provisioning_run_logs, ms365_seat_reservations, ms365_recon_findings
202609211500202609211500_domain_burn_root_rule.sql(alter/index only)
2026092121570320260921215703_daily_bounce_candidates.sql(alter/index only)
202609212200202609212200_ms365_panel_tags.sqlms365_domain_tenants, ms365_panel_tag_runs
202609212300202609212300_aip_ws4_assignment_recovery.sqldomain_root_assignments
202609212300202609212300_ms365_panel_tag_runs_mode.sql(alter/index only)
2026092204163620260922041636_aip_ws2_canary_reservations.sqlinfra_ws2_canary_policies, infra_ws2_canary_scopes, infra_ws2_canary_reservations
202609220500202609220500_aip_ws1_observation_history.sqlinfra_pipeline_step_observations
202609220520202609220520_aip_ws4_root_usage_privileges.sql(alter/index only)
202609221100202609221100_ms365_panel_terrl.sql(alter/index only)
202609221100202609221100_task_proposal_collaborators.sql(alter/index only)
202609221200.sql202609221200.sql(alter/index only)
202609221230202609221230_ms365_panel_warmup.sql(alter/index only)
202609221330202609221330_warmup_daily_pull.sql(alter/index only)
2026092214222920260922142229_bounce_digest_receipts.sqlbounce_digest_events
2026092215570420260922155704_aip_ws5_warmup_gate.sqlwarmup_gate_snapshots
2026092216231020260922162310_aip_ws6_infra_board_placement_rpc.sql(alter/index only)
202609231300202609231300_ms365_panel_today.sql(alter/index only)
202609232000.sql202609232000.sql(alter/index only)
202609232200.sql202609232200.sql(alter/index only)
202609240800202609240800_panel_cap_ramp.sqlmailbox_limit_ledger, panel_budget_snapshots
202609240900202609240900_task_reconciler.sqltask_evidence
202609240930202609240930_task_context_outbox.sqlclient_call_notes, vault_outbox
202609241000202609241000_meeting_schedule.sqlmeeting_schedule
202609241300202609241300_work_foundations.sqlwork_ownership_rules, work_rules, work_rule_overrides, work_entity_disagreements
202609241400202609241400_work_items.sqlwork_findings_config, work_findings_log
202609241430202609241430_llm_traces.sqlllm_traces
202609241500202609241500_brain_index.sqlbrain_notes, brain_chunks, brain_links, brain_index_state
202609241530202609241530_work_handoffs.sqlwork_handoffs
202609250800202609250800_lead_loss_checks.sqllead_loss_checks
202609251200202609251200_exec_briefs.sqlexec_briefs, exec_brief_state, exec_brief_feedback
2026092521501520260925215015_aip_ws4_operator_mcp_claim.sqldomain_purchase_operator_attempts
202609270130202609270130_mailin_destination_bindings.sqlinfra_mailin_destination_bindings
2026092701430920260927014309_aip_ws4_operator_expansions.sqldomain_purchase_operator_expansions, domain_purchase_operator_expansion_bindings
2026092701540220260927015402_mailin_scoped_arrival.sql(alter/index only)
2026092718251820260927182518_mailin_pilot_approval.sqlinfra_ws2_canary_revocations
2026092800000120260928000001_ms365_pilot_delivery.sqlms365_pilot_delivery_receipts
2026092804000020260928040000_ms365_child_units_owned_roots.sqldomain_owned_root_adoptions
202609281600202609281600_bounce_signal_windows.sql(alter/index only)
202609281900202609281900_bounce_signal_windows_v2.sql(alter/index only)
202609282100202609282100_bison_change_log.sqlbison_change_log
202609291700202609291700_runtime_policies.sqlruntime_policies
202609292000202609292000_snapshot_mode_trigger.sql(alter/index only)
202609300745202609300745_panel_plan_reviews.sqlpanel_plan_reviews
202609301600202609301600_lead_claim_sync.sqllead_claim_config, lead_owners, lead_claim_events
202610010900202610010900_lead_claim_email_notes.sql(alter/index only)
202610010900202610010900_operator_tables.sqlcampaign_rosters, infra_decisions, infra_runs, email_account_limit_changes, operator_box_stats_cache
202610011100202610011100_operator_box_stats_single_scan.sql(alter/index only)
202610011300202610011300_operator_feedback.sqloperator_feedback
202610011445202610011445_campaign_rosters_page_index.sql(alter/index only)
202610011500202610011500_burnt_lifecycle.sqlburnt_verdicts, burnt_roots, campaign_roster_refreshes
202610011800202610011800_lead_claim_clickup.sqllead_claim_clickup_tasks, lead_claim_clickup_posts, lead_claim_clickup_backlog, lead_claim_clickup_state
202610041300202610041300_ops_alerts.sqlops_alerts, ops_alert_prefs, desktop_app_policy, ops_alert_routes
202610051400202610051400_burnt_probation.sql(alter/index only)
202610051500202610051500_bounce_wave_lane_params.sql(alter/index only)
202610052000202610052000_bounce_wave_operator.sql(alter/index only)
202610052300202610052300_ws4_configurable_claim_pacing.sql(alter/index only)
202610061400202610061400_box_stats_dump_guard.sql(alter/index only)
202610091900202610091900_campaign_pause_operator.sql(alter/index only)
202610092300202610092300_copy_variant_evidence.sql(alter/index only)
202610120115202610120115_copy_reply_lookup.sql(alter/index only)
202610120116202610120116_copy_query_plans.sql(alter/index only)
202610120117202610120117_copy_activity_custom_plan.sql(alter/index only)
202610121200202610121200_ws4_approval_sets_spend_cap.sql(alter/index only)
202610131210202610131210_kpi_reporting_reason.sql(alter/index only)
202610131900202610131900_burnt_winddown.sql(alter/index only)
2026101322000020261013220000_fairplan_replies.sqlfairplan_replies
202610141500202610141500_operator_rails.sqloperator_box_snapshots
202610142200202610142200_operator_origins_ledger.sqloperator_box_origins, operator_fleet_ledger
202610142300202610142300_backup_orders.sql(alter/index only)
202610171210202610171210_registrar_purchase_observations.sqlregistrar_domain_observations
202610171220202610171220_registrar_lifecycle_coverage.sql(alter/index only)
202610171230202610171230_domain_lifecycle_alerts.sqldomain_lifecycle_alert_deliveries, domain_lifecycle_alert_events
202610191200202610191200_registrar_account_coverage.sql(alter/index only)

Tables

user_workspace_access

Multi-tenant user access control - maps users to workspaces with roles

Defined in: 001_create_core_tables.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
user_idUUIDNOT NULL REFERENCES auth.users(id) ON DELETE CASCADE
workspace_nameTEXTNOT NULL
roleTEXTNOT NULL CHECK (role IN ('admin', 'client', 'viewer'))
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

client_registry

Master client registry - single source of truth for all client data

Defined in: 001_create_core_tables.sql

ColumnTypeConstraints
workspace_idSERIALPRIMARY KEY
workspace_nameTEXTNOT NULL UNIQUE
display_nameTEXT
is_activeBOOLEANDEFAULT true
billing_typeTEXTCHECK (billing_type IN ('per_lead', 'retainer'))
price_per_leadDECIMAL(10,2)DEFAULT 0.00
retainer_amountDECIMAL(10,2)DEFAULT 0.00
monthly_kpi_targetINTEGERDEFAULT 0
monthly_contact_targetINTEGERDEFAULT 0
contact_tierTEXTCHECK (contact_tier IN ('100_leads', '200_leads', 'custom'))
daily_sending_targetINTEGERDEFAULT 0
bison_workspace_idINTEGER
bison_api_keyTEXT
bison_instanceTEXT
agency_colorTEXT
airtable_record_idTEXT
client_typeTEXTDEFAULT 'home_insurance'
slack_webhook_urlTEXT
notesTEXT
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

client_settings

Defined in: 001_create_core_tables.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
workspace_nameTEXTUNIQUE REFERENCES public.client_registry(workspace_name) ON DELETE CASCADE
settingsJSONBDEFAULT '{}'::jsonb
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

client_pricing

Defined in: 001_create_core_tables.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
workspace_nameTEXTUNIQUE REFERENCES public.client_registry(workspace_name) ON DELETE CASCADE
billing_typeTEXTCHECK (billing_type IN ('per_lead', 'retainer'))
price_per_leadDECIMAL(10,2)DEFAULT 0.00
retainer_amountDECIMAL(10,2)DEFAULT 0.00
effective_dateDATEDEFAULT CURRENT_DATE
created_atTIMESTAMPTZDEFAULT NOW()

client_costs

Defined in: 001_create_core_tables.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
workspace_nameTEXTREFERENCES public.client_registry(workspace_name) ON DELETE CASCADE
monthTEXTNOT NULL
email_account_costsDECIMAL(10,2)DEFAULT 0.00
labor_costsDECIMAL(10,2)DEFAULT 0.00
other_costsDECIMAL(10,2)DEFAULT 0.00
total_costsDECIMAL(10,2)GENERATED ALWAYS AS (email_account_costs + labor_costs + other_costs) STORED
created_atTIMESTAMPTZDEFAULT NOW()

monthly_revenue_snapshots

Defined in: 001_create_core_tables.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
workspace_nameTEXTREFERENCES public.client_registry(workspace_name) ON DELETE CASCADE
monthTEXTNOT NULL
billable_leadsINTEGERDEFAULT 0
per_lead_revenueDECIMAL(10,2)DEFAULT 0.00
retainer_revenueDECIMAL(10,2)DEFAULT 0.00
total_revenueDECIMAL(10,2)GENERATED ALWAYS AS (per_lead_revenue + retainer_revenue) STORED
snapshot_dateDATEDEFAULT CURRENT_DATE
created_atTIMESTAMPTZDEFAULT NOW()

client_zipcodes

ZIP code assignments by client and month

Defined in: 001_create_core_tables.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
workspace_nameTEXTREFERENCES public.client_registry(workspace_name) ON DELETE CASCADE
zip_codeTEXTNOT NULL
stateTEXTNOT NULL
monthTEXTNOT NULL, -- "2025-11" or "active" for staging
assigned_atTIMESTAMPTZDEFAULT NOW()
created_atTIMESTAMPTZDEFAULT NOW()

raw_contacts

Raw contact uploads from Xpressdocs/Cole X Dates before processing

Defined in: 002_create_contact_pipeline.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
upload_batch_idUUIDNOT NULL DEFAULT gen_random_uuid()
workspace_nameTEXTREFERENCES public.client_registry(workspace_name)
monthTEXTNOT NULL
uploaded_byTEXT
uploaded_atTIMESTAMPTZDEFAULT NOW()
scraping_job_idUUID
zip_codeTEXT
stateTEXT
first_nameTEXT
last_nameTEXT
emailTEXTNOT NULL
phoneTEXT
mailing_addressTEXT
mailing_cityTEXT
mailing_stateTEXT
mailing_zipTEXT
property_addressTEXT
property_cityTEXT
property_stateTEXT
property_zipTEXT
home_value_estimateDECIMAL(12,2)
purchase_dateDATE
processing_statusTEXTDEFAULT 'pending' CHECK (processing_status IN ('pending', 'filtered_out', 'ready_for_verification', 'verified', 'failed'))
is_head_of_householdBOOLEANDEFAULT false
meets_value_criteriaBOOLEANDEFAULT false
is_high_net_worthBOOLEANDEFAULT false
parsed_purchase_dateDATE
filter_reasonTEXT
processed_atTIMESTAMPTZ
created_atTIMESTAMPTZDEFAULT NOW()

verified_contacts

Email-verified contacts ready for weekly batch uploads

Defined in: 002_create_contact_pipeline.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
raw_contact_idBIGINTREFERENCES public.raw_contacts(id) ON DELETE CASCADE
workspace_nameTEXTNOT NULL REFERENCES public.client_registry(workspace_name)
monthTEXTNOT NULL
first_nameTEXT
last_nameTEXT
emailTEXTNOT NULL
property_addressTEXT
property_cityTEXT
property_stateTEXT
property_zipTEXT
home_value_estimateDECIMAL(12,2)
purchase_dateDATE
purchase_dayINTEGER
renewal_start_dateDATE
renewal_end_dateDATE
week_bucketINTEGERCHECK (week_bucket BETWEEN 1 AND 4)
debounce_statusTEXTCHECK (debounce_status IN ('deliverable', 'undeliverable', 'risky', 'unknown', 'pending'))
debounce_responseJSONB
debounce_verified_atTIMESTAMPTZ
debounce_credits_usedINTEGERDEFAULT 1
is_high_net_worthBOOLEANDEFAULT false
target_campaignTEXT
is_uploadedBOOLEANDEFAULT false
upload_batch_idUUID
uploaded_atTIMESTAMPTZ
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

weekly_batches

Tracks each weekly batch upload to Email Bison (every Monday)

Defined in: 002_create_contact_pipeline.sql

ColumnTypeConstraints
batch_idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL REFERENCES public.client_registry(workspace_name)
monthTEXTNOT NULL
week_numberINTEGERNOT NULL CHECK (week_number BETWEEN 1 AND 4)
week_bucketINTEGERNOT NULL CHECK (week_bucket BETWEEN 1 AND 4)
scheduled_upload_dateDATENOT NULL
actual_upload_dateDATE
contact_countINTEGERDEFAULT 0
hnw_countINTEGERDEFAULT 0
csv_file_pathTEXT
csv_generated_atTIMESTAMPTZ
bison_upload_idTEXT
bison_campaign_nameTEXT
bison_upload_statusTEXTDEFAULT 'pending' CHECK (bison_upload_status IN ('pending', 'uploaded', 'added_to_campaign', 'failed'))
bison_error_messageTEXT
slack_notification_sentBOOLEANDEFAULT false
slack_message_tsTEXT
slack_approved_byTEXT
slack_approved_atTIMESTAMPTZ
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

upload_audit_log

Complete audit trail of all automated pipeline operations

Defined in: 002_create_contact_pipeline.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
batch_idUUIDREFERENCES public.weekly_batches(batch_id) ON DELETE CASCADE
workspace_nameTEXTNOT NULL
monthTEXTNOT NULL
actionTEXTNOT NULL CHECK (action IN ('csv_upload', 'contact_verification', 'batch_generation', 'bison_upload', 'campaign_add', 'campaign_rename', 'slack_notification'))
statusTEXTNOT NULL CHECK (status IN ('success', 'partial_success', 'failed'))
contacts_processedINTEGERDEFAULT 0
contacts_succeededINTEGERDEFAULT 0
contacts_failedINTEGERDEFAULT 0
api_endpointTEXT
api_requestJSONB
api_responseJSONB
error_detailsJSONB
duration_msINTEGER
credits_usedINTEGER
performed_byTEXTDEFAULT 'system'
performed_atTIMESTAMPTZDEFAULT NOW()

debounce_usage

Tracks Debounce API credit usage for billing and monitoring

Defined in: 002_create_contact_pipeline.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
monthTEXTNOT NULL
workspace_nameTEXT
batch_idUUIDREFERENCES public.weekly_batches(batch_id)
credits_usedINTEGERNOT NULL DEFAULT 0
emails_verifiedINTEGERNOT NULL DEFAULT 0
deliverable_countINTEGERDEFAULT 0
undeliverable_countINTEGERDEFAULT 0
risky_countINTEGERDEFAULT 0
unknown_countINTEGERDEFAULT 0
verified_atTIMESTAMPTZDEFAULT NOW()

scraping_jobs

Tracks Xpressdocs scraping jobs with status and results

Defined in: 003_create_scraping_jobs.sql

ColumnTypeConstraints
job_idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTREFERENCES public.client_registry(workspace_name)
job_typeTEXTDEFAULT 'xpressdocs_scrape'
stateTEXTNOT NULL
zip_codesTEXT[]NOT NULL
monthTEXTNOT NULL
list_typeTEXTDEFAULT 'Emailing'
statusTEXTDEFAULT 'pending' CHECK (status IN ('pending', 'running', 'completed', 'failed', 'limit_exceeded', 'cancelled'))
progressINTEGERDEFAULT 0
total_zipsINTEGER
processed_zipsINTEGERDEFAULT 0
records_downloadedINTEGERDEFAULT 0
csv_filesTEXT[]
error_messageTEXT
celery_task_idTEXT
started_atTIMESTAMPTZ
completed_atTIMESTAMPTZ
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

scraping_job_logs

Detailed logs for each step of a scraping job

Defined in: 003_create_scraping_jobs.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
job_idUUIDREFERENCES public.scraping_jobs(job_id) ON DELETE CASCADE
stepTEXTNOT NULL
statusTEXTNOT NULL
messageTEXT
zip_codesTEXT[]
records_countINTEGER
logged_atTIMESTAMPTZDEFAULT NOW()

agent_runs

Tracks all automation workflow executions

Defined in: 003_create_scraping_jobs.sql

ColumnTypeConstraints
run_idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workflowTEXTNOT NULL
client_idINTEGERREFERENCES public.client_registry(workspace_id)
siteTEXT
statusTEXTDEFAULT 'running' CHECK (status IN ('running', 'success', 'failed', 'partial'))
started_atTIMESTAMPTZDEFAULT NOW()
finished_atTIMESTAMPTZ
metricsJSONB
trace_urlTEXT
errorTEXT
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

agent_errors

Detailed error tracking with screenshots and traces

Defined in: 003_create_scraping_jobs.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
run_idUUIDREFERENCES public.agent_runs(run_id) ON DELETE CASCADE
stepTEXTNOT NULL
error_typeTEXTNOT NULL
messageTEXTNOT NULL
stack_traceTEXT
screenshot_urlTEXT
trace_urlTEXT
contextJSONB
retry_countINTEGERDEFAULT 0
resolvedBOOLEANDEFAULT false
resolved_atTIMESTAMPTZ
created_atTIMESTAMPTZDEFAULT NOW()

site_credentials

Secure credential storage for external sites

Defined in: 003_create_scraping_jobs.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
siteTEXTNOT NULL
usernameTEXTNOT NULL
secret_refTEXTNOT NULL
state_coverageTEXT[]
mfa_typeTEXT
last_verified_atTIMESTAMPTZ
notesTEXT
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

client_leads

Client portal leads with pipeline management

Defined in: 004_create_lead_management.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
lead_emailTEXT
first_nameTEXT
last_nameTEXT
phoneTEXT
addressTEXT
cityTEXT
stateTEXT
zipTEXT
date_receivedTIMESTAMPTZ
reply_receivedTEXT
email_sentTEXT
email_subjectTEXT
lead_valueDECIMAL(10,2)DEFAULT 500.00
renewal_dateTEXT
birthdayTEXT
campaign_nameTEXT
sender_emailTEXT
icpBOOLEANDEFAULT false
pipeline_stageTEXTDEFAULT 'new'
pipeline_positionINTEGERDEFAULT 0
interestedBOOLEANDEFAULT false
notesTEXT
premium_amountDECIMAL(10,2)
policy_typeTEXT
bison_conversation_urlTEXT
bison_lead_idTEXT
reply_uuidTEXT
custom_variablesJSONB
tagsTEXT[]
airtable_idTEXTUNIQUE
deleted_atTIMESTAMPTZ
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()
last_synced_atTIMESTAMPTZDEFAULT NOW()

email_accounts

Email account inventory with health and capacity tracking

Defined in: 005_create_email_infrastructure.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
email_addressTEXTUNIQUE NOT NULL
workspace_nameTEXTREFERENCES public.client_registry(workspace_name)
statusTEXTDEFAULT 'active'
health_scoreINTEGERDEFAULT 100
daily_sending_limitINTEGERDEFAULT 50
volume_per_accountINTEGERDEFAULT 0
providerTEXT
notesTEXT
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

email_account_metadata

Daily performance metrics for email accounts

Defined in: 005_create_email_infrastructure.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
email_account_idINTEGERREFERENCES public.email_accounts(id) ON DELETE CASCADE
sent_countINTEGERDEFAULT 0
delivered_countINTEGERDEFAULT 0
bounce_rateDECIMAL(5,2)
spam_rateDECIMAL(5,2)
metric_dateDATENOT NULL
created_atTIMESTAMPTZDEFAULT NOW()

email_account_polling

Tracks email account polling job status

Defined in: 005_create_email_infrastructure.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
last_poll_atTIMESTAMPTZ
next_poll_atTIMESTAMPTZ
statusTEXTDEFAULT 'idle'
error_messageTEXT
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

user_profiles

Extended user profile information linked to auth.users

Defined in: 006_create_user_profiles.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY REFERENCES auth.users(id) ON DELETE CASCADE
emailTEXTNOT NULL UNIQUE
full_nameTEXT
avatar_urlTEXT
phoneTEXT
default_workspace_nameTEXTREFERENCES public.client_registry(workspace_name) ON DELETE SET NULL
is_activeBOOLEANDEFAULT true
email_verifiedBOOLEANDEFAULT false
last_login_atTIMESTAMPTZ
login_countINTEGERDEFAULT 0
metadataJSONBDEFAULT '{}'::jsonb
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

client_filter_rules

Client-specific filter rules applied before email verification

Defined in: 008_create_filter_rules.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL REFERENCES public.client_registry(workspace_name) ON DELETE CASCADE
rule_nameTEXTNOT NULL
priorityINTEGERNOT NULL DEFAULT 100, -- Lower number = higher priority
is_activeBOOLEANDEFAULT true
field_nameTEXTNOT NULL, -- Column name in raw_contacts
operatorTEXTNOT NULL CHECK (operator IN (
valueJSONBNOT NULL, -- Expected value (can be string, number, array)
actionTEXTNOT NULL CHECK (action IN ('require', 'reject')), -- What to do if rule matches
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

credential_audit_log

Audit trail for all credential management actions

Defined in: 015_create_credential_audit_log.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
credential_idINTEGERREFERENCES public.site_credentials(id) ON DELETE SET NULL
actionTEXTNOT NULL CHECK (action IN ('created', 'updated', 'deleted', 'tested', 'password_changed', 'accessed'))
performed_byUUIDREFERENCES auth.users(id) ON DELETE SET NULL
ip_addressTEXT
user_agentTEXT
detailsJSONBDEFAULT '{}'::jsonb
previous_stateJSONB
new_stateJSONB
successBOOLEANDEFAULT true
error_messageTEXT
created_atTIMESTAMPTZDEFAULT NOW()

scraping_job_batches

Child table for scraping_jobs. Each batch represents one state being scraped in parallel. Enables 3-5x speedup via concurrent worker execution.

Defined in: 016_create_scraping_job_batches.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
job_idUUIDNOT NULL REFERENCES public.scraping_jobs(job_id) ON DELETE CASCADE
batch_numberINTNOT NULL
stateTEXTNOT NULL
zip_codesTEXT[]NOT NULL
monthTEXTNOT NULL
list_typeTEXTNOT NULL
workspace_nameTEXTNOT NULL
credential_idINTREFERENCES public.site_credentials(id)
statusTEXTNOT NULL DEFAULT 'pending'
celery_task_idTEXTUNIQUE
csv_file_pathTEXT
record_countINTDEFAULT 0
split_countINTDEFAULT 0, -- Number of times batch was split due to 10K limit
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
started_atTIMESTAMPTZ
completed_atTIMESTAMPTZ
duration_secondsINT
retry_countINTDEFAULT 0
max_retriesINTDEFAULT 3
error_messageTEXT
error_typeTEXT,-- 'browser_crash', 'timeout', 'auth_failure', 'network_error'
browser_profileTEXT,-- Chromium profile used
ip_addressTEXT,-- For debugging geolocation issues

campaign_metrics

Stores performance metrics synced from Email Bison campaigns

Defined in: 017_create_campaign_metrics.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
batch_idUUIDREFERENCES public.weekly_batches(batch_id) ON DELETE CASCADE
email_bison_campaign_idTEXTNOT NULL
emails_sentINTDEFAULT 0
emails_deliveredINTDEFAULT 0
emails_bouncedINTDEFAULT 0
emails_openedINTDEFAULT 0
emails_clickedINTDEFAULT 0
emails_repliedINTDEFAULT 0
unsubscribedINTDEFAULT 0
open_rateFLOATDEFAULT 0.0
click_rateFLOATDEFAULT 0.0
reply_rateFLOATDEFAULT 0.0
synced_atTIMESTAMPTZDEFAULT NOW()
created_atTIMESTAMPTZDEFAULT NOW()

debounce_bulk_jobs

Tracks bulk email verification jobs submitted to Debounce Bulk API. Enables 10-100x faster verification compared to sequential API calls. Auto-used when batch_size > 50 emails.

Defined in: 018_create_debounce_bulk_jobs.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
job_idUUIDUNIQUE DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL REFERENCES public.client_registry(workspace_name)
monthTEXTNOT NULL
debounce_list_idTEXTUNIQUE, -- From Debounce API response
debounce_list_nameTEXT
upload_csv_urlTEXTNOT NULL, -- Public URL we sent to Debounce
result_csv_urlTEXT,-- CDN URL from Debounce
storage_pathTEXT,-- Our storage path for cleanup
statusTEXTNOT NULL DEFAULT 'uploading'
percentageINTDEFAULT 0, -- Processing progress (0-100)
total_emailsINTNOT NULL
processed_emailsINTDEFAULT 0
deliverable_countINTDEFAULT 0
undeliverable_countINTDEFAULT 0
risky_countINTDEFAULT 0
unknown_countINTDEFAULT 0
created_atTIMESTAMPTZDEFAULT NOW()
submitted_atTIMESTAMPTZ,-- When sent to Debounce
completed_atTIMESTAMPTZ
downloaded_atTIMESTAMPTZ,-- When results downloaded
error_messageTEXT
retry_countINTDEFAULT 0
max_retriesINTDEFAULT 3
credits_usedINT

filtering_tasks

Tracks filtering task progress for real-time SSE updates to frontend

Defined in: 020_create_task_progress_tables.sql

ColumnTypeConstraints
task_idTEXTPRIMARY KEY
workspace_nameTEXTNOT NULL REFERENCES public.client_registry(workspace_name)
statusTEXTNOT NULL DEFAULT 'pending'
totalINTEGERNOT NULL DEFAULT 0
processedINTEGERNOT NULL DEFAULT 0
passedINTEGERNOT NULL DEFAULT 0
filtered_outINTEGERNOT NULL DEFAULT 0
source_statusTEXTNOT NULL DEFAULT 'pending'
batch_sizeINTEGERNOT NULL DEFAULT 1000
errorTEXT
started_atTIMESTAMPTZ
completed_atTIMESTAMPTZ
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

verification_tasks

Tracks verification task progress for real-time SSE updates to frontend

Defined in: 020_create_task_progress_tables.sql

ColumnTypeConstraints
task_idTEXTPRIMARY KEY
workspace_nameTEXTNOT NULL REFERENCES public.client_registry(workspace_name)
statusTEXTNOT NULL DEFAULT 'pending'
methodTEXTNOT NULL DEFAULT 'sequential'
totalINTEGERNOT NULL DEFAULT 0
processedINTEGERNOT NULL DEFAULT 0
verifiedINTEGERNOT NULL DEFAULT 0
invalidINTEGERNOT NULL DEFAULT 0
unknownINTEGERNOT NULL DEFAULT 0
bulk_job_idTEXT
debounce_statusTEXT
batch_sizeINTEGERNOT NULL DEFAULT 100
errorTEXT
started_atTIMESTAMPTZ
completed_atTIMESTAMPTZ
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

pipeline_runs

Tracks complete pipeline executions from sourcing to Email Bison upload

Defined in: 023_create_pipeline_runs.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
run_idUUIDDEFAULT gen_random_uuid() UNIQUE NOT NULL
workspace_nameTEXTNOT NULL REFERENCES client_registry(workspace_name)
monthTEXTNOT NULL, -- YYYY-MM format
sourceTEXTNOT NULL DEFAULT 'scraper', -- 'scraper', 'master_db', 'csv_upload'
target_volumeINTEGER
stateTEXT
zip_codesTEXT[],-- Array of ZIP codes
statusTEXTNOT NULL DEFAULT 'pending', -- pending, running, completed, failed, cancelled
current_stageTEXTDEFAULT 'init', -- init, scraping, processing, filtering, verifying, batching, uploading, completed
stage_countsJSONBDEFAULT '{}'::jsonb
started_atTIMESTAMPTZ
completed_atTIMESTAMPTZ
error_messageTEXT
error_stageTEXT
celery_task_idsJSONBDEFAULT '{}'::jsonb
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()
created_byUUIDREFERENCES auth.users(id)

client_targets

Monthly KPI targets and progress tracking for Gap-to-Goal dashboard

Defined in: 030_client_targets.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
workspace_nameTEXTNOT NULL REFERENCES public.client_registry(workspace_name)
monthTEXTNOT NULL, -- YYYY-MM format
contact_volume_targetINTEGERDEFAULT 0
email_volume_targetINTEGERDEFAULT 0
lead_targetINTEGERDEFAULT 0
revenue_targetNUMERIC(10,2)DEFAULT 0
contacts_uploadedINTEGERDEFAULT 0
emails_sentINTEGERDEFAULT 0
leads_generatedINTEGERDEFAULT 0
revenue_actualNUMERIC(10,2)DEFAULT 0
contacts_gapINTEGERGENERATED ALWAYS AS (contact_volume_target - contacts_uploaded) STORED
emails_gapINTEGERGENERATED ALWAYS AS (email_volume_target - emails_sent) STORED
leads_gapINTEGERGENERATED ALWAYS AS (lead_target - leads_generated) STORED
revenue_gapNUMERIC(10,2)GENERATED ALWAYS AS (revenue_target - revenue_actual) STORED
contacts_progressNUMERIC(5,2)GENERATED ALWAYS AS (
CASEWHENcontact_volume_target > 0
ELSE0END
emails_progressNUMERIC(5,2)GENERATED ALWAYS AS (
CASEWHENemail_volume_target > 0
ELSE0END
leads_progressNUMERIC(5,2)GENERATED ALWAYS AS (
CASEWHENlead_target > 0
ELSE0END
revenue_progressNUMERIC(5,2)GENERATED ALWAYS AS (
CASEWHENrevenue_target > 0
THENLEAST(ROUND((revenue_actual/ revenue_target * 100), 2), 999.99)
ELSE0END
targets_overriddenBOOLEANDEFAULT false
notesTEXT
last_synced_atTIMESTAMPTZ
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

crm_delivery_log

Tracks all lead deliveries to external CRMs (Agency Zoom, Ricochet, etc.)

Defined in: 031_crm_webhook_integration.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
lead_emailTEXTNOT NULL
bison_lead_idTEXT
bison_reply_idTEXT
crm_typeTEXTNOT NULL, -- 'agency_zoom', 'ricochet', 'ezlynx', 'agency_mvp', 'generic'
crm_endpointTEXTNOT NULL
successBOOLEANNOT NULL DEFAULT FALSE
http_status_codeINTEGER
response_bodyTEXT
error_messageTEXT
attempt_numberINTEGERNOT NULL DEFAULT 1
max_attemptsINTEGERNOT NULL DEFAULT 3
next_retry_atTIMESTAMPTZ
request_payloadJSONB
request_headersJSONB
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
completed_atTIMESTAMPTZ

slack_notifications_sent

Deduplication table for Slack notifications

Defined in: 031_crm_webhook_integration.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
reply_idTEXTNOT NULL
workspace_nameTEXTNOT NULL
notification_typeTEXTNOT NULL, -- 'client', 'global'
lead_emailTEXT
slack_webhook_urlTEXT
sent_atTIMESTAMPTZNOT NULL DEFAULT NOW()

lead_replies

Stores all Email Bison replies for live dashboard and CRM routing

Defined in: 031_crm_webhook_integration.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
lead_emailTEXTNOT NULL
first_nameTEXT
last_nameTEXT
companyTEXT
titleTEXT
phoneTEXT
reply_textTEXT
reply_dateTIMESTAMPTZNOT NULL DEFAULT NOW()
sentimentTEXTCHECK (sentiment IN ('positive', 'negative', 'neutral'))
is_interestedBOOLEANDEFAULT FALSE
confidence_scoreINTEGER
ai_reasoningTEXT
sentiment_sourceTEXTCHECK (sentiment_source IN ('ai', 'bison', 'hybrid', 'manual'))
bison_sentimentTEXT
needs_reviewBOOLEANDEFAULT FALSE
bison_lead_idTEXT
bison_reply_idTEXTUNIQUE
bison_reply_numeric_idINTEGER
bison_conversation_urlTEXT
bison_workspace_idTEXT
live_replies_enabledBOOLEANDEFAULT TRUE
crm_sent_atTIMESTAMPTZ
crm_delivery_statusTEXTCHECK (crm_delivery_status IN ('pending', 'sent', 'failed', 'retrying'))
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

webhook_delivery_log

Logs all incoming Email Bison webhooks for debugging

Defined in: 031_crm_webhook_integration.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
event_typeTEXTNOT NULL
workspace_nameTEXT
payloadJSONBNOT NULL
successBOOLEANNOT NULL DEFAULT FALSE
processing_time_msINTEGER
error_messageTEXT
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

webhook_health

Per-workspace webhook health metrics

Defined in: 031_crm_webhook_integration.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL UNIQUE
last_webhook_atTIMESTAMPTZ
webhook_count_24hINTEGERDEFAULT 0
success_rate_24hNUMERIC(5,2)DEFAULT 100.00
is_healthyBOOLEANDEFAULT TRUE
last_error_messageTEXT
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

home_value_codes

Lookup table for home value codes (A-U) to dollar amounts

Defined in: 032_master_contacts_integration.sql

ColumnTypeConstraints
codeTEXTPRIMARY KEY
min_valueINTEGER
max_valueINTEGER
midpointINTEGERNOT NULL
descriptionTEXT

campaign_crm_routing

Campaign-level CRM routing overrides for workspace defaults

Defined in: 033_campaign_crm_routing.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
campaign_idINTNOT NULL UNIQUE
campaign_nameTEXT,-- For reference/display
workspace_nameTEXTNOT NULL
crm_typeTEXT,-- 'zapier', 'agency_zoom', 'agency_mvp', etc.
external_api_urlTEXTNOT NULL, -- The webhook URL
external_api_tokenTEXT,-- If authentication needed
is_activeBOOLEANDEFAULT true
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

tasks

Defined in: 035_create_tasks_table.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
titleTEXTNOT NULL
descriptionTEXT
assignee_idUUIDREFERENCES public.user_profiles(id) ON DELETE SET NULL
assignee_nameTEXT,-- Denormalized for fast display
created_byUUIDNOT NULL REFERENCES public.user_profiles(id)
statusTEXTNOT NULL DEFAULT 'todo'
priorityTEXTNOT NULL DEFAULT 'medium'
categoryTEXTNOT NULL DEFAULT 'operations'
visibilityTEXTNOT NULL DEFAULT 'team'
due_dateDATE
completed_atTIMESTAMPTZ
sourceJSONBDEFAULT '{}'::jsonb
is_recurringBOOLEANDEFAULT false
recurring_patternTEXT
last_completedTIMESTAMPTZ
last_reminded_atTIMESTAMPTZ
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

auto_reply_config

Defined in: 036_auto_reply_config.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL UNIQUE
enabledBOOLEANNOT NULL DEFAULT false
toneTEXTNOT NULL DEFAULT 'professional'
min_confidence_scoreINTNOT NULL DEFAULT 70
reply_to_interestedBOOLEANNOT NULL DEFAULT true
reply_to_not_interestedBOOLEANNOT NULL DEFAULT false
reply_to_neutralBOOLEANNOT NULL DEFAULT false
skip_auto_repliesBOOLEANNOT NULL DEFAULT true
skip_bouncedBOOLEANNOT NULL DEFAULT true
max_replies_per_hourINTNOT NULL DEFAULT 20
delay_secondsINTNOT NULL DEFAULT 300
custom_instructionsTEXT
created_atTIMESTAMPTZDEFAULT now()
updated_atTIMESTAMPTZDEFAULT now()

auto_reply_log

Defined in: 036_auto_reply_config.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
lead_reply_idUUIDREFERENCES lead_replies(id)
bison_reply_numeric_idINT
lead_emailTEXT
sentimentTEXT
confidence_scoreINT
tone_usedTEXT
reply_textTEXT
model_usedTEXT
sent_successfullyBOOLEANNOT NULL DEFAULT false
skipped_reasonTEXT
error_messageTEXT
processing_time_msINT
created_atTIMESTAMPTZDEFAULT now()

reply_templates

Defined in: 037_thomas_migration_compat.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
workspace_nameTEXTNOT NULL
template_text_with_phoneTEXT
template_text_no_phoneTEXT
cc_emailsJSONBDEFAULT '[]'
special_instructionsTEXT
created_atTIMESTAMPTZDEFAULT now()
updated_atTIMESTAMPTZDEFAULT now()

sent_replies

Defined in: 037_thomas_migration_compat.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
workspace_nameTEXTNOT NULL
bison_reply_idINTEGER
reply_uuidTEXT
lead_nameTEXT
lead_emailTEXT
generated_reply_textTEXT
cc_emailsJSONBDEFAULT '[]'
sent_byTEXT
sent_atTIMESTAMPTZ
statusTEXTDEFAULT 'sent' CHECK (status IN ('pending', 'sent', 'failed', 'draft'))
error_messageTEXT
created_atTIMESTAMPTZDEFAULT now()

sma_policies

Defined in: 037_thomas_migration_compat.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
lead_idUUID
policy_typeTEXT
premium_amountDECIMAL(10,2)
agency_commissionDECIMAL(10,2)
maverick_commissionDECIMAL(10,2)
created_atTIMESTAMPTZDEFAULT now()
updated_atTIMESTAMPTZDEFAULT now()

client_metrics

Defined in: 037_thomas_migration_compat.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
metric_dateDATENOT NULL
metric_typeTEXTDEFAULT 'mtd'
emails_sentINTEGERDEFAULT 0
emails_sent_todayINTEGERDEFAULT 0
emails_sent_mtdINTEGERDEFAULT 0
emails_sent_last_7_daysINTEGERDEFAULT 0
emails_sent_last_14_daysINTEGERDEFAULT 0
emails_sent_last_30_daysINTEGERDEFAULT 0
emails_scheduled_todayINTEGERDEFAULT 0
emails_scheduled_tomorrowINTEGERDEFAULT 0
positive_repliesINTEGERDEFAULT 0
positive_replies_mtdINTEGERDEFAULT 0
positive_replies_current_monthINTEGERDEFAULT 0
positive_replies_last_7_daysINTEGERDEFAULT 0
positive_replies_last_14_daysINTEGERDEFAULT 0
positive_replies_last_30_daysINTEGERDEFAULT 0
positive_replies_last_monthINTEGERDEFAULT 0
all_replies_mtdINTEGERDEFAULT 0
bounced_mtdINTEGERDEFAULT 0
unsubscribed_mtdINTEGERDEFAULT 0
projection_emails_eomINTEGERDEFAULT 0
projection_positive_replies_eomINTEGERDEFAULT 0
mtd_leads_progressDECIMAL(5,2)DEFAULT 0
projection_replies_progressDECIMAL(5,2)DEFAULT 0
last_week_vs_week_before_progressDECIMAL(5,2)DEFAULT 0
created_atTIMESTAMPTZDEFAULT now()
updated_atTIMESTAMPTZDEFAULT now()

monthly_daily_revenue_history

Defined in: 037_thomas_migration_compat.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
month_yearTEXTNOT NULL
dayINTEGERNOT NULL
dateDATE
daily_revenueDECIMAL(10,2)DEFAULT 0
cumulative_revenueDECIMAL(10,2)DEFAULT 0
lead_countINTEGERDEFAULT 0
created_atTIMESTAMPTZDEFAULT now()

workspace_stats_cache

*Pre-computed workspace KPIs rebuilt after every Bison sync. *

Defined in: 042_workspace_stats_cache.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
workspace_nameTEXTNOT NULL
display_nameTEXT
stat_dateDATENOT NULL DEFAULT CURRENT_DATE
emails_sentBIGINTNOT NULL DEFAULT 0
total_leads_contactedBIGINTNOT NULL DEFAULT 0
openedBIGINTNOT NULL DEFAULT 0
unique_repliesBIGINTNOT NULL DEFAULT 0
bouncedBIGINTNOT NULL DEFAULT 0
interestedBIGINTNOT NULL DEFAULT 0
not_interestedBIGINTNOT NULL DEFAULT 0
unsubscribedBIGINTNOT NULL DEFAULT 0
open_rateNUMERIC(6,2)NOT NULL DEFAULT 0
reply_rateNUMERIC(6,2)NOT NULL DEFAULT 0
bounce_rateNUMERIC(6,2)NOT NULL DEFAULT 0
interested_percentageNUMERIC(6,2)NOT NULL DEFAULT 0
cache_typeTEXTNOT NULL DEFAULT 'current'
synced_atTIMESTAMPTZNOT NULL DEFAULT NOW()

pipeline_stats_cache

Pre-computed pipeline statistics per workspace per month. Refreshed by Celery workers after pipeline stage completions and every 5 minutes by Celery Beat.

Defined in: 044_pipeline_stats_cache_table.sql

ColumnTypeConstraints
workspace_nameTEXTNOT NULL
monthTEXTNOT NULL
total_contactsBIGINTDEFAULT 0
pendingBIGINTDEFAULT 0
filtered_outBIGINTDEFAULT 0
ready_for_verificationBIGINTDEFAULT 0
verifyingBIGINTDEFAULT 0
verifiedBIGINTDEFAULT 0
invalidBIGINTDEFAULT 0
unknownBIGINTDEFAULT 0
source_scrapedBIGINTDEFAULT 0
source_uploadedBIGINTDEFAULT 0
source_master_dbBIGINTDEFAULT 0
total_verifiedBIGINTDEFAULT 0
uploadedBIGINTDEFAULT 0
pending_uploadBIGINTDEFAULT 0
rejectedBIGINTDEFAULT 0
failedBIGINTDEFAULT 0
deliverable_countBIGINTDEFAULT 0
undeliverable_countBIGINTDEFAULT 0
risky_countBIGINTDEFAULT 0
updated_atTIMESTAMPTZDEFAULT now()

workspace_daily_stats

Daily incremental metrics per workspace from Bison chart API. Used for charts and date-filtered KPIs.

Defined in: 045_workspace_daily_stats.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
workspace_nameTEXTNOT NULL
stat_dateDATENOT NULL
sentBIGINTNOT NULL DEFAULT 0
repliedBIGINTNOT NULL DEFAULT 0
interestedBIGINTNOT NULL DEFAULT 0
bouncedBIGINTNOT NULL DEFAULT 0
total_opensBIGINTNOT NULL DEFAULT 0
unique_opensBIGINTNOT NULL DEFAULT 0
unsubscribedBIGINTNOT NULL DEFAULT 0
synced_atTIMESTAMPTZNOT NULL DEFAULT NOW()

reseller_configs

Defined in: 048_infrastructure_orders.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
reseller_nameTEXTNOT NULL
display_nameTEXTNOT NULL
account_typeTEXTNOT NULL
account_type_displayTEXTNOT NULL
bison_provider_tagTEXTNOT NULL
bison_reseller_tagTEXTNOT NULL
max_send_per_dayINTEGERNOT NULL
warmup_volume_per_dayINTEGERNOT NULL
warmup_period_daysINTEGERNOT NULL
ramp_startINTEGERNOT NULL
ramp_incrementINTEGERNOT NULL
ramp_increment_interval_daysINTEGERNOT NULL DEFAULT 1
cost_per_inboxDECIMAL(10,2)
is_activeBOOLEANDEFAULT true
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

infrastructure_orders

Defined in: 048_infrastructure_orders.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
workspace_nameTEXTNOT NULL REFERENCES public.client_registry(workspace_name)
reseller_config_idINTEGERNOT NULL REFERENCES public.reseller_configs(id)
quantityINTEGERNOT NULL
emails_per_inbox_per_dayINTEGERNOT NULL
stageTEXTNOT NULL DEFAULT 'order_placed'
expected_provider_tagTEXT
expected_reseller_tagTEXT
expected_date_tagTEXT
fulfilled_atTIMESTAMPTZ
fulfilled_account_countINTEGERDEFAULT 0
warmup_verified_atTIMESTAMPTZ
launch_dateDATE
ramp_started_atTIMESTAMPTZ
completed_atTIMESTAMPTZ
matched_account_idsJSONBDEFAULT '[]'::jsonb
notesTEXT
created_byTEXT
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

infrastructure_order_events

Defined in: 048_infrastructure_orders.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
order_idINTEGERNOT NULL REFERENCES public.infrastructure_orders(id) ON DELETE CASCADE
from_stageTEXT
to_stageTEXTNOT NULL
event_typeTEXTNOT NULL
detailTEXT
created_byTEXT
created_atTIMESTAMPTZDEFAULT NOW()

onboarding_drafts

Defined in: 052_onboarding_drafts.sql

ColumnTypeConstraints
idUUIDDEFAULT gen_random_uuid() PRIMARY KEY
created_byUUIDREFERENCES auth.users(id)
wizard_stateJSONBNOT NULL DEFAULT '{}'
current_stepINTEGERNOT NULL DEFAULT 1
workspace_nameTEXT
display_nameTEXT
statusTEXTNOT NULL DEFAULT 'in_progress' CHECK (status IN ('in_progress', 'completed', 'abandoned'))
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

agent_threads

Defined in: 053_agent_conversations.sql

ColumnTypeConstraints
idUUIDDEFAULT gen_random_uuid() PRIMARY KEY
user_idUUIDNOT NULL REFERENCES auth.users(id)
titleTEXT
session_idTEXT
is_archivedBOOLEANDEFAULT false
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

agent_messages

Defined in: 053_agent_conversations.sql

ColumnTypeConstraints
idUUIDDEFAULT gen_random_uuid() PRIMARY KEY
thread_idUUIDNOT NULL REFERENCES agent_threads(id) ON DELETE CASCADE
roleTEXTNOT NULL CHECK (role IN ('user', 'assistant', 'system'))
contentTEXT
tool_callsJSONB
token_usageJSONB
created_atTIMESTAMPTZDEFAULT NOW()

task_events

Lightweight task event log for status page. Auto-pruned to 7 days.

Defined in: 059_task_events.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
task_idTEXTNOT NULL
task_nameTEXTNOT NULL
queueTEXT
statusTEXTNOT NULL CHECK (status IN ('started', 'succeeded', 'failed', 'retried'))
error_messageTEXT
duration_secondsFLOAT
workerTEXT
created_atTIMESTAMPTZDEFAULT NOW()

hall_of_fame_nominations

Defined in: 060_hall_of_fame.sql

ColumnTypeConstraints
idUUIDDEFAULT gen_random_uuid() PRIMARY KEY
lead_reply_idUUIDNOT NULL REFERENCES public.lead_replies(id) ON DELETE CASCADE
categoryTEXTNOT NULL CHECK (category IN ('funny', 'rude', 'wholesome', 'creative', 'unhinged'))
nominated_byTEXTNOT NULL, -- user email or 'ai_system'
nomination_sourceTEXTNOT NULL DEFAULT 'manual'
ai_confidenceINTEGER,-- 0-100, only for ai_detected
noteTEXT,-- optional comment from nominator
workspace_nameTEXTNOT NULL
lead_emailTEXTNOT NULL
reply_textTEXTNOT NULL
reply_dateTIMESTAMPTZNOT NULL
vote_countINTEGERNOT NULL DEFAULT 0, -- materialized via trigger
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

hall_of_fame_votes

Defined in: 060_hall_of_fame.sql

ColumnTypeConstraints
idUUIDDEFAULT gen_random_uuid() PRIMARY KEY
nomination_idUUIDNOT NULL REFERENCES public.hall_of_fame_nominations(id) ON DELETE CASCADE
user_emailTEXTNOT NULL
created_atTIMESTAMPTZDEFAULT NOW()

task_activity

Defined in: 060_tasks_v2.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
task_idUUIDNOT NULL REFERENCES public.tasks(id) ON DELETE CASCADE
event_typeTEXTNOT NULL CHECK (event_type IN (
actor_idUUIDREFERENCES public.user_profiles(id)
payloadJSONBDEFAULT '{}'::jsonb
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

ai_generation_log

Defined in: 064_reply_ai_upgrade.sql

ColumnTypeConstraints
idUUIDDEFAULT gen_random_uuid() PRIMARY KEY
workspace_nameTEXTNOT NULL
lead_reply_idUUID
task_typeTEXTNOT NULL
modelTEXTNOT NULL
prompt_tokensINT
completion_tokensINT
estimated_cost_usdNUMERIC(10,6)
latency_msINT
intentTEXT
toneTEXT
successBOOLEANDEFAULT TRUE
error_messageTEXT
created_atTIMESTAMPTZDEFAULT NOW()

prompt_eval_results

Defined in: 064_reply_ai_upgrade.sql

ColumnTypeConstraints
idUUIDDEFAULT gen_random_uuid() PRIMARY KEY
workspace_nameTEXTNOT NULL
eval_typeTEXTNOT NULL
total_testsINTNOT NULL
passedINTNOT NULL
failedINTNOT NULL
resultsJSONBNOT NULL
model_usedTEXT
triggered_byTEXT
created_atTIMESTAMPTZDEFAULT NOW()

crm_destinations

*Multi-destination CRM routing. Each row represents one CRM destination *

Defined in: 065_crm_destinations.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
workspace_nameTEXTNOT NULL
campaign_idINT
crm_typeTEXTNOT NULL
external_api_urlTEXTNOT NULL
external_api_tokenTEXT
crm_paramsJSONBNOT NULL DEFAULT '{}'::jsonb
labelTEXT
is_activeBOOLEANNOT NULL DEFAULT TRUE
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

resources

*Global content library shown on the /resources page. Visible to every *

Defined in: 072_resources.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
titleTEXTNOT NULL
descriptionTEXT
categoryTEXTNOT NULL
resource_typeTEXTNOT NULL
loom_urlTEXT
article_contentTEXT
pdf_storage_pathTEXT
thumbnail_urlTEXT
publishedBOOLEANNOT NULL DEFAULT TRUE
created_byUUID
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()
ANDarticle_contentIS NULL AND pdf_storage_path IS NULL)
ANDloom_urlIS NULL AND pdf_storage_path IS NULL)
ANDloom_urlIS NULL AND article_content IS NULL)

resource_requests

*Topic/video requests submitted by clients via the Resources page. *

Defined in: 072_resources.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
requester_user_idUUIDNOT NULL
requester_emailTEXTNOT NULL
workspace_nameTEXT
topicTEXTNOT NULL
requested_formatTEXTNOT NULL
descriptionTEXT
statusTEXTNOT NULL DEFAULT 'requested'
fulfilled_resource_idUUIDREFERENCES resources(id) ON DELETE SET NULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

revenue_refunds

Defined in: 073_revenue_adjustments.sql

ColumnTypeConstraints
idUUIDDEFAULT gen_random_uuid() PRIMARY KEY
workspace_nameTEXTNOT NULL
monthTEXTNOT NULL CHECK (month ~ '^\d{4}-(0[1-9]|1[0-2])$')
lead_nameTEXTNOT NULL
lead_emailTEXT
reasonTEXT
amount_overrideNUMERIC(10,2)
price_per_lead_snapshotNUMERIC(10,2)
created_byUUIDREFERENCES auth.users(id) ON DELETE SET NULL
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

revenue_referrals

Defined in: 073_revenue_adjustments.sql

ColumnTypeConstraints
idUUIDDEFAULT gen_random_uuid() PRIMARY KEY
workspace_nameTEXTNOT NULL
monthTEXTNOT NULL CHECK (month ~ '^\d{4}-(0[1-9]|1[0-2])$')
referred_partyTEXT
credit_amountNUMERIC(10,2) NOT NULL DEFAULT 500
notesTEXT
created_byUUIDREFERENCES auth.users(id) ON DELETE SET NULL
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

task_timeline

Defined in: 073_task_timeline.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
task_idUUIDNOT NULL REFERENCES public.tasks(id) ON DELETE CASCADE
kindTEXTNOT NULL CHECK (kind IN ('system', 'comment'))
event_typeTEXTCHECK (event_type IN (
payloadJSONBDEFAULT '{}'::jsonb
bodyTEXT
edited_atTIMESTAMPTZ
deleted_atTIMESTAMPTZ
slack_message_tsTEXT
actor_idUUIDREFERENCES public.user_profiles(id)
sourceTEXTNOT NULL DEFAULT 'dashboard'
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

slack_event_dedup

Defined in: 076_slack_event_dedup.sql

ColumnTypeConstraints
event_idTEXTPRIMARY KEY
processed_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_verticals

*Per-vertical configuration for audit discovery + ranking. JSONB regex *

Defined in: 079_audit_phase_a_config_tables.sql

ColumnTypeConstraints
vertical_idTEXTPRIMARY KEY
display_nameTEXTNOT NULL
discovery_include_patternsJSONBNOT NULL DEFAULT '[]'::jsonb
discovery_exclude_patternsJSONBNOT NULL DEFAULT '[]'::jsonb
default_thresholdsJSONBNOT NULL DEFAULT '{}'::jsonb
enabledBOOLEANNOT NULL DEFAULT true
notesTEXT
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_recommendation_rules

*Tunable thresholds per (loop_type, vertical_id). audit.generate_recommendations *

Defined in: 079_audit_phase_a_config_tables.sql

ColumnTypeConstraints
rule_idBIGSERIALPRIMARY KEY
loop_typeTEXTNOT NULL CHECK (loop_type IN (
vertical_idTEXTNOT NULL REFERENCES audit_verticals(vertical_id) ON DELETE RESTRICT
threshold_jsonJSONBNOT NULL DEFAULT '{}'::jsonb
enabledBOOLEANNOT NULL DEFAULT true
notesTEXT
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_sync_state

*Per-(workspace, campaign, stage) ingest checkpoint. Drives incremental *

Defined in: 079_audit_phase_a_config_tables.sql

ColumnTypeConstraints
workspace_nameTEXTNOT NULL
campaign_idTEXTNOT NULL
stageTEXTNOT NULL CHECK (stage IN (
vertical_idTEXTREFERENCES audit_verticals(vertical_id) ON DELETE SET NULL
last_audited_atTIMESTAMPTZ
last_statusTEXTNOT NULL DEFAULT 'pending' CHECK (last_status IN (
last_errorTEXT
rows_processedINTEGER
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_rank_by_subject

Per-subject leaderboard. Rebuilt nightly by audit.aggregate_rankings.

Defined in: 080_audit_phase_a_rank_tables.sql

ColumnTypeConstraints
vertical_idTEXTNOT NULL REFERENCES audit_verticals(vertical_id) ON DELETE CASCADE
subject_normTEXTNOT NULL
sendsINTEGERNOT NULL DEFAULT 0
interestedINTEGERNOT NULL DEFAULT 0
any_replyINTEGERNOT NULL DEFAULT 0
interested_rate_pctNUMERIC(8,4)
any_reply_rate_pctNUMERIC(8,4)
interested_rate_lower_pctNUMERIC(8,4)
interested_rate_upper_pctNUMERIC(8,4)
below_thresholdBOOLEANNOT NULL DEFAULT false
last_computed_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_rank_by_pitch

Per-pitch_body_fingerprint leaderboard. Rebuilt nightly.

Defined in: 080_audit_phase_a_rank_tables.sql

ColumnTypeConstraints
vertical_idTEXTNOT NULL REFERENCES audit_verticals(vertical_id) ON DELETE CASCADE
pitch_body_fingerprintTEXTNOT NULL
sendsINTEGERNOT NULL DEFAULT 0
interestedINTEGERNOT NULL DEFAULT 0
any_replyINTEGERNOT NULL DEFAULT 0
interested_rate_pctNUMERIC(8,4)
any_reply_rate_pctNUMERIC(8,4)
interested_rate_lower_pctNUMERIC(8,4)
interested_rate_upper_pctNUMERIC(8,4)
below_thresholdBOOLEANNOT NULL DEFAULT false
last_computed_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_rank_by_parent_template

Per-parent-template leaderboard. Rebuilt nightly.

Defined in: 080_audit_phase_a_rank_tables.sql

ColumnTypeConstraints
vertical_idTEXTNOT NULL REFERENCES audit_verticals(vertical_id) ON DELETE CASCADE
parent_template_idTEXTNOT NULL
sendsINTEGERNOT NULL DEFAULT 0
interestedINTEGERNOT NULL DEFAULT 0
any_replyINTEGERNOT NULL DEFAULT 0
interested_rate_pctNUMERIC(8,4)
any_reply_rate_pctNUMERIC(8,4)
interested_rate_lower_pctNUMERIC(8,4)
interested_rate_upper_pctNUMERIC(8,4)
below_thresholdBOOLEANNOT NULL DEFAULT false
last_computed_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_rank_by_master_template

Per-master-template-family leaderboard. Rebuilt nightly.

Defined in: 080_audit_phase_a_rank_tables.sql

ColumnTypeConstraints
vertical_idTEXTNOT NULL REFERENCES audit_verticals(vertical_id) ON DELETE CASCADE
master_template_idTEXTNOT NULL
sendsINTEGERNOT NULL DEFAULT 0
interestedINTEGERNOT NULL DEFAULT 0
any_replyINTEGERNOT NULL DEFAULT 0
interested_rate_pctNUMERIC(8,4)
any_reply_rate_pctNUMERIC(8,4)
interested_rate_lower_pctNUMERIC(8,4)
interested_rate_upper_pctNUMERIC(8,4)
below_thresholdBOOLEANNOT NULL DEFAULT false
last_computed_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_rank_by_step

Per-step-position rollup across all campaigns. Rebuilt nightly.

Defined in: 080_audit_phase_a_rank_tables.sql

ColumnTypeConstraints
vertical_idTEXTNOT NULL REFERENCES audit_verticals(vertical_id) ON DELETE CASCADE
step_positionINTEGERNOT NULL CHECK (step_position >= 1)
sendsINTEGERNOT NULL DEFAULT 0
interestedINTEGERNOT NULL DEFAULT 0
any_replyINTEGERNOT NULL DEFAULT 0
interested_rate_pctNUMERIC(8,4)
any_reply_rate_pctNUMERIC(8,4)
interested_rate_lower_pctNUMERIC(8,4)
interested_rate_upper_pctNUMERIC(8,4)
below_thresholdBOOLEANNOT NULL DEFAULT false
last_computed_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_rank_by_sender_combo

(local_pattern × domain_prefix × domain_suffix × legal_suffix) grid for mailbox ordering recs.

Defined in: 080_audit_phase_a_rank_tables.sql

ColumnTypeConstraints
vertical_idTEXTNOT NULL REFERENCES audit_verticals(vertical_id) ON DELETE CASCADE
local_patternTEXTNOT NULL
domain_prefix_tokenTEXTNOT NULL
domain_suffix_tokenTEXTNOT NULL
legal_suffix_flagBOOLEANNOT NULL DEFAULT false
mailbox_countINTEGERNOT NULL DEFAULT 0
domain_countINTEGERNOT NULL DEFAULT 0
emails_sentINTEGERNOT NULL DEFAULT 0
unique_repliedINTEGERNOT NULL DEFAULT 0
bouncedINTEGERNOT NULL DEFAULT 0
unsubscribedINTEGERNOT NULL DEFAULT 0
origin_interestedINTEGERNOT NULL DEFAULT 0
origin_any_replyINTEGERNOT NULL DEFAULT 0
interested_per_send_pctNUMERIC(8,4)
reply_rate_pctNUMERIC(8,4)
bounce_rate_pctNUMERIC(8,4)
interested_per_send_lower_pctNUMERIC(8,4)
interested_per_send_upper_pctNUMERIC(8,4)
reply_rate_lower_pctNUMERIC(8,4)
below_thresholdBOOLEANNOT NULL DEFAULT false
last_computed_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_rank_by_sender_domain

Per-domain sender rollup.

Defined in: 080_audit_phase_a_rank_tables.sql

ColumnTypeConstraints
vertical_idTEXTNOT NULL REFERENCES audit_verticals(vertical_id) ON DELETE CASCADE
domainTEXTNOT NULL
mailbox_countINTEGERNOT NULL DEFAULT 0
emails_sentINTEGERNOT NULL DEFAULT 0
unique_repliedINTEGERNOT NULL DEFAULT 0
bouncedINTEGERNOT NULL DEFAULT 0
unsubscribedINTEGERNOT NULL DEFAULT 0
origin_interestedINTEGERNOT NULL DEFAULT 0
origin_any_replyINTEGERNOT NULL DEFAULT 0
interested_per_send_pctNUMERIC(8,4)
reply_rate_pctNUMERIC(8,4)
bounce_rate_pctNUMERIC(8,4)
interested_per_send_lower_pctNUMERIC(8,4)
interested_per_send_upper_pctNUMERIC(8,4)
reply_rate_lower_pctNUMERIC(8,4)
below_thresholdBOOLEANNOT NULL DEFAULT false
last_computed_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_rank_by_sender_local_pattern

Per local-part naming-pattern rollup.

Defined in: 080_audit_phase_a_rank_tables.sql

ColumnTypeConstraints
vertical_idTEXTNOT NULL REFERENCES audit_verticals(vertical_id) ON DELETE CASCADE
local_patternTEXTNOT NULL
mailbox_countINTEGERNOT NULL DEFAULT 0
domain_countINTEGERNOT NULL DEFAULT 0
emails_sentINTEGERNOT NULL DEFAULT 0
unique_repliedINTEGERNOT NULL DEFAULT 0
bouncedINTEGERNOT NULL DEFAULT 0
unsubscribedINTEGERNOT NULL DEFAULT 0
origin_interestedINTEGERNOT NULL DEFAULT 0
origin_any_replyINTEGERNOT NULL DEFAULT 0
interested_per_send_pctNUMERIC(8,4)
reply_rate_pctNUMERIC(8,4)
bounce_rate_pctNUMERIC(8,4)
interested_per_send_lower_pctNUMERIC(8,4)
interested_per_send_upper_pctNUMERIC(8,4)
reply_rate_lower_pctNUMERIC(8,4)
below_thresholdBOOLEANNOT NULL DEFAULT false
last_computed_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_recommendations

*Action layer output. Written by audit.generate_recommendations nightly. *

Defined in: 081_audit_phase_a_action_tables.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
vertical_idTEXTNOT NULL REFERENCES audit_verticals(vertical_id) ON DELETE RESTRICT
workspace_nameTEXTNOT NULL
loop_typeTEXTNOT NULL CHECK (loop_type IN (
statusTEXTNOT NULL DEFAULT 'new' CHECK (status IN (
evidence_payloadJSONBNOT NULL DEFAULT '{}'::jsonb
proposed_actionJSONBNOT NULL DEFAULT '{}'::jsonb
projected_lift_ppNUMERIC(8,4)
wilson_lower_current_pctNUMERIC(8,4)
wilson_lower_proposed_pctNUMERIC(8,4)
generated_atTIMESTAMPTZNOT NULL DEFAULT NOW()
expires_atTIMESTAMPTZNOT NULL DEFAULT (NOW() + INTERVAL '30 days')
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_deployments

*When a recommendation was acted on. signal_source distinguishes auto-detected *

Defined in: 081_audit_phase_a_action_tables.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
recommendation_idBIGINTNOT NULL REFERENCES audit_recommendations(id) ON DELETE CASCADE
signal_sourceTEXTNOT NULL CHECK (signal_source IN ('auto', 'manual'))
allocation_pctNUMERIC(5,2)NOT NULL DEFAULT 100
deployed_atTIMESTAMPTZNOT NULL DEFAULT NOW()
deployed_byTEXT
notesTEXT
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_outcomes

Post-deploy Wilson CI verdict, written by audit.measure_outcomes 14d after deploy.

Defined in: 081_audit_phase_a_action_tables.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
deployment_idBIGINTNOT NULL REFERENCES audit_deployments(id) ON DELETE CASCADE
measured_atTIMESTAMPTZNOT NULL DEFAULT NOW()
sample_size_postINTEGERNOT NULL DEFAULT 0
interested_postINTEGERNOT NULL DEFAULT 0
interested_rate_post_pctNUMERIC(8,4)
wilson_lower_post_pctNUMERIC(8,4)
wilson_upper_post_pctNUMERIC(8,4)
verdictTEXTNOT NULL CHECK (verdict IN (
notesTEXT
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

xpressdocs_backfill_jobs

*One row per (state, month, zip_batch) scrape job for the 12-month bulk *

Defined in: 081_xpressdocs_bulk_backfill.sql

ColumnTypeConstraints
job_idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
stateTEXTNOT NULL
month_yearTEXTNOT NULL, -- e.g. '2026-06'
month_nameTEXTNOT NULL, -- e.g. 'June'
zip_batchTEXT[]NOT NULL, -- up to 25 ZIPs
zip_batch_hashTEXTNOT NULL, -- SHA256(sorted batch) for uniqueness
credential_idINTEGERNOT NULL REFERENCES site_credentials(id) ON DELETE RESTRICT
credential_usernameTEXTNOT NULL
statusTEXTNOT NULL DEFAULT 'pending'
attemptsINTEGERNOT NULL DEFAULT 0
last_errorTEXT
scraping_job_idUUIDREFERENCES scraping_jobs(job_id) ON DELETE SET NULL
records_downloadedINTEGER
storage_pathsTEXT[]
hetzner_synced_atTIMESTAMPTZ
hetzner_rows_insertedINTEGER
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_replies

*Per-reply data ingested from Bison /api/campaigns/{id}/replies. *

Defined in: 082_audit_phase_a_replies_origins.sql

ColumnTypeConstraints
workspace_nameTEXTNOT NULL
bison_reply_idBIGINTNOT NULL
campaign_idTEXTNOT NULL
scheduled_email_idBIGINT,-- FK reference (logical) to audit_origins
folderTEXT,-- 'interested', 'positive', 'maybe', etc. from Bison
is_interestedBOOLEAN
sentimentTEXT
lead_idBIGINT
lead_emailTEXT
sender_email_idBIGINT
sender_emailTEXT
received_atTIMESTAMPTZ
raw_payloadJSONB
last_synced_atTIMESTAMPTZNOT NULL DEFAULT NOW()
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_origins

*Slim copy of /api/scheduled-emails/{id} for every reply origin. *

Defined in: 082_audit_phase_a_replies_origins.sql

ColumnTypeConstraints
workspace_nameTEXTNOT NULL
bison_scheduled_email_idBIGINTNOT NULL
campaign_idTEXT
sequence_step_idBIGINT
thread_replyBOOLEAN
email_subjectTEXT
email_bodyTEXT,-- kept for fingerprint / pitch analysis
statusTEXT,-- sent, scheduled, paused, etc.
scheduled_dateTIMESTAMPTZ
sent_atTIMESTAMPTZ
opensINTEGER
clicksINTEGER
repliesINTEGER
interestedINTEGER
unique_repliesINTEGER
unique_opensINTEGER
raw_message_idTEXT
lead_idBIGINT
lead_emailTEXT
lead_first_nameTEXT
lead_last_nameTEXT
lead_companyTEXT
sender_email_idBIGINT
sender_emailTEXT
last_synced_atTIMESTAMPTZNOT NULL DEFAULT NOW()
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_step_stats

*Daily snapshot of per-step Bison campaign stats. Drives ranking aggregations. *

Defined in: 083_audit_phase_a_step_stats.sql

ColumnTypeConstraints
workspace_nameTEXTNOT NULL
campaign_idTEXTNOT NULL
sequence_step_idBIGINTNOT NULL
stat_dateDATENOT NULL
email_subjectTEXT
sentINTEGERNOT NULL DEFAULT 0
leads_contactedINTEGERNOT NULL DEFAULT 0
unique_repliesINTEGERNOT NULL DEFAULT 0
interestedINTEGERNOT NULL DEFAULT 0
bouncedINTEGERNOT NULL DEFAULT 0
unsubscribedINTEGERNOT NULL DEFAULT 0
unique_opensINTEGERNOT NULL DEFAULT 0
last_synced_atTIMESTAMPTZNOT NULL DEFAULT NOW()
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_senders

*Per-mailbox Bison sender info with parsed naming-pattern fields. *

Defined in: 084_audit_phase_a_senders.sql

ColumnTypeConstraints
workspace_nameTEXTNOT NULL
sender_email_idBIGINTNOT NULL
emailTEXTNOT NULL
local_patternTEXT,-- e.g. 'first.last', 'flast', 'fl'
domainTEXT
domain_prefix_tokenTEXT,-- first token, e.g. 'ask' in askwallaceagency
domain_business_typeTEXT,-- 'agency' | 'insurance' | NULL
domain_modifier_suffixTEXT,-- 'corp' | 'team' | 'pro' | NULL
domain_legal_suffixTEXT,-- 'llc' | 'inc' | NULL
legal_suffix_flagBOOLEANNOT NULL DEFAULT false
statusTEXT,-- 'active' | 'paused' | 'archived' | ...
nameTEXT
lifetime_emails_sentINTEGERNOT NULL DEFAULT 0
unique_repliedINTEGERNOT NULL DEFAULT 0
bouncedINTEGERNOT NULL DEFAULT 0
unsubscribedINTEGERNOT NULL DEFAULT 0
interested_leads_countINTEGERNOT NULL DEFAULT 0
created_at_bisonTIMESTAMPTZ
updated_at_bisonTIMESTAMPTZ
last_synced_atTIMESTAMPTZNOT NULL DEFAULT NOW()
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

email_account_daily_stats

*Per-email-account daily snapshot for rolling-30-day burn detection. *

Defined in: 084_email_account_daily_stats.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
email_addressTEXTNOT NULL
workspace_nameTEXTNOT NULL
stat_dateDATENOT NULL
sentINTEGERNOT NULL DEFAULT 0
repliedINTEGERNOT NULL DEFAULT 0
bouncedINTEGERNOT NULL DEFAULT 0
interestedINTEGERNOT NULL DEFAULT 0
cumulative_sent_at_eodINTEGERNOT NULL DEFAULT 0
cumulative_replied_at_eodINTEGERNOT NULL DEFAULT 0
cumulative_bounced_at_eodINTEGERNOT NULL DEFAULT 0
cumulative_interested_at_eodINTEGERNOT NULL DEFAULT 0
delta_anomalyBOOLEANNOT NULL DEFAULT FALSE
synced_atTIMESTAMPTZNOT NULL DEFAULT NOW()
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_briefings

*Per-client rendered Markdown briefings. Written nightly by *

Defined in: 086_audit_phase_a_briefings.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
workspace_nameTEXTNOT NULL
vertical_idTEXTNOT NULL REFERENCES audit_verticals(vertical_id) ON DELETE RESTRICT
generated_atTIMESTAMPTZNOT NULL DEFAULT NOW()
markdown_contentTEXTNOT NULL
summary_jsonJSONBNOT NULL DEFAULT '{}'::jsonb
content_bytesINTEGERGENERATED ALWAYS AS (length(markdown_content)) STORED
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

workspace_volume_tracking

Per-workspace intraday tracking of Bison emails_being_sent (max + current + initial + min) and end-of-day actual sent. Powers the Drop % column in the KPI Daily Recap table.

Defined in: 087_workspace_volume_tracking.sql

ColumnTypeConstraints
workspace_nameTEXTNOT NULL
tracking_dateDATENOT NULL
scheduled_maxINTEGERNOT NULL DEFAULT 0
scheduled_max_atTIMESTAMPTZ
scheduled_minINTEGER
scheduled_min_atTIMESTAMPTZ
scheduled_initialINTEGER
scheduled_initial_atTIMESTAMPTZ
scheduled_currentINTEGER
scheduled_current_atTIMESTAMPTZ
emails_sent_finalINTEGER
poll_countINTEGERNOT NULL DEFAULT 0
poll_failuresINTEGERNOT NULL DEFAULT 0
last_polled_atTIMESTAMPTZ
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

billing_subscriptions

Defined in: 090_billing_audit.sql

ColumnTypeConstraints
stripe_subscription_idTEXTPRIMARY KEY, -- "si_UBTe4d0OJExEYU"
client_nameTEXTNOT NULL, -- "Jason Park Missouri"
workspace_nameTEXT,-- normalized snake_case, joinable to client_registry
service_typeTEXTNOT NULL, -- "Azure" | "Google Direct" | "Google Legacy" | "Outlook 365"
mailboxesINTEGERNOT NULL DEFAULT 0, -- raw mailbox count from sheet
billable_unitsINTEGERNOT NULL DEFAULT 0, -- mailboxes / 99 for Azure, else == mailboxes
unit_labelTEXTNOT NULL DEFAULT 'inbox', -- "domain" for Azure, "inbox" otherwise
rateNUMERIC(10,4)NOT NULL DEFAULT 0, -- $/unit
expected_amountNUMERIC(10,2)NOT NULL DEFAULT 0, -- billable_units * rate
billing_dayINTEGER,-- 1-31, parsed from cycle text; nullable
cycle_text_rawTEXT,-- "every 20th of the month"
statusTEXTNOT NULL DEFAULT 'active'
invoice_prefixTEXT,-- inferred from first matched receipt (e.g. "X1S1A4K4")
sheet_row_hashTEXT,-- for diff detection
synced_atTIMESTAMPTZNOT NULL DEFAULT NOW()
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

billing_receipts

Defined in: 090_billing_audit.sql

ColumnTypeConstraints
receipt_numberTEXTPRIMARY KEY, -- "2901-7555"
invoice_numberTEXT,-- "X1S1A4K4-0004"
invoice_prefixTEXT,-- "X1S1A4K4" (derived from invoice_number)
invoice_sequenceINTEGER,-- 4 (derived)
gmail_message_idTEXTUNIQUE, -- Gmail API msg id (dedup key for ingestion)
paid_atDATENOT NULL
period_startDATE,-- "May 24" (year inferred from paid_at)
period_endDATE,-- "Jun 24"
qtyINTEGERNOT NULL
rateNUMERIC(10,4)NOT NULL
totalNUMERIC(10,2)NOT NULL
payment_method_last4TEXT,-- "9460"
raw_subjectTEXT
raw_snippetTEXT,-- first ~500 chars of body, for debugging
matched_subscription_idTEXTREFERENCES billing_subscriptions(stripe_subscription_id) ON DELETE SET NULL
match_confidenceTEXT,-- 'invoice_prefix' | 'signature_unique' | 'signature_with_date' | 'signature_round_robin' | 'operator' | 'unmatched' | 'duplicate' | 'off_rate'
match_notesTEXT
candidates_jsonJSONB,-- when ambiguous, list of candidate sub IDs
resolved_atTIMESTAMPTZ,-- when an operator confirmed/overrode
resolved_byTEXT
ingested_atTIMESTAMPTZNOT NULL DEFAULT NOW()
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

billing_disputes

Defined in: 090_billing_audit.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
receipt_numberTEXTREFERENCES billing_receipts(receipt_number) ON DELETE CASCADE
dispute_typeTEXTNOT NULL, -- 'duplicate' | 'off_rate' | 'unbilled_sub' | 'amount_mismatch'
statusTEXTNOT NULL DEFAULT 'open', -- 'open' | 'contacted_reseller' | 'refunded' | 'dismissed'
amount_disputedNUMERIC(10,2)
notesTEXT
opened_atTIMESTAMPTZNOT NULL DEFAULT NOW()
resolved_atTIMESTAMPTZ
resolved_byTEXT
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_stage_runs

*Per-run health log for the audit pipeline. One row per (stage run): *

Defined in: 097_audit_stage_runs.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
stageTEXTNOT NULL
workspace_nameTEXTNULL
statusTEXTNOT NULL
triggered_byTEXTNOT NULL DEFAULT 'beat'
started_atTIMESTAMPTZNOT NULL DEFAULT now()
finished_atTIMESTAMPTZNULL
resultJSONBNULL
errorTEXTNULL
created_atTIMESTAMPTZNOT NULL DEFAULT now()

interested_format_promotions

*Per-format promotion state for the interested-lead learning loop (Path A/B). *

Defined in: 109_interested_format_promotions.sql

ColumnTypeConstraints
format_signaturetextPRIMARY KEY
signaltextNOT NULL
surfacedintegerNOT NULL DEFAULT 0
confirmationsintegerNOT NULL DEFAULT 0
precisionnumeric(4,3)NOT NULL DEFAULT 0
auto_markbooleanNOT NULL DEFAULT false
promoted_attimestamptz
updated_attimestamptzNOT NULL DEFAULT now()

audit_workspace_pitches

Per-(workspace, campaign, step) pitch/subject map for recommendation targeting. Rebuilt nightly by audit.aggregate_rankings.

Defined in: 113_audit_workspace_pitches.sql

ColumnTypeConstraints
vertical_idTEXTNOT NULL REFERENCES audit_verticals(vertical_id) ON DELETE CASCADE
workspace_nameTEXTNOT NULL
campaign_idTEXTNOT NULL
sequence_step_idBIGINTNOT NULL
pitch_body_fingerprintTEXT
subject_normTEXT
campaign_nameTEXT
sendsINTEGERNOT NULL DEFAULT 0
interestedINTEGERNOT NULL DEFAULT 0
any_replyINTEGERNOT NULL DEFAULT 0
last_computed_atTIMESTAMPTZNOT NULL DEFAULT now()

audit_audience_stats

Audience layer: reply outcomes by contact segment per workspace. Rebuilt nightly by rebuild_audit_audience_stats().

Defined in: 114_audit_audience_stats.sql

ColumnTypeConstraints
workspace_nameTEXTNOT NULL
dimensionTEXTNOT NULL
bucketTEXTNOT NULL
bucket_orderINTEGERNOT NULL DEFAULT 50
uploadedINTEGERNOT NULL DEFAULT 0
repliedINTEGERNOT NULL DEFAULT 0
interestedINTEGERNOT NULL DEFAULT 0
computed_atTIMESTAMPTZNOT NULL DEFAULT now()

carrier_scrub_runs

One row per carrier list-scrub cycle (client + carrier + renewal month). Backs the Carrier Scrub dashboard tracker.

Defined in: 115_carrier_list_scrub.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL REFERENCES client_registry(workspace_name)
carrierTEXTNOT NULL CHECK (carrier IN ('allstate', 'farmers'))
scrub_formatTEXTNOT NULL, -- snapshot of the format used to generate
target_monthTEXTNOT NULL, -- renewal month, matches verified_contacts.month (e.g. 'July')
statusTEXTNOT NULL DEFAULT 'draft'
sent_countINTEGER,-- rows in the generated outbound file
survivor_countINTEGER,-- rows in the returned survivor file (Phase 2)
removed_countINTEGER,-- sent_count - survivor_count (Phase 2)
export_csv_pathTEXT,-- supabase storage path of the outbound file
return_csv_pathTEXT,-- supabase storage path of the carrier's return file (Phase 2)
sent_atTIMESTAMPTZ
sent_byTEXT,-- email of the operator who marked it sent
returned_atTIMESTAMPTZ
applied_atTIMESTAMPTZ
applied_byTEXT,-- email of the operator who confirmed suppression
removed_contact_idsJSONBDEFAULT '[]'::jsonb
suppression_batch_idUUID
notesTEXT
created_atTIMESTAMPTZNOT NULL DEFAULT now()
updated_atTIMESTAMPTZNOT NULL DEFAULT now()

carrier_affiliations

National person -> insurance carrier affiliation map, built from carrier-pulled (do-not-market) contacts. Used to pre-suppress known customers from future lists.

Defined in: 115_carrier_list_scrub.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
carrierTEXTNOT NULL CHECK (carrier IN ('allstate', 'farmers'))
first_nameTEXT
last_nameTEXT
property_addressTEXT
property_cityTEXT
property_stateTEXT
property_zipTEXT,-- 5-digit
emailTEXT,-- if known from our side (return file has none)
phoneTEXT
match_methodTEXT,-- how we inferred the affiliation (name_zip | name_only | exact)
source_run_idUUIDREFERENCES carrier_scrub_runs(id)
source_workspaceTEXT
first_seen_atTIMESTAMPTZNOT NULL DEFAULT now()
last_seen_atTIMESTAMPTZNOT NULL DEFAULT now()

spam_block_events

*Per-event log of "Message blocked" DSN bounces (Google spam-rejection). *

Defined in: 117_spam_block_events.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
sender_mailboxTEXT,-- e.g. "ashleydean@quotes.gaudioinsuranceinstant.com"
sender_domainTEXT,-- root domain (last 2 parts) for grouping in rollups
original_recipientTEXT,-- the lead's email address we were trying to reach
campaign_nameTEXT
bounce_reasonTEXT,-- short headline / type code from the payload (for forensics)
detected_atTIMESTAMPTZNOT NULL DEFAULT NOW()
alert_window_idUUID
alerted_atTIMESTAMPTZ

operating_source_accounts

Defined in: 118_email_conversation_operating_intake_setup.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
source_systemTEXTNOT NULL
account_labelTEXTNOT NULL
account_identifierTEXTNOT NULL
owner_user_idUUIDNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
scope_purposeTEXTNOT NULL
ingest_enabledBOOLEANNOT NULL DEFAULT false
backfill_enabledBOOLEANNOT NULL DEFAULT false
retention_daysINTEGERNULL
credential_refTEXTNULL
configJSONBNOT NULL DEFAULT '{}'::jsonb
last_sync_cursorTEXTNULL
last_sync_atTIMESTAMPTZNULL
last_errorTEXTNULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_source_events

Defined in: 118_email_conversation_operating_intake_setup.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
source_systemTEXTNOT NULL
source_account_idUUIDNOT NULL REFERENCES public.operating_source_accounts(id) ON DELETE CASCADE
source_event_idTEXTNOT NULL
dedupe_keyTEXTNOT NULL
thread_keyTEXTNULL
occurred_atTIMESTAMPTZNOT NULL
subject_or_titleTEXTNULL
participantsJSONBNOT NULL DEFAULT '[]'::jsonb
body_excerptTEXTNULL
body_summaryTEXTNULL
raw_pointerTEXTNULL
raw_payloadJSONBNOT NULL DEFAULT '{}'::jsonb
redaction_statusTEXTNOT NULL DEFAULT 'not_checked'
ingested_atTIMESTAMPTZNOT NULL DEFAULT NOW()
processed_atTIMESTAMPTZNULL
processing_statusTEXTNOT NULL DEFAULT 'received'
error_messageTEXTNULL

operating_threads

Defined in: 118_email_conversation_operating_intake_setup.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
source_systemTEXTNOT NULL
source_account_idUUIDNOT NULL REFERENCES public.operating_source_accounts(id) ON DELETE CASCADE
thread_keyTEXTNOT NULL
subject_or_titleTEXTNULL
started_atTIMESTAMPTZNULL
last_activity_atTIMESTAMPTZNULL
participantsJSONBNOT NULL DEFAULT '[]'::jsonb
latest_summaryTEXTNULL
latest_summary_atTIMESTAMPTZNULL
primary_client_workspace_nameTEXTNULL
primary_entity_idUUIDNULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_thread_messages

Defined in: 118_email_conversation_operating_intake_setup.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
thread_idUUIDNOT NULL REFERENCES public.operating_threads(id) ON DELETE CASCADE
source_event_idUUIDNOT NULL REFERENCES public.operating_source_events(id) ON DELETE CASCADE
message_keyTEXTNOT NULL
occurred_atTIMESTAMPTZNOT NULL
senderJSONBNULL
recipientsJSONBNOT NULL DEFAULT '[]'::jsonb
message_kindTEXTNOT NULL
subject_or_titleTEXTNULL
snippetTEXTNULL
summaryTEXTNULL
artifact_countINTEGERNOT NULL DEFAULT 0
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_source_artifacts

Defined in: 118_email_conversation_operating_intake_setup.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
source_event_idUUIDNOT NULL REFERENCES public.operating_source_events(id) ON DELETE CASCADE
source_artifact_idTEXTNOT NULL
artifact_kindTEXTNOT NULL
titleTEXTNULL
mime_typeTEXTNULL
source_urlTEXTNULL
storage_pointerTEXTNULL
size_bytesBIGINTNULL
checksumTEXTNULL
redaction_statusTEXTNOT NULL DEFAULT 'not_checked'
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_intake_runs

Defined in: 118_email_conversation_operating_intake_setup.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
run_typeTEXTNOT NULL
source_systemTEXTNOT NULL
source_account_idUUIDNULL REFERENCES public.operating_source_accounts(id) ON DELETE SET NULL
started_atTIMESTAMPTZNOT NULL DEFAULT NOW()
finished_atTIMESTAMPTZNULL
statusTEXTNOT NULL DEFAULT 'running'
events_seenINTEGERNOT NULL DEFAULT 0
events_writtenINTEGERNOT NULL DEFAULT 0
events_ignoredINTEGERNOT NULL DEFAULT 0
artifacts_writtenINTEGERNOT NULL DEFAULT 0
error_messageTEXTNULL
metadataJSONBNOT NULL DEFAULT '{}'::jsonb

slack_conversations

Defined in: 118_slack_operating_intake_capture.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
team_idTEXTNOT NULL
channel_idTEXTNOT NULL
nameTEXT
is_privateBOOLEANNOT NULL DEFAULT false
is_imBOOLEANNOT NULL DEFAULT false
is_mpimBOOLEANNOT NULL DEFAULT false
is_archivedBOOLEANNOT NULL DEFAULT false
ingest_enabledBOOLEANNOT NULL DEFAULT false
client_idINTEGERNULL REFERENCES public.client_registry(workspace_id) ON DELETE SET NULL
client_nameTEXTNULL
operating_domainTEXTNULL
owner_user_idUUIDNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
slack_permalink_baseTEXTNULL
last_history_cursorTEXTNULL
last_history_tsTEXTNULL
last_swept_atTIMESTAMPTZNULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

slack_users

Defined in: 118_slack_operating_intake_capture.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
team_idTEXTNOT NULL
user_idTEXTNOT NULL
nameTEXTNULL
real_nameTEXTNULL
is_botBOOLEANNOT NULL DEFAULT false
is_deletedBOOLEANNOT NULL DEFAULT false
profile_jsonJSONBNOT NULL DEFAULT '{}'::jsonb
user_profile_idUUIDNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

slack_events_raw

Defined in: 118_slack_operating_intake_capture.sql

ColumnTypeConstraints
event_idTEXTPRIMARY KEY
team_idTEXTNOT NULL
api_app_idTEXTNULL
event_typeTEXTNOT NULL
event_subtypeTEXTNULL
channel_idTEXTNULL
user_idTEXTNULL
message_tsTEXTNULL
thread_tsTEXTNULL
event_tsTEXTNULL
event_timeBIGINTNULL
raw_payloadJSONBNOT NULL
received_atTIMESTAMPTZNOT NULL DEFAULT NOW()
processed_atTIMESTAMPTZNULL
processing_statusTEXTNOT NULL DEFAULT 'received'
error_messageTEXTNULL

slack_messages

Defined in: 118_slack_operating_intake_capture.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
team_idTEXTNOT NULL
channel_idTEXTNOT NULL
message_tsTEXTNOT NULL
thread_tsTEXTNOT NULL
user_idTEXTNULL
bot_idTEXTNULL
subtypeTEXTNULL
textTEXTNULL
raw_messageJSONBNOT NULL DEFAULT '{}'::jsonb
permalinkTEXTNULL
is_thread_rootBOOLEANNOT NULL DEFAULT false
is_deletedBOOLEANNOT NULL DEFAULT false
edited_atTIMESTAMPTZNULL
deleted_atTIMESTAMPTZNULL
latest_event_idTEXTNULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

slack_ingest_runs

Defined in: 118_slack_operating_intake_capture.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
run_typeTEXTNOT NULL
team_idTEXTNOT NULL
channel_idTEXTNULL
started_atTIMESTAMPTZNOT NULL DEFAULT NOW()
finished_atTIMESTAMPTZNULL
statusTEXTNOT NULL DEFAULT 'running'
messages_seenINTEGERNOT NULL DEFAULT 0
messages_writtenINTEGERNOT NULL DEFAULT 0
events_writtenINTEGERNOT NULL DEFAULT 0
threads_expandedINTEGERNOT NULL DEFAULT 0
error_messageTEXTNULL

operating_timeline_events

Defined in: 119_client_operating_timeline.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
event_keyTEXTNOT NULL UNIQUE
client_registry_idINTEGERNULL REFERENCES public.client_registry(workspace_id) ON DELETE SET NULL
workspace_nameTEXTNULL
client_display_nameTEXTNOT NULL
brain_client_noteTEXTNULL
brain_operations_noteTEXTNULL
event_typeTEXTNOT NULL
event_statusTEXTNOT NULL DEFAULT 'candidate'
occurred_atTIMESTAMPTZNULL
occurred_dateDATENULL
date_precisionTEXTNOT NULL DEFAULT 'unknown'
discovered_atTIMESTAMPTZNOT NULL DEFAULT NOW()
evidence_categoriesTEXT[]NOT NULL DEFAULT ARRAY[]::TEXT[]
source_refsJSONBNOT NULL DEFAULT '[]'::jsonb
source_quoteTEXTNULL
quote_safety_statusTEXTNOT NULL DEFAULT 'not_requested'
summaryTEXTNOT NULL
detailsTEXTNULL
operating_domainTEXTNULL
process_refTEXTNULL
brain_target_anchorTEXTNULL
confidenceTEXTNOT NULL
risk_levelTEXTNOT NULL DEFAULT 'medium'
requested_changeJSONBNOT NULL DEFAULT '{}'::jsonb
proposed_state_updateJSONBNOT NULL DEFAULT '{}'::jsonb
implementation_statusTEXTNOT NULL DEFAULT 'not_applicable'
implementation_checked_atTIMESTAMPTZNULL
reviewed_byUUIDNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
reviewed_atTIMESTAMPTZNULL
brain_exported_atTIMESTAMPTZNULL
brain_export_run_idUUIDNULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

Defined in: 119_client_operating_timeline.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
from_event_idUUIDNOT NULL REFERENCES public.operating_timeline_events(id) ON DELETE CASCADE
to_event_idUUIDNOT NULL REFERENCES public.operating_timeline_events(id) ON DELETE CASCADE
link_typeTEXTNOT NULL
confidenceTEXTNOT NULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_timeline_export_runs

Defined in: 119_client_operating_timeline.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
export_typeTEXTNOT NULL
statusTEXTNOT NULL DEFAULT 'running'
started_atTIMESTAMPTZNOT NULL DEFAULT NOW()
finished_atTIMESTAMPTZNULL
events_seenINTEGERNOT NULL DEFAULT 0
events_exportedINTEGERNOT NULL DEFAULT 0
events_skippedINTEGERNOT NULL DEFAULT 0
target_pathTEXTNULL
metadataJSONBNOT NULL DEFAULT '{}'::jsonb
error_messageTEXTNULL

slack_channel_policies

Defined in: 119_slack_operating_intake_phase_c_autonomy.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
team_idTEXTNOT NULL
channel_idTEXTNULL
name_patternTEXTNULL
policyTEXTNOT NULL
reasonTEXTNULL
priorityINTEGERNOT NULL DEFAULT 100
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

slack_channel_coverage_events

Defined in: 119_slack_operating_intake_phase_c_autonomy.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
team_idTEXTNOT NULL
channel_idTEXTNULL
channel_nameTEXTNULL
event_typeTEXTNOT NULL
statusTEXTNOT NULL
reasonTEXTNULL
metadataJSONBNOT NULL DEFAULT '{}'::jsonb
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_intake_items

Defined in: 119_slack_operating_intake_phase_c_autonomy.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
source_systemTEXTNOT NULL DEFAULT 'slack'
team_idTEXTNOT NULL
channel_idTEXTNOT NULL
thread_tsTEXTNOT NULL
message_tsTEXTNULL
source_permalinkTEXTNULL
source_dateDATENULL
channel_nameTEXTNULL
visibilityTEXTNULL
event_typeTEXTNOT NULL
routing_outcomesTEXT[]NOT NULL DEFAULT '{}'
operating_domainTEXTNULL
client_idINTEGERNULL REFERENCES public.client_registry(workspace_id) ON DELETE SET NULL
client_nameTEXTNULL
related_brain_linksTEXT[]NOT NULL DEFAULT '{}'
backend_mappingJSONBNOT NULL DEFAULT '{}'::jsonb
summaryTEXTNOT NULL
evidence_pointerTEXTNOT NULL
confidenceTEXTNOT NULL DEFAULT 'medium'
review_statusTEXTNOT NULL DEFAULT 'needs_review'
safety_flagsTEXT[]NOT NULL DEFAULT '{}'
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

brain_writeback_queue

Defined in: 119_slack_operating_intake_phase_c_autonomy.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
source_item_idUUIDNULL REFERENCES public.operating_intake_items(id) ON DELETE SET NULL
target_vaultTEXTNOT NULL DEFAULT 'MaverickBrain'
target_note_pathTEXTNOT NULL
target_sectionTEXTNOT NULL
append_markdownTEXTNOT NULL
writeback_statusTEXTNOT NULL DEFAULT 'pending'
safety_checkedBOOLEANNOT NULL DEFAULT false
error_messageTEXTNULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

client_onboardings

*v2 pipeline: client-level onboarding record. Each row aggregates 1-3 *

Defined in: 120_infra_order_pipeline_v2.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
client_workspace_nameTEXTNOT NULL
client_display_nameTEXTNOT NULL
stageTEXTNOT NULL DEFAULT 'in_progress'
entry_typeTEXTNOT NULL DEFAULT 'new_client'
lead_targetINTEGERNOT NULL, -- 100, 200, 300, 400, 500 or custom-supplied
sizing_tierTEXTNOT NULL -- 'standard_100' | 'standard_200' | ... | 'custom'
custom_google_countINTEGER,-- populated only when sizing_tier = 'custom'
custom_m365_countINTEGER
custom_azure_countINTEGER
base_domainTEXTNOT NULL
sending_nameTEXT
launch_dateDATE,-- Tommy's target launch date, informational
target_workspace_nameTEXT
target_bison_workspace_idINTEGER
form_payloadJSONBNOT NULL DEFAULT '{}'::jsonb
started_atTIMESTAMPTZNOT NULL DEFAULT NOW()
fulfilled_atTIMESTAMPTZ
warming_started_atTIMESTAMPTZ,-- when the LAST sub-order was ingested
ready_to_launch_atTIMESTAMPTZ
launched_atTIMESTAMPTZ
active_atTIMESTAMPTZ
cancelled_atTIMESTAMPTZ
slack_channel_idTEXT
slack_thread_tsTEXT
created_byTEXT,-- user id or email
notesTEXT
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

onboarding_steps

*Per-new-client 8-step provisioning checklist with 12h SLA. Verifiers *

Defined in: 120_infra_order_pipeline_v2.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
client_onboarding_idINTEGERNOT NULL
step_keyTEXTNOT NULL, -- 'client_record' | 'bison_workspace' | ...
titleTEXTNOT NULL
owner_roleTEXTNOT NULL -- 'ENG' | 'INFRA' | 'DATA' | 'CS' | 'FINANCE'
statusTEXTNOT NULL DEFAULT 'pending'
due_atTIMESTAMPTZNOT NULL, -- created_at + 12h SLA
verified_atTIMESTAMPTZ
verify_detailTEXT
last_escalated_atTIMESTAMPTZ,-- Slack escalation dedupe (6h window)
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

email_verification_second_pass_queue

Defined in: 121_email_verification_second_pass_queue.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
raw_contact_idBIGINTNOT NULL REFERENCES public.raw_contacts(id) ON DELETE CASCADE
workspace_nameTEXTNOT NULL
monthTEXTNOT NULL
emailTEXTNOT NULL
source_providerTEXTNOT NULL
source_reasonTEXTNOT NULL
source_rawJSONBNOT NULL DEFAULT '{}'::jsonb
queue_statusTEXTNOT NULL DEFAULT 'pending'
second_providerTEXT
second_verdictTEXT
second_rawJSONB
exported_atTIMESTAMPTZ
checked_atTIMESTAMPTZ
promoted_atTIMESTAMPTZ
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()
second_verdictISNULL OR second_verdict IN (

operating_entities

Resolved entities (people, clients, workspaces, panels, domain roots, repos, systems). One row per real thing; every name for it lives in operating_entity_aliases.

Defined in: 121_operating_indexing_engine.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
entity_typeTEXTNOT NULL
canonical_nameTEXTNOT NULL
normalized_keyTEXTNOT NULL
canonical_refJSONBNOT NULL DEFAULT '{}'::jsonb
first_seen_atTIMESTAMPTZNOT NULL DEFAULT NOW()
last_seen_atTIMESTAMPTZNOT NULL DEFAULT NOW()
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_entity_matches

Entity resolver outputs and human-reviewed corrections keyed by adapter source refs.

Defined in: 121_operating_indexing_engine.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
source_systemTEXTNOT NULL
source_ref_keyTEXTNOT NULL
source_refJSONBNOT NULL DEFAULT '{}'::jsonb
source_event_idUUIDNULL REFERENCES public.operating_source_events(id) ON DELETE CASCADE
thread_idUUIDNULL REFERENCES public.operating_threads(id) ON DELETE CASCADE
entity_idUUIDNOT NULL REFERENCES public.operating_entities(id) ON DELETE CASCADE
entity_typeTEXTNOT NULL
match_confidenceNUMERICNOT NULL
confidence_bandTEXTNOT NULL
match_reasonTEXTNOT NULL
is_primaryBOOLEANNOT NULL DEFAULT false
reviewed_byUUIDNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
reviewed_atTIMESTAMPTZNULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_intake_classifications

Source-agnostic operating classifications produced from IndexedInput.

Defined in: 121_operating_indexing_engine.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
source_systemTEXTNOT NULL
source_ref_keyTEXTNOT NULL
source_refJSONBNOT NULL DEFAULT '{}'::jsonb
source_event_idUUIDNULL REFERENCES public.operating_source_events(id) ON DELETE CASCADE
thread_idUUIDNULL REFERENCES public.operating_threads(id) ON DELETE CASCADE
raw_pointerTEXTNULL
outcomeTEXTNOT NULL
operating_domainTEXTNOT NULL
summaryTEXTNOT NULL
extracted_factsJSONBNOT NULL DEFAULT '{}'::jsonb
recommended_next_actionTEXTNULL
owner_user_idUUIDNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
tommy_requiredBOOLEANNOT NULL DEFAULT false
urgencyTEXTNOT NULL DEFAULT 'normal'
confidenceNUMERICNOT NULL
confidence_bandTEXTNOT NULL
confidence_reasonTEXTNOT NULL
high_riskBOOLEANNOT NULL DEFAULT false
model_usedTEXTNULL
prompt_versionTEXTNULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_intake_review_items

Human review queue for classifications that need approval, routing, dismissal, or writeback.

Defined in: 121_operating_indexing_engine.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
classification_idUUIDNOT NULL REFERENCES public.operating_intake_classifications(id) ON DELETE CASCADE
source_systemTEXTNOT NULL
source_ref_keyTEXTNOT NULL
source_refJSONBNOT NULL DEFAULT '{}'::jsonb
review_queueTEXTNOT NULL
titleTEXTNOT NULL
summaryTEXTNOT NULL
brain_safe_summaryTEXTNULL
matched_entity_idUUIDNULL REFERENCES public.operating_entities(id) ON DELETE SET NULL
client_workspace_nameTEXTNULL
prospect_entity_idUUIDNULL REFERENCES public.operating_entities(id) ON DELETE SET NULL
suggested_owner_user_idUUIDNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
suggested_writebackJSONBNOT NULL DEFAULT '{}'::jsonb
evidence_urlTEXTNULL
statusTEXTNOT NULL DEFAULT 'open'
reviewed_byUUIDNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
reviewed_atTIMESTAMPTZNULL
review_notesTEXTNULL
manual_approval_confirmedBOOLEANNOT NULL DEFAULT false
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_intake_writebacks

Controlled writeback audit trail for Platform, MaverickBrain, Email Bison, and QuickBooks actions.

Defined in: 121_operating_indexing_engine.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
review_item_idUUIDNOT NULL REFERENCES public.operating_intake_review_items(id) ON DELETE CASCADE
writeback_typeTEXTNOT NULL
target_systemTEXTNOT NULL
target_refJSONBNOT NULL DEFAULT '{}'::jsonb
payloadJSONBNOT NULL DEFAULT '{}'::jsonb
statusTEXTNOT NULL DEFAULT 'pending'
requested_byUUIDNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
completed_atTIMESTAMPTZNULL
error_messageTEXTNULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_digest_runs

Brain-safe digest output containing reviewed summaries only.

Defined in: 121_operating_indexing_engine.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
digest_typeTEXTNOT NULL
period_startTIMESTAMPTZNOT NULL
period_endTIMESTAMPTZNOT NULL
source_systemsTEXT[]NOT NULL DEFAULT '{}'::text[]
summary_mdTEXTNOT NULL
item_countINTEGERNOT NULL DEFAULT 0
generated_byUUIDNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_entity_aliases

Every string that names an entity: names, first names, Slack ids, emails, GitHub logins, vault slugs and note paths, workspace ids. Resolution only trusts status=approved rows.

Defined in: 122_operating_knowledge_promotion.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
entity_idUUIDNULL REFERENCES public.operating_entities(id) ON DELETE CASCADE
entity_typeTEXTNOT NULL
aliasTEXTNOT NULL
normalized_aliasTEXTNOT NULL
alias_typeTEXTNOT NULL
source_systemTEXTNOT NULL DEFAULT 'manual'
source_refJSONBNOT NULL DEFAULT '{}'::jsonb
confidenceNUMERICNOT NULL DEFAULT 0.5
statusTEXTNOT NULL DEFAULT 'generated'
created_byUUIDNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
reviewed_byUUIDNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
reviewed_atTIMESTAMPTZNULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_process_taxonomy

Defined in: 122_operating_knowledge_promotion.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
process_keyTEXTNOT NULL UNIQUE
display_nameTEXTNOT NULL
departmentTEXTNOT NULL
brain_noteTEXTNULL
canonical_destinationTEXTNOT NULL
owner_roleTEXTNULL
risk_level_defaultTEXTNOT NULL DEFAULT 'normal'
activeBOOLEANNOT NULL DEFAULT true
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_promotion_runs

Defined in: 122_operating_knowledge_promotion.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
run_typeTEXTNOT NULL
source_systemsTEXT[]NOT NULL DEFAULT '{}'::text[]
modeTEXTNOT NULL
period_startTIMESTAMPTZNULL
period_endTIMESTAMPTZNULL
filtersJSONBNOT NULL DEFAULT '{}'::jsonb
started_atTIMESTAMPTZNOT NULL DEFAULT NOW()
finished_atTIMESTAMPTZNULL
statusTEXTNOT NULL DEFAULT 'running'
threads_seenINTEGERNOT NULL DEFAULT 0
events_createdINTEGERNOT NULL DEFAULT 0
events_linkedINTEGERNOT NULL DEFAULT 0
patch_candidates_createdINTEGERNOT NULL DEFAULT 0
error_messageTEXTNULL

operating_brain_patch_candidates

Defined in: 122_operating_knowledge_promotion.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
promotion_run_idUUIDNULL REFERENCES public.operating_promotion_runs(id) ON DELETE SET NULL
target_note_pathTEXTNOT NULL
target_anchorTEXTNOT NULL
patch_typeTEXTNOT NULL
titleTEXTNOT NULL
summaryTEXTNOT NULL
patch_mdTEXTNOT NULL
patch_hashTEXTNOT NULL
source_event_idsUUID[]NOT NULL DEFAULT '{}'::uuid[]
timeline_event_idsUUID[]NOT NULL DEFAULT '{}'::uuid[]
entity_idsUUID[]NOT NULL DEFAULT '{}'::uuid[]
process_keyTEXTNOT NULL DEFAULT ''
risk_levelTEXTNOT NULL DEFAULT 'normal'
confidenceNUMERICNOT NULL DEFAULT 0.5
statusTEXTNOT NULL DEFAULT 'generated'
reviewed_byUUIDNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
reviewed_atTIMESTAMPTZNULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_backfill_jobs

Checkpointed operating-intake historical backfill jobs. enabled=false is the kill switch; the beat runner no-ops without an enabled job.

Defined in: 128_operating_backfill_controller.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
job_keyTEXTNOT NULL UNIQUE
source_systemTEXTNOT NULL
statusTEXTNOT NULL DEFAULT 'pending'
enabledBOOLEANNOT NULL DEFAULT FALSE
chunk_sizeINTEGERNOT NULL DEFAULT 400
tick_minutesINTEGERNOT NULL DEFAULT 10
refs_totalINTEGERNOT NULL DEFAULT 0
refs_doneINTEGERNOT NULL DEFAULT 0
refs_failedINTEGERNOT NULL DEFAULT 0
last_claimed_atTIMESTAMPTZNULL
last_errorTEXTNULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

operating_backfill_items

Per-thread work list for operating-intake historical backfill. source_ref_key matches IndexedInput.source_ref_key; excluded rows are policy-skipped machine channels (flip to pending to include later).

Defined in: 128_operating_backfill_controller.sql

ColumnTypeConstraints
source_ref_keyTEXTPRIMARY KEY
job_idUUIDNOT NULL REFERENCES public.operating_backfill_jobs(id) ON DELETE CASCADE
payloadJSONBNOT NULL DEFAULT '{}'::jsonb
statusTEXTNOT NULL DEFAULT 'pending'
attemptsINTEGERNOT NULL DEFAULT 0
last_errorTEXTNULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

stat_pollution_backup_2026_07

Defined in: 129_purge_cross_workspace_stat_pollution.sql

ColumnTypeConstraints
idbigintGENERATED ALWAYS AS IDENTITY PRIMARY KEY
backed_up_attimestamptzNOT NULL DEFAULT now()
source_tabletextNOT NULL
pollution_classtextNOT NULL
row_datajsonbNOT NULL

audit_rules

Defined in: 131_daily_audit_engine.sql

ColumnTypeConstraints
check_keyTEXTPRIMARY KEY
enabledBOOLEANNOT NULL DEFAULT TRUE
severityTEXTNOT NULL DEFAULT 'warn'
owner_roleTEXTNOT NULL DEFAULT 'tommy'
paramsJSONBNOT NULL DEFAULT '{}'::jsonb
notesTEXT
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

audit_findings

Defined in: 131_daily_audit_engine.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
check_keyTEXTNOT NULL REFERENCES audit_rules(check_key)
severityTEXTNOT NULL
owner_roleTEXTNOT NULL
titleTEXTNOT NULL
evidenceJSONBNOT NULL DEFAULT '{}'::jsonb
statusTEXTNOT NULL DEFAULT 'open'
first_seen_dateDATENOT NULL
last_seen_dateDATENOT NULL
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()
resolved_atTIMESTAMPTZ

operating_timeline_summary_repair_backup

Defined in: 133_operating_timeline_summary_repair_backup.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
event_idUUIDNOT NULL REFERENCES operating_timeline_events(id) ON DELETE CASCADE
old_summaryTEXT
old_event_typeTEXT
repair_run_idUUID
backed_up_atTIMESTAMPTZNOT NULL DEFAULT NOW()

auto_forward_config

Defined in: 134_auto_forward_dropped_producers.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL UNIQUE
enabledBOOLEANNOT NULL DEFAULT FALSE
producer_emailsJSONBNOT NULL DEFAULT '[]'
max_forwards_per_lead_per_dayINTEGERNOT NULL DEFAULT 5
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

auto_forward_log

Defined in: 134_auto_forward_dropped_producers.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
lead_reply_idUUIDREFERENCES lead_replies(id) ON DELETE CASCADE
bison_reply_numeric_idINTEGERNOT NULL
lead_emailTEXT
statusTEXTNOT NULL DEFAULT 'processing'
skipped_reasonTEXT
forwarded_toJSONBNOT NULL DEFAULT '[]'
sender_email_idINTEGER
error_messageTEXT
processing_time_msINTEGER
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

infra_reconciliation_runs

Defined in: 141_orders_first_spine.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
ran_atTIMESTAMPTZNOT NULL DEFAULT NOW()
unlinked_warming_countINTEGERNOT NULL
proposal_pending_countINTEGERNOT NULL
stamped_this_runINTEGERNOT NULL DEFAULT 0
proposals_created_this_runINTEGERNOT NULL DEFAULT 0
detailJSONBDEFAULT '{}'::jsonb

diagnostics_runs

Defined in: 143_workspace_diagnostics.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
started_atTIMESTAMPTZNOT NULL DEFAULT NOW()
finished_atTIMESTAMPTZ
statusTEXTNOT NULL DEFAULT 'running'
workspaces_scannedINTEGERNOT NULL DEFAULT 0
workspaces_erroredINTEGERNOT NULL DEFAULT 0
findings_totalINTEGERNOT NULL DEFAULT 0
findings_criticalINTEGERNOT NULL DEFAULT 0
findings_warningINTEGERNOT NULL DEFAULT 0
findings_infoINTEGERNOT NULL DEFAULT 0
error_detailTEXT
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

workspace_diagnostics_findings

Defined in: 143_workspace_diagnostics.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
run_idBIGINTNOT NULL REFERENCES diagnostics_runs(id) ON DELETE CASCADE
workspace_nameTEXTNOT NULL
check_codeTEXTNOT NULL
severityTEXTNOT NULL CHECK (severity IN ('critical', 'warning', 'info'))
bison_campaign_idINTEGER
campaign_nameTEXT
summaryTEXTNOT NULL
detailJSONBNOT NULL DEFAULT '{}'::jsonb
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

bison_campaign_snapshots

Defined in: 143_workspace_diagnostics.sql

ColumnTypeConstraints
snapshot_dateDATENOT NULL
workspace_nameTEXTNOT NULL
bison_campaign_idINTEGERNOT NULL
campaignJSONBNOT NULL
sendersJSONB
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

client_announcements

*Admin-composed client announcements fanned out to Slack + portal + email *

Defined in: 151_client_announcements.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
titleTEXTNOT NULL
body_mdTEXTNOT NULL
announcement_typeTEXTNOT NULL DEFAULT 'general'
linked_resource_idUUIDREFERENCES resources(id) ON DELETE SET NULL
audienceTEXTNOT NULL DEFAULT 'selected'
target_workspacesTEXT[]NOT NULL DEFAULT '{}'
channelsJSONBNOT NULL DEFAULT '{"slack": true, "portal": true, "email": false}'
statusTEXTNOT NULL DEFAULT 'draft'
scheduled_atTIMESTAMPTZ
sent_atTIMESTAMPTZ
created_byUUID
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()
announcement_typeIN('feature', 'infrastructure', 'launch', 'best_practice', 'general')
statusIN('draft', 'scheduled', 'sending', 'sent', 'partial_failure')

announcement_deliveries

*One row per (announcement, workspace, channel, recipient) attempt. The *

Defined in: 151_client_announcements.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
announcement_idUUIDNOT NULL REFERENCES client_announcements(id) ON DELETE CASCADE
workspace_nameTEXTNOT NULL
channelTEXTNOT NULL
recipientTEXTNOT NULL DEFAULT '-'
statusTEXTNOT NULL DEFAULT 'sent'
errorTEXT
sent_atTIMESTAMPTZNOT NULL DEFAULT NOW()

announcement_reads

Defined in: 151_client_announcements.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
announcement_idUUIDNOT NULL REFERENCES client_announcements(id) ON DELETE CASCADE
user_idUUIDNOT NULL
read_atTIMESTAMPTZNOT NULL DEFAULT NOW()

announcement_email_optouts

*Exceptions only. Recipient base = live user_workspace_access membership *

Defined in: 151_client_announcements.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
emailTEXTNOT NULL
disabled_byUUID
disabled_atTIMESTAMPTZNOT NULL DEFAULT NOW()

announcement_extra_recipients

Defined in: 151_client_announcements.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
emailTEXTNOT NULL
added_byUUID
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

order_send_activity

Defined in: 151_order_send_activity.sql

ColumnTypeConstraints
order_idINTEGERNOT NULL
snapshot_dateDATENOT NULL
senders_sendingINTEGERNOT NULL DEFAULT 0
total_sentBIGINTNOT NULL DEFAULT 0

infra_workspace_daily

Defined in: 153_infra_workspace_daily.sql

ColumnTypeConstraints
workspace_nameTEXTNOT NULL
snapshot_dateDATENOT NULL
accounts_totalINTEGERNOT NULL DEFAULT 0
accounts_connectedINTEGERNOT NULL DEFAULT 0
accounts_warmingINTEGERNOT NULL DEFAULT 0
accounts_sendingINTEGERNOT NULL DEFAULT 0
sum_daily_limitBIGINTNOT NULL DEFAULT 0
avg_daily_limitNUMERIC(8,2)
stale_countINTEGERNOT NULL DEFAULT 0

announcement_event_policies

*Per-event-type switchboard for the product event engine. mode=draft *

Defined in: 154_announcement_event_engine.sql

ColumnTypeConstraints
event_typeTEXTPRIMARY KEY
enabledBOOLEANNOT NULL DEFAULT TRUE
modeTEXTNOT NULL DEFAULT 'draft'
channelsJSONBNOT NULL DEFAULT '{"slack": true, "portal": true, "email": false}'
updated_byUUID
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

sender_disconnect_state

Defined in: 154_disconnect_state.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
email_addressTEXTNOT NULL
bison_sender_email_idBIGINT
bison_typeTEXT,-- microsoft_oauth / google_workspace_oauth / ...
triage_classTEXTNOT NULL DEFAULT 'investigate', -- oauth_reconnect | investigate
first_disconnected_atTIMESTAMPTZNOT NULL, -- webhook event ts when available, else first census sighting
last_confirmed_atTIMESTAMPTZNOT NULL, -- last census/probe that saw it disconnected
detected_viaTEXTNOT NULL DEFAULT 'census', -- 'webhook' | 'census'
resolved_atTIMESTAMPTZ,-- NULL = still disconnected
resolutionTEXT,-- 'reconnected' | 'deleted' | NULL
supplierTEXT,-- display resolution at insert time
infrastructure_order_idINTEGER,-- denormed from email_accounts FK
scopeTEXTNOT NULL DEFAULT 'active', -- 'active' | 'inactive_client' | 'pool' | 'unknown'
last_reported_dateDATE,-- daily-CSV NEW-flag bookkeeping
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

announcement_pipeline_enrollment

*Workspaces enrolled in the automated product-event notification *

Defined in: 155_announcement_pipeline_enrollment.sql

ColumnTypeConstraints
workspace_nameTEXTPRIMARY KEY
enrolled_byUUID
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

account_deletion_queue

Defined in: 156_account_deletion_queue.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
bison_sender_email_idBIGINTNOT NULL
email_addressTEXT
workspace_nameTEXTNOT NULL
infrastructure_order_idINTEGER
reasonTEXTNOT NULL
queued_atTIMESTAMPTZNOT NULL DEFAULT NOW()
queued_byTEXTNOT NULL
statusTEXTNOT NULL DEFAULT 'pending'
resolved_atTIMESTAMPTZ
resolved_byTEXT
notesTEXT

burnt_cohorts

Defined in: 158_burnt_cohorts.sql

ColumnTypeConstraints
idSERIALPRIMARY KEY
workspace_nameTEXTNOT NULL
root_domainTEXTNOT NULL
provider_keyTEXT
reseller_slugTEXT
scan_weekDATENOT NULL
detected_atTIMESTAMPTZNOT NULL DEFAULT NOW()
detection_signalsJSONBNOT NULL, -- {total_sent, total_replied, reply_rate, bounce_rate, ...}
account_idsBIGINT[]NOT NULL, -- Bison sender ids at detection time
account_countINTNOT NULL
connected_at_detectionINTNOT NULL
lost_capacity_per_dayINTNOT NULL, -- SUM(provider_cap) across connected accts
statusTEXTNOT NULL DEFAULT 'detected'
confirmed_atTIMESTAMPTZ
confirmed_byTEXT
detached_atTIMESTAMPTZ
delete_afterTIMESTAMPTZ,-- default detached_at + 14d, editable
sent_to_deletion_atTIMESTAMPTZ
resolved_atTIMESTAMPTZ
replacement_order_idINTEGER
replacement_declined_atTIMESTAMPTZ
reseller_cancel_requested_atTIMESTAMPTZ
reseller_cancelled_atTIMESTAMPTZ
healthy_split_campaignsJSONB,-- [{original_cid, clone_cid, healthy_count, burnt_count}]
dismissed_atTIMESTAMPTZ
dismissed_byTEXT
notesTEXT
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

warmup_health

Defined in: 166_warmup_health.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
workspace_nameTEXTNOT NULL
root_domainTEXTNOT NULL
scan_run_idTEXTNOT NULL, -- YYYY-MM-DD-HHMM (scan invocation stamp)
first_detected_atTIMESTAMPTZNOT NULL DEFAULT NOW()
last_seen_atTIMESTAMPTZNOT NULL DEFAULT NOW()
avg_warmup_scoreNUMERICNOT NULL
account_countINTEGERNOT NULL, -- total accts on this (ws, root_domain)
signal_countINTEGERNOT NULL, -- accts with warmup_emails_sent >= 10 (contribute to avg)
accts_le_70INTEGERNOT NULL, -- how many of signal_count are individually <= 70
account_idsINTEGER[]NOT NULL, -- Bison sender_email_ids on this domain
date_tagsTEXT[]NOT NULL DEFAULT '{}', -- distinct '7/9', '3/20', etc. across the domain
infra_tagsTEXT[]NOT NULL DEFAULT '{}', -- distinct 'Azure','Mailin','MS365 Panel', etc.
signalsJSONBNOT NULL DEFAULT '{}'::jsonb, -- misc raw fields (min/max score, top offenders, etc.)
statusTEXTNOT NULL DEFAULT 'detected'
resolved_atTIMESTAMPTZ
resolved_byTEXT
dismissed_atTIMESTAMPTZ
dismissed_byTEXT
notesTEXT
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

reconnect_domain_exclusions

Domains the reconnect executor must never attempt. Ops-editable; the executor reads it fresh every run.

Defined in: 171_reconnect_domain_exclusions.sql

ColumnTypeConstraints
domainTEXTPRIMARY KEY
reasonTEXTNOT NULL
added_byTEXTNOT NULL
created_atTIMESTAMPTZNOT NULL DEFAULT now()

ms365_panels

*One row per MS365 panel (Azure tenant) we provision mailboxes on. Holds the capacity *

Defined in: 172_ms365_panel_tracking.sql

ColumnTypeConstraints
panel_numberSMALLINTPRIMARY KEY
labelTEXTNOT NULL
tenant_idUUIDNOT NULL UNIQUE
kindTEXTNOT NULL CHECK (kind IN ('owned', 'reseller'))
license_skuTEXT
licenses_totalINTEGER
licenses_usedINTEGER
domains_verifiedINTEGER
domain_capINTEGERNOT NULL DEFAULT 5000
capacity_checked_atTIMESTAMPTZ
accepts_new_domainsBOOLEANNOT NULL DEFAULT TRUE
notesTEXT
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

expired_token_snapshot

Defined in: 173_expired_token_snapshot.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
run_dateDATENOT NULL
workspace_nameTEXTNOT NULL
bison_sender_idBIGINT
sender_nameTEXT
email_addressTEXTNOT NULL
tagsTEXT
providerTEXT,-- MS365 Panel / CheapInboxes / Mailin / ScaledMail / Azure Panel / Legacy Panel / ...
ownerTEXT,-- OURS (we reconnect) | VENDOR (they re-auth)
captured_atTIMESTAMPTZNOT NULL DEFAULT now()

reconnect_daily_cohort

Defined in: 177_reconnect_daily_cohort.sql

ColumnTypeConstraints
cohort_datedatePRIMARY KEY
detected_attimestamptzNOT NULL DEFAULT now()
detected_countintegerNOT NULL
member_idsjsonbNOT NULL DEFAULT '[]'::jsonb
statustextNOT NULL DEFAULT 'open', -- 'open' | 'reported'
reconnected_countinteger
unreconnectable_countinteger
still_working_countinteger
closed_attimestamptz
post2_messagetext
created_attimestamptzNOT NULL DEFAULT now()
updated_attimestamptzNOT NULL DEFAULT now()

mcp_users

Defined in: 180_maverick_mcp_registry.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
nameTEXTNOT NULL UNIQUE
token_hashTEXTNOT NULL UNIQUE, -- sha256 hex of the bearer token
roleTEXTNOT NULL DEFAULT 'operator' CHECK (role IN ('admin', 'operator'))
is_activeBOOLEANNOT NULL DEFAULT TRUE
created_atTIMESTAMPTZDEFAULT NOW()
last_used_atTIMESTAMPTZ

mcp_audit_log

Defined in: 180_maverick_mcp_registry.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
user_idUUIDREFERENCES mcp_users(id) ON DELETE CASCADE
user_nameTEXTNOT NULL, -- denormalized for cheap reads
toolTEXTNOT NULL
workspace_nameTEXT
args_summaryJSONB,-- NEVER contains secret values
statusTEXTNOT NULL CHECK (status IN ('ok', 'error', 'denied'))
duration_msINTEGER
created_atTIMESTAMPTZDEFAULT NOW()

key_candidates

Defined in: 180_maverick_mcp_registry.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
bison_key_idINTEGER,-- parsed from the key's "ID|token" prefix
secret_refTEXTNOT NULL, -- vault secret name; the key itself lives in Vault
vault_secret_idUUID,-- vault row id (vault_delete_secret takes p_secret_id)
provenanceTEXTNOT NULL, -- e.g. 'local-md-2026-05-04', 'workspaces-json', 'one-pager'
statusTEXTNOT NULL DEFAULT 'pending'
validated_workspace_nameTEXT,-- what Bison said the key belongs to
validated_team_idINTEGER
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

mcp_audit_runs

Defined in: 180_maverick_mcp_registry.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workflowTEXTNOT NULL, -- 'volume_audit' | 'key_census' | ...
scopeJSONB,-- {"workspaces": [...]} or null = all active
requested_byUUIDREFERENCES mcp_users(id)
requested_by_nameTEXT
statusTEXTNOT NULL DEFAULT 'queued'
celery_task_idTEXT
summaryJSONB,-- counts per finding_class, error list
started_atTIMESTAMPTZ
finished_atTIMESTAMPTZ
created_atTIMESTAMPTZDEFAULT NOW()

mcp_audit_findings

Defined in: 180_maverick_mcp_registry.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
run_idUUIDNOT NULL REFERENCES mcp_audit_runs(id) ON DELETE CASCADE
workspace_nameTEXTNOT NULL
finding_classTEXTNOT NULL, -- 'F1_unsequenced' | 'F2_ramp_drift' | 'F3_unattached_healthy' | 'F5_tag_canon' | 'audit_error' | census classes
severityTEXTNOT NULL DEFAULT 'warn' CHECK (severity IN ('info', 'warn', 'high'))
evidenceJSONBNOT NULL, -- the numbers; NEVER secret values
proposed_fixJSONB,-- null when no auto-proposable fix (F4/F6 class)
statusTEXTNOT NULL DEFAULT 'proposed'
approved_byUUIDREFERENCES mcp_users(id)
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

job_runs

Defined in: 183_job_runs.sql

ColumnTypeConstraints
idtextPRIMARY KEY
task_nametextNOT NULL
scopetext
statetextNOT NULL DEFAULT 'running' CHECK (state IN ('running', 'succeeded', 'failed'))
progress_currentinteger
progress_totalinteger
notetext
resultjsonb
errortext
started_attimestamptzNOT NULL DEFAULT now()
finished_attimestamptz
expected_next_attimestamptz

kpi_shadow_compare

Defined in: 184_kpi_shadow_compare.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
run_atTIMESTAMPTZNOT NULL DEFAULT now()
workspace_nameTEXTNOT NULL
deltasJSONBNOT NULL

workspace_window_stats

Defined in: 185_workspace_window_stats.sql

ColumnTypeConstraints
workspace_nameTEXTNOT NULL
window_daysINTEGERNOT NULL CHECK (window_days IN (0, 30, 60, 90))
start_dateDATENOT NULL
end_dateDATENOT NULL
emails_sentBIGINT
total_leads_contactedBIGINT
synced_atTIMESTAMPTZNOT NULL DEFAULT now()

intraday_snapshots

Defined in: 186_intraday_pacing.sql

ColumnTypeConstraints
workspace_nametextNOT NULL
chicago_daydateNOT NULL
minutes_into_dayintNOT NULL
snapshot_attimestamptzNOT NULL DEFAULT now()
emails_sentint
repliesint
interestedint

audit_reply_timing_stats

Reply-timing analytics: time-to-reply distribution + reply day-of-week/hour-of-day (Chicago), split interested vs other. Per-REPLY denominator (NEVER the audience table

Defined in: 187_audience_renewal_timing_and_reply_timing.sql

ColumnTypeConstraints
workspace_nameTEXTNOT NULL
dimensionTEXTNOT NULL CHECK (dimension IN ('time_to_reply', 'reply_dow', 'reply_hour'))
bucketTEXTNOT NULL
bucket_orderINTEGERNOT NULL DEFAULT 50
repliesBIGINTNOT NULL DEFAULT 0
interestedBIGINTNOT NULL DEFAULT 0
computed_atTIMESTAMPTZNOT NULL DEFAULT now()

mcp_known_causes

Defined in: 189_mcp_known_causes.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXT,-- NULL = any workspace
finding_classTEXT,-- NULL = any class (e.g. 'VD_unsequenced', 'F1_unsequenced')
campaign_idINTEGER,-- NULL = any campaign
verdictTEXTNOT NULL, -- suggested: known_cause | registry_hygiene |
reasonTEXTNOT NULL, -- human explanation; shown in evidence.disposition
created_byUUIDREFERENCES mcp_users(id)
created_by_nameTEXT
expires_atTIMESTAMPTZ,-- NULL = standing until deactivated
is_activeBOOLEANNOT NULL DEFAULT TRUE
created_atTIMESTAMPTZDEFAULT NOW()
updated_atTIMESTAMPTZDEFAULT NOW()

schema_migrations

Defined in: 202608211200_schema_migrations_ledger.sql

ColumnTypeConstraints
versiontextPRIMARY KEY, -- filename without .sql
checksumtextNOT NULL, -- sha256 of file bytes at apply time
applied_attimestamptzNOT NULL DEFAULT now()
applied_bytextNOT NULL -- 'migrate.py:<operator>' | 'backfill'

interested_review_queue

Defined in: 202608261500_interested_review_gate.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
lead_emailTEXTNOT NULL
bison_reply_uuidTEXT
lead_reply_idUUID,-- lead_replies.id when matched at hold time
payloadJSONBNOT NULL, -- original webhook payload, replayed on release
cleaned_replyTEXT
audit_confidenceINTEGER
audit_reasoningTEXT
statusTEXTNOT NULL DEFAULT 'pending'
decided_byTEXT,-- email | 'system:ttl_auto_release' | 'system:subsequent_interest'
decided_atTIMESTAMPTZ
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

task_proposal_batches

One meeting transcript -> one batch of task proposals awaiting the reviewer

Defined in: 202609091700_task_proposals.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
meetingtextNOT NULL
source_hashtext
created_byuuidREFERENCES public.user_profiles(id)
reviewer_iduuidREFERENCES public.user_profiles(id)
statustextNOT NULL DEFAULT 'proposed'
slack_channel_idtext
slack_tstext
summaryjsonbNOT NULL DEFAULT '{}'::jsonb
created_attimestamptzNOT NULL DEFAULT now()
updated_attimestamptzNOT NULL DEFAULT now()

task_proposals

Numbered proposals inside a batch. status moves proposed -> approved/dropped/deferred/asked -> applied/failed.

Defined in: 202609091700_task_proposals.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
batch_iduuidNOT NULL REFERENCES public.task_proposal_batches(id) ON DELETE CASCADE
nintNOT NULL
kindtextNOT NULL
task_iduuidREFERENCES public.tasks(id) ON DELETE SET NULL
assignee_iduuidREFERENCES public.user_profiles(id)
titletext
due_datedate
prioritytext
notetext
quotetext
confidencenumeric
decisiontext
decision_notetext
applied_task_iduuid
statustextNOT NULL DEFAULT 'proposed'
created_attimestamptzNOT NULL DEFAULT now()

task_bot_events

One row per inbound DM to the Maverick Tasks bot: route, parsed intent, action, reply, model use, latency, error.

Defined in: 202609091900_task_bot_events.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
tstimestamptzNOT NULL DEFAULT now()
slack_user_idtext
profile_iduuidREFERENCES public.user_profiles(id) ON DELETE SET NULL
channel_idtext
inbound_texttext
routetext
intent_kindtext
confidencenumeric
actiontext
task_iduuidREFERENCES public.tasks(id) ON DELETE SET NULL
reply_texttext
modeltext
llm_usedbooleanNOT NULL DEFAULT false
latency_msinteger
errortext

account_sync_waves

One row per (wave_id, instance, workspace) account-sync pull. complete = presence for that workspace was fully re-stamped this wave. meta_ columns are the T4 per_page=1 Bison probes; drift = accounts_present - meta_total.*

Defined in: 202609100910_account_sync_waves_presence.sql

ColumnTypeConstraints
idBIGINTGENERATED ALWAYS AS IDENTITY PRIMARY KEY
wave_idUUIDNOT NULL
bison_instanceTEXTNOT NULL
workspace_nameTEXTNOT NULL
started_atTIMESTAMPTZNOT NULL DEFAULT now()
completed_atTIMESTAMPTZ
statusTEXTNOT NULL DEFAULT 'running'
reasonTEXT
accounts_presentINTEGER
meta_totalINTEGER
meta_connectedINTEGER
meta_not_connectedINTEGER
driftINTEGER
drift_flaggedBOOLEANNOT NULL DEFAULT FALSE

nurture_candidates

Defined in: 202609101300_nurture_queue.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nametextNOT NULL
lead_emailtextNOT NULL
lead_reply_iduuidNOT NULL
bison_reply_numeric_idbigint
first_nametext
sender_nametext
agency_nametext
reply_datetimestamptz
lead_texttext
sourcetextNOT NULL DEFAULT 'not_interested'
intenttext
confidenceinteger
reasoningtext
recommendationtext
draft_texttext
draft_modeltext
prompt_versiontext
style_issuesjsonbNOT NULL DEFAULT '[]'::jsonb
statustextNOT NULL DEFAULT 'drafted'
batch_iduuid
slack_channeltext
slack_tstext
decided_bytext
decided_attimestamptz
final_texttext
was_editedboolean
edit_similaritynumeric
send_errortext
sent_attimestamptz
created_attimestamptzNOT NULL DEFAULT now()
updated_attimestamptzNOT NULL DEFAULT now()

task_person_labels

The number each person sees for each task in Slack: stable until the task closes, never reused for that person.

Defined in: 202609151130_task_person_labels.sql

ColumnTypeConstraints
profile_iduuidNOT NULL REFERENCES public.user_profiles(id) ON DELETE CASCADE
task_iduuidNOT NULL REFERENCES public.tasks(id) ON DELETE CASCADE
labelintegerNOT NULL CHECK (label > 0)
created_attimestamptzNOT NULL DEFAULT now()

kpi_client_settings_audit

Defined in: 202609151817_kpi_client_controls.sql

ColumnTypeConstraints
idbigintGENERATED ALWAYS AS IDENTITY PRIMARY KEY
workspace_nametextNOT NULL REFERENCES public.client_registry(workspace_name)
changed_attimestamptzNOT NULL DEFAULT now()
actortextNOT NULL
revisionbigintNOT NULL
before_settingsjsonbNOT NULL
after_settingsjsonbNOT NULL

nurture_lab_runs

Defined in: 202609162100_nurture_lab_runs.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
created_attimestamptzNOT NULL DEFAULT now()
created_bytext
statustextNOT NULL DEFAULT 'queued', -- queued | running | done | failed
specjsonbNOT NULL, -- {variants: [...], sample: {...}, judge: bool}
resultsjsonb,-- {sample: [...], variants: [{name, summary, drafts: [...]}]}
errortext
started_attimestamptz
finished_attimestamptz

domain_daily_stats

Per (workspace, sender domain, day) campaign-event counts pulled from Bison GET /campaign-events/stats with sender_email_ids[] = the domain

Defined in: 202609171200_domain_daily_stats.sql

ColumnTypeConstraints
workspace_nametextNOT NULL
domaintextNOT NULL, -- lower(split_part(email_address, '@', 2))
root_domaintextNOT NULL, -- last two labels of domain
stat_datedateNOT NULL
sentintegerNOT NULL DEFAULT 0
repliedintegerNOT NULL DEFAULT 0
bouncedintegerNOT NULL DEFAULT 0
interestedintegerNOT NULL DEFAULT 0
total_opensintegerNOT NULL DEFAULT 0
unique_opensintegerNOT NULL DEFAULT 0
unsubscribedintegerNOT NULL DEFAULT 0
sender_countintegerNOT NULL DEFAULT 0, -- present senders on the domain at pull time
sourcetextNOT NULL DEFAULT 'campaign_events'
run_idbigint
pulled_attimestamptzNOT NULL DEFAULT now()

domain_stats_runs

Defined in: 202609171200_domain_daily_stats.sql

ColumnTypeConstraints
idbigserialPRIMARY KEY
modetextNOT NULL CHECK (mode IN ('nightly', 'backfill', 'probe'))
workspace_nametextNOT NULL
window_startdateNOT NULL
window_enddateNOT NULL
started_attimestamptzNOT NULL DEFAULT now()
finished_attimestamptz
statustextNOT NULL DEFAULT 'running'
domains_totalintegerNOT NULL DEFAULT 0
domains_okintegerNOT NULL DEFAULT 0
api_callsintegerNOT NULL DEFAULT 0
errorsintegerNOT NULL DEFAULT 0
error_samplejsonb
reconciliationjsonb
probe_resultjsonb-- mode='probe' only: raw response shape, date labels, totals

infra_sizing_standards

Default mailbox counts per client_type. per_100_leads scales with the effective monthly lead target; per_client is a flat count. Google has no quota.

Defined in: 202609181400_infra_account_targets.sql

ColumnTypeConstraints
client_typetextPRIMARY KEY CHECK (client_type IN ('home_insurance', 'commercial', 'other'))
basistextNOT NULL CHECK (basis IN ('per_100_leads', 'per_client'))
azure_accountsintegerNOT NULL CHECK (azure_accounts >= 0)
microsoft_accountsintegerNOT NULL CHECK (microsoft_accounts >= 0)
provisionalbooleanNOT NULL DEFAULT true
revisionbigintNOT NULL DEFAULT 0
updated_bytext
updated_attimestamptzNOT NULL DEFAULT now()

client_infra_targets

Explicit per-client provider account targets. NULL = derive from infra_sizing_standards. 0 = intentionally none.

Defined in: 202609181400_infra_account_targets.sql

ColumnTypeConstraints
workspace_nametextPRIMARY KEY REFERENCES public.client_registry(workspace_name)
azure_targetintegerCHECK (azure_target >= 0)
microsoft_targetintegerCHECK (microsoft_target >= 0)
revisionbigintNOT NULL DEFAULT 0
updated_bytext
updated_attimestamptzNOT NULL DEFAULT now()
created_attimestamptzNOT NULL DEFAULT now()

infra_targets_audit

Defined in: 202609181400_infra_account_targets.sql

ColumnTypeConstraints
idbigintGENERATED ALWAYS AS IDENTITY PRIMARY KEY
scopetextNOT NULL CHECK (scope IN ('client', 'standard'))
keytextNOT NULL
changed_attimestamptzNOT NULL DEFAULT now()
actortextNOT NULL
revisionbigintNOT NULL
before_statejsonbNOT NULL
after_statejsonbNOT NULL

registrar_accounts

Defined in: 202609191200_registrar_roster.sql

ColumnTypeConstraints
idserialPRIMARY KEY
registrartextNOT NULL CHECK (registrar IN ('spaceship','namecheap','godaddy'))
labeltextNOT NULL UNIQUE
ownertext
login_emailtext
access_modetextNOT NULL DEFAULT 'none' CHECK (access_mode IN ('api','csv','none'))
access_statustextNOT NULL DEFAULT 'missing'
assigneetext
api_secret_reftext,-- vault secret NAME (registrar_api_<id>)
api_secret_iduuid,-- vault secret id (for rotate/delete)
login_secret_reftext,-- vault secret NAME (registrar_login_<id>)
login_secret_iduuid
client_ownedbooleanNOT NULL DEFAULT false
csv_inbox_pathtext
last_pull_attimestamptz
last_pull_countinteger
last_errortext
notestext
created_attimestamptzNOT NULL DEFAULT now()
updated_attimestamptzNOT NULL DEFAULT now()

registrar_domains

Defined in: 202609191200_registrar_roster.sql

ColumnTypeConstraints
roottextNOT NULL
account_idintegerNOT NULL REFERENCES public.registrar_accounts(id) ON DELETE CASCADE
registration_datedate
expiration_datedate
auto_renewboolean
registrar_statustext
nameserverstext[]
do_not_renewbooleanNOT NULL DEFAULT false
do_not_renew_bytext
do_not_renew_attimestamptz
burn_sourcetext
first_seen_attimestamptzNOT NULL DEFAULT now()
last_seen_attimestamptzNOT NULL DEFAULT now()

registrar_secret_reveals

Defined in: 202609191200_registrar_roster.sql

ColumnTypeConstraints
idserialPRIMARY KEY
account_idintegerNOT NULL REFERENCES public.registrar_accounts(id) ON DELETE CASCADE
secret_kindtextNOT NULL CHECK (secret_kind IN ('api','login'))
revealed_bytextNOT NULL
revealed_attimestamptzNOT NULL DEFAULT now()

registrar_burn_seeds

Defined in: 202609191200_registrar_roster.sql

ColumnTypeConstraints
roottextPRIMARY KEY
burn_sourcetextNOT NULL
created_attimestamptzNOT NULL DEFAULT now()

infra_vendor_orders

Defined in: 202609191500_aip_ws2_mailin_vendor_orders.sql

ColumnTypeConstraints
idserialPRIMARY KEY
infrastructure_order_idintegerNOT NULL REFERENCES public.infrastructure_orders(id) ON DELETE CASCADE
vendortextNOT NULL DEFAULT 'mailin'
vendor_order_idtext
roottext,-- one Mailin order = one domain (100 boxes)
rootsjsonbNOT NULL DEFAULT '[]'::jsonb
destination_workspacetext
destination_bison_workspace_idinteger
bison_instancetext
personatext
quantityinteger
required_nameserversjsonb,-- from GET /azure-orders/nameservers/{id}
placed_attimestamptz
acked_attimestamptz
last_polled_attimestamptz
last_statustext
last_status_payloadjsonb
delivered_countintegerNOT NULL DEFAULT 0
ns_verified_attimestamptz
sla_alerted_attimestamptz
escalated_attimestamptz
dry_runbooleanNOT NULL DEFAULT true
created_attimestamptzNOT NULL DEFAULT now()
updated_attimestamptzNOT NULL DEFAULT now()

infra_vendor_tickets

Defined in: 202609191500_aip_ws2_mailin_vendor_orders.sql

ColumnTypeConstraints
idserialPRIMARY KEY
infrastructure_order_idintegerREFERENCES public.infrastructure_orders(id) ON DELETE CASCADE
vendortextNOT NULL DEFAULT 'mailin'
kindtextNOT NULL CHECK (kind IN ('delivery_overdue','ns_pending','cancel','replace','reconnect','membership_pending'))
slack_channeltext
slack_tstext
opened_attimestamptzNOT NULL DEFAULT now()
last_nag_attimestamptz
nag_countintegerNOT NULL DEFAULT 0
closed_attimestamptz
statustextNOT NULL DEFAULT 'pending_arm' CHECK (status IN ('pending_arm','open','nagging','closed'))
detailjsonb

infra_sender_moves

Defined in: 202609191500_aip_ws2_mailin_vendor_orders.sql

ColumnTypeConstraints
idserialPRIMARY KEY
infrastructure_order_idintegerREFERENCES public.infrastructure_orders(id) ON DELETE SET NULL
bison_instancetext
source_workspacetextNOT NULL
source_bison_workspace_idinteger
target_workspacetextNOT NULL
target_bison_workspace_idinteger
old_sender_idintegerNOT NULL
new_sender_idinteger
emailtext
moved_attimestamptz
verified_attimestamptz
batch_idtext
dry_runbooleanNOT NULL DEFAULT true
created_attimestamptzNOT NULL DEFAULT now()

infra_credstore_pulls

Defined in: 202609191500_aip_ws2_mailin_vendor_orders.sql

ColumnTypeConstraints
idserialPRIMARY KEY
vendortextNOT NULL DEFAULT 'mailin'
started_attimestamptzNOT NULL DEFAULT now()
finished_attimestamptz
statustextNOT NULL DEFAULT 'running' CHECK (status IN ('running','ok','skipped_no_key','smoke_ok','error'))
domains_seenintegerNOT NULL DEFAULT 0
files_writtenintegerNOT NULL DEFAULT 0
rows_addedintegerNOT NULL DEFAULT 0
promoted_incomingintegerNOT NULL DEFAULT 0
errortext
dry_runbooleanNOT NULL DEFAULT true

infra_pipeline_steps

AIP run ledger (hub §4): one row per pipeline step per sub-order (or per onboarding for human/vendor gates). lane = writing stream; step_key = <lane>.<name> lowercase; status dark = recorded while the flag was off, evidence.would_do says what would have happened. Written only via app/services/pipeline_ledger.record_step. Not the v1 onboarding_steps checklist.

Defined in: 202609200800_aip_ws1_pipeline_ledger.sql

ColumnTypeConstraints
idbigintGENERATED ALWAYS AS IDENTITY PRIMARY KEY
client_onboarding_idintegerREFERENCES public.client_onboardings(id) ON DELETE SET NULL
infrastructure_order_idintegerREFERENCES public.infrastructure_orders(id) ON DELETE CASCADE
lanetextNOT NULL CHECK (lane IN ('ws1', 'ws2', 'ws3', 'ws4', 'ws5', 'ws6', 'ws7', 'human', 'vendor'))
step_keytextNOT NULL CHECK (step_key ~ '^[a-z0-9_]+.[a-z0-9_]+$')
statustextNOT NULL CHECK (status IN ('pending', 'running', 'waiting', 'done', 'failed', 'skipped', 'dark'))
started_attimestamptz
finished_attimestamptz
waiting_ontext
next_actiontext
ownertext
flag_keytext
darkbooleanNOT NULL DEFAULT false
evidencejsonbNOT NULL DEFAULT '{}'::jsonb
created_attimestamptzNOT NULL DEFAULT now()
updated_attimestamptzNOT NULL DEFAULT now()
scope_keytextGENERATED ALWAYS AS (
CASEWHENinfrastructure_order_id IS NOT NULL

domain_purchase_plans

Defined in: 202609200900_aip_ws4_domain_purchase_plans.sql

ColumnTypeConstraints
idbigserialPRIMARY KEY
client_onboarding_idbigintNOT NULL
infrastructure_order_idbigintNOT NULL
provider_keytextNOT NULL CHECK (provider_key IN ('google_ws','microsoft_365','azure','other'))
registrar_account_idintegerREFERENCES public.registrar_accounts(id)
base_domaintextNOT NULL
sending_nametext
requested_countintegerNOT NULL CHECK (requested_count >= 0)
daily_capintegerNOT NULL DEFAULT 10 CHECK (daily_cap BETWEEN 1 AND 100)
estimated_cost_centsintegerNOT NULL DEFAULT 0
receiptjsonbNOT NULL DEFAULT '{}'::jsonb
planning_completebooleanNOT NULL DEFAULT false
planning_generationuuidNOT NULL DEFAULT gen_random_uuid()
statustextNOT NULL DEFAULT 'planned'
max_total_spend_centsintegerCHECK (max_total_spend_cents > 0)
max_total_registrationsintegerCHECK (max_total_registrations > 0)
cancellation_requested_attimestamptz
approved_bytext
approved_attimestamptz
last_run_attimestamptz
next_eligible_attimestamptz
consecutive_billing_errorsintegerNOT NULL DEFAULT 0
last_errortext
created_attimestamptzNOT NULL DEFAULT now()
updated_attimestamptzNOT NULL DEFAULT now()

domain_purchase_items

Defined in: 202609200900_aip_ws4_domain_purchase_plans.sql

ColumnTypeConstraints
idbigserialPRIMARY KEY
plan_idbigintNOT NULL REFERENCES public.domain_purchase_plans(id) ON DELETE CASCADE
roottextNOT NULL UNIQUE
stemtext
is_backupbooleanNOT NULL DEFAULT false
statustextNOT NULL DEFAULT 'candidate'
deny_reasontext
rdap_checked_attimestamptz
rdap_availableboolean
availability_checked_attimestamptz
async_operation_idtext
planning_generationuuid
submission_iduuidUNIQUE
submitted_attimestamptz
cancellation_requested_attimestamptz
dns_statustextNOT NULL DEFAULT 'pending' CHECK (dns_status IN ('pending','verified','blocked'))
dns_dispatched_attimestamptz
dns_last_errortext
purchased_attimestamptz
price_centsinteger
attemptsintegerNOT NULL DEFAULT 0
last_errortext
sourcetextNOT NULL DEFAULT 'runner' CHECK (source IN ('runner','runner_legacy'))
created_attimestamptzNOT NULL DEFAULT now()
updated_attimestamptzNOT NULL DEFAULT now()

domain_dns_intents

Defined in: 202609200910_aip_ws4_domain_dns_intents.sql

ColumnTypeConstraints
roottextPRIMARY KEY
revisionuuidNOT NULL DEFAULT gen_random_uuid()
client_onboarding_idbigint
infrastructure_order_idbigint
lanetextNOT NULL DEFAULT 'other' CHECK (lane IN ('microsoft_365','azure','other'))
ns_intenttextNOT NULL DEFAULT 'basic' CHECK (ns_intent IN ('basic','mailin_cf','external'))
ns_intent_hoststext[]
ns_intent_set_bytext
ns_intent_set_attimestamptz
ns_applied_attimestamptz
desired_recordsjsonbNOT NULL DEFAULT '[]'::jsonb
pending_slotsjsonbNOT NULL DEFAULT '[]'::jsonb
forwarding_urltext
dkim_tenant_domaintext
applied_attimestamptz
verified_attimestamptz
last_probe_attimestamptz
driftjsonbNOT NULL DEFAULT '{}'::jsonb
drift_statetextNOT NULL DEFAULT 'pending' CHECK (drift_state IN ('pending','ok','drift','unreachable'))
dbl_listedboolean
dbl_codetext
dmarc_presentboolean
forward_presentboolean
sourcetextNOT NULL DEFAULT 'runner' CHECK (source IN ('runner','declared','probe_only'))
created_attimestamptzNOT NULL DEFAULT now()
updated_attimestamptzNOT NULL DEFAULT now()

ms365_provisioning_runs

Defined in: 202609201000_aip_ws3_ms365_provisioning_registry.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
order_idINTEGERNOT NULL REFERENCES public.infrastructure_orders(id) ON DELETE CASCADE
client_onboarding_idINTEGERREFERENCES public.client_onboardings(id) ON DELETE SET NULL
workspace_nameTEXT
bison_instanceTEXT
bison_workspace_idINTEGER
panel_numberSMALLINTREFERENCES public.ms365_panels(panel_number)
statusTEXTNOT NULL DEFAULT 'planned'
stageTEXT
blockerTEXT
planJSONBNOT NULL DEFAULT '{}'::jsonb
domainsJSONBNOT NULL DEFAULT '[]'::jsonb
total_accountsINTEGERNOT NULL DEFAULT 0
accounts_createdINTEGERNOT NULL DEFAULT 0
accounts_connectedINTEGERNOT NULL DEFAULT 0
accounts_posturedINTEGERNOT NULL DEFAULT 0
connect_attemptsINTEGERNOT NULL DEFAULT 0
error_messageTEXT
celery_task_idTEXT
planned_atTIMESTAMPTZNOT NULL DEFAULT now()
dns_ready_atTIMESTAMPTZ
domains_verified_atTIMESTAMPTZ
users_created_atTIMESTAMPTZ
aged_ready_atTIMESTAMPTZ
connect_completed_atTIMESTAMPTZ
posture_verified_atTIMESTAMPTZ
dkim_atTIMESTAMPTZ
created_atTIMESTAMPTZNOT NULL DEFAULT now()
updated_atTIMESTAMPTZNOT NULL DEFAULT now()

ms365_provisioning_run_logs

Defined in: 202609201000_aip_ws3_ms365_provisioning_registry.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
run_idBIGINTREFERENCES public.ms365_provisioning_runs(id) ON DELETE CASCADE
panel_numberSMALLINT
stepTEXTNOT NULL
statusTEXTNOT NULL
messageTEXT
payloadJSONBNOT NULL DEFAULT '{}'::jsonb
logged_atTIMESTAMPTZNOT NULL DEFAULT now()

ms365_seat_reservations

Defined in: 202609201000_aip_ws3_ms365_provisioning_registry.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
run_idBIGINTREFERENCES public.ms365_provisioning_runs(id) ON DELETE CASCADE
order_idINTEGERNOT NULL REFERENCES public.infrastructure_orders(id) ON DELETE CASCADE
panel_numberSMALLINTNOT NULL REFERENCES public.ms365_panels(panel_number)
seatsINTEGERNOT NULL CHECK (seats >= 0)
domain_slotsINTEGERNOT NULL CHECK (domain_slots >= 0)
statusTEXTNOT NULL DEFAULT 'active' CHECK (status IN ('active', 'consumed', 'released'))
created_atTIMESTAMPTZNOT NULL DEFAULT now()
expires_atTIMESTAMPTZNOT NULL
updated_atTIMESTAMPTZNOT NULL DEFAULT now()

ms365_recon_findings

Defined in: 202609201000_aip_ws3_ms365_provisioning_registry.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
panel_numberSMALLINTREFERENCES public.ms365_panels(panel_number)
run_idBIGINTREFERENCES public.ms365_provisioning_runs(id) ON DELETE SET NULL
workspace_nameTEXT
email_addressTEXT
kindTEXTNOT NULL
detailJSONBNOT NULL DEFAULT '{}'::jsonb
statusTEXTNOT NULL DEFAULT 'open' CHECK (status IN ('open', 'resolved', 'dismissed'))
first_seen_atTIMESTAMPTZNOT NULL DEFAULT now()
last_seen_atTIMESTAMPTZNOT NULL DEFAULT now()
resolved_atTIMESTAMPTZ
resolved_byTEXT

ms365_domain_tenants

*Sending domain -> Microsoft tenant, resolved from the public OpenID issuer *

Defined in: 202609212200_ms365_panel_tags.sql

ColumnTypeConstraints
domaintextPRIMARY KEY
tenant_iduuid
panel_numberinteger
resolved_attimestamptzNOT NULL DEFAULT now()
sourcetextNOT NULL CHECK (source IN ('openid', 'graph'))
errortext

ms365_panel_tag_runs

*One row per ms365_panel_tags.run. mode dry_run = plan only, no Bison or *

Defined in: 202609212200_ms365_panel_tags.sql

ColumnTypeConstraints
idbigserialPRIMARY KEY
started_attimestamptzNOT NULL DEFAULT now()
finished_attimestamptz
modetextNOT NULL CHECK (mode IN ('dry_run', 'apply'))
armedbooleanNOT NULL DEFAULT false
scopejsonbNOT NULL DEFAULT '{}'::jsonb
countsjsonbNOT NULL DEFAULT '{}'::jsonb
per_workspacejsonbNOT NULL DEFAULT '{}'::jsonb
per_paneljsonbNOT NULL DEFAULT '{}'::jsonb
unresolvedjsonbNOT NULL DEFAULT '[]'::jsonb
errorsjsonbNOT NULL DEFAULT '[]'::jsonb
created_bytext

domain_root_assignments

Defined in: 202609212300_aip_ws4_assignment_recovery.sql

ColumnTypeConstraints
roottextPRIMARY KEY CHECK (root = lower(root) AND root ~ '^a-z0-9?.[a-z]{2,63}$')
client_onboarding_idintegerNOT NULL REFERENCES public.client_onboardings(id)
infrastructure_order_idintegerNOT NULL REFERENCES public.infrastructure_orders(id)
registrar_account_idintegerNOT NULL REFERENCES public.registrar_accounts(id)
sourcetextNOT NULL CHECK (source IN ('runner','operator'))
assigned_bytextNOT NULL CHECK (length(assigned_by) > 0)
assigned_attimestamptzNOT NULL DEFAULT now()

infra_ws2_canary_policies

Defined in: 20260922041636_aip_ws2_canary_reservations.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
enabledbooleanNOT NULL DEFAULT false
expires_attimestamptzNOT NULL
currencytextNOT NULL CHECK (currency ~ '^[A-Z]{3}$')
approved_bytextNOT NULL CHECK (length(trim(approved_by)) > 0)
lifetime_mutationsbigintNOT NULL CHECK (lifetime_mutations >= 0)
daily_mutationsbigintNOT NULL CHECK (daily_mutations >= 0)
lifetime_spend_minorbigintNOT NULL CHECK (lifetime_spend_minor >= 0)
daily_spend_minorbigintNOT NULL CHECK (daily_spend_minor >= 0)
created_attimestamptzNOT NULL DEFAULT now()

infra_ws2_canary_scopes

Defined in: 20260922041636_aip_ws2_canary_reservations.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
policy_iduuidNOT NULL REFERENCES public.infra_ws2_canary_policies(id)
actiontextNOT NULL CHECK (action IN ('placement', 'staging_move'))
infrastructure_order_idintegerNOT NULL REFERENCES public.infrastructure_orders(id)
roottextNOT NULL CHECK (root = lower(trim(root)) AND root ~ '^[a-z0-9][a-z0-9.-]*[a-z0-9]$')
destination_workspacetextNOT NULL CHECK (length(trim(destination_workspace)) > 0)
destination_bison_workspace_idintegerNOT NULL CHECK (destination_bison_workspace_id > 0)
bison_instancetextNOT NULL CHECK (length(trim(bison_instance)) > 0)
price_per_mutation_minornumeric(20,6)CHECK (
expires_attimestamptzNOT NULL

infra_ws2_canary_reservations

Defined in: 20260922041636_aip_ws2_canary_reservations.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
reservation_iduuidNOT NULL
policy_iduuidNOT NULL REFERENCES public.infra_ws2_canary_policies(id)
scope_iduuidNOT NULL REFERENCES public.infra_ws2_canary_scopes(id)
actiontextNOT NULL CHECK (action IN ('placement', 'staging_move'))
identitytextNOT NULL
bison_instancetextNOT NULL
mutationsbigintNOT NULL CHECK (mutations > 0)
spend_minorbigintNOT NULL CHECK (spend_minor >= 0)
reserved_attimestamptzNOT NULL DEFAULT clock_timestamp()
receiptjsonb
receipt_attimestamptz
intentjsonb
recovery_checked_attimestamptz
recovery_completebooleanNOT NULL DEFAULT false

infra_pipeline_step_observations

AIP immutable run/attempt snapshots from the projection transaction or explicit program/flag events. No backfill and no subject FK: past identities survive subject removal. Read acceptance history here, not from the latest-state projection.

Defined in: 202609220500_aip_ws1_observation_history.sql

ColumnTypeConstraints
idbigintGENERATED ALWAYS AS IDENTITY PRIMARY KEY
observation_iduuidNOT NULL UNIQUE
run_idtextNOT NULL CHECK (btrim(run_id) <> '')
attemptintegerNOT NULL CHECK (attempt >= 0)
scope_keytextNOT NULL
program_scopetext
infrastructure_order_idinteger
client_onboarding_idinteger
lanetextNOT NULL CHECK (lane IN ('ws1', 'ws2', 'ws3', 'ws4', 'ws5', 'ws6', 'ws7', 'human', 'vendor'))
step_keytextNOT NULL CHECK (step_key ~ '^[a-z0-9_]+.[a-z0-9_]+$')
statustextNOT NULL CHECK (status IN ('pending', 'running', 'waiting', 'done', 'failed', 'skipped', 'dark'))
flag_keytext
darkbooleanNOT NULL DEFAULT false
evidencejsonbNOT NULL DEFAULT '{}'::jsonb
started_attimestamptz
finished_attimestamptz
waiting_ontext
next_actiontext
ownertext
observed_attimestamptzNOT NULL DEFAULT clock_timestamp()
ANDscope_key= 'order:' || infrastructure_order_id::text)
ANDprogram_scopeIS NULL AND scope_key = 'onboarding:' || client_onboarding_id::text)
ANDprogram_scopeIS NOT NULL AND program_scope ~ '^[a-z][a-z0-9_-]*$'
ANDflag_keyIS NOT NULL AND btrim(flag_key) <> ''
ANDscope_key= 'program:' || program_scope || ':flag:' || flag_key)

bounce_digest_events

Durable metadata-only bounce notification receipts. Acknowledgement is Slack delivery state, not business state. Keep acknowledged keys to suppress future webhook retries; no raw DSN/payload is stored.

Defined in: 20260922142229_bounce_digest_receipts.sql

ColumnTypeConstraints
event_keytextPRIMARY KEY CHECK (event_key ~ '^[0-9a-f]{32}$')
workspace_nametextNOT NULL
workspace_idbigint
instance_urltext
sender_email_idbigint
sender_emailtextNOT NULL
root_domaintextNOT NULL
is_quotabooleanNOT NULL
source_received_attimestamptzNOT NULL
processed_attimestamptzNOT NULL DEFAULT clock_timestamp()
acknowledged_attimestamptz

warmup_gate_snapshots

Defined in: 20260922155704_aip_ws5_warmup_gate.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
order_idINTEGERNOT NULL REFERENCES public.infrastructure_orders(id) ON DELETE CASCADE
snapshot_dateDATENOT NULL
linked_countINTEGERNOT NULL DEFAULT 0 CHECK (linked_count >= 0)
connected_countINTEGERNOT NULL DEFAULT 0 CHECK (connected_count >= 0)
warmup_on_countINTEGERNOT NULL DEFAULT 0 CHECK (warmup_on_count >= 0)
scored_countINTEGERNOT NULL DEFAULT 0 CHECK (scored_count >= 0)
avg_scoreNUMERIC(6,2)CHECK (avg_score BETWEEN 0 AND 100)
pct_warm_onNUMERIC(5,4)CHECK (pct_warm_on BETWEEN 0 AND 1)
pct_score_okNUMERIC(5,4)CHECK (pct_score_ok BETWEEN 0 AND 1)
days_warmingINTEGERNOT NULL DEFAULT 0 CHECK (days_warming >= 0)
decisionTEXTNOT NULL CHECK (decision IN ('immature', 'matured_evidence', 'matured_calendar', 'held'))
hold_reasonTEXT
errorTEXT
paramsJSONBNOT NULL DEFAULT '{}'::jsonb CHECK (jsonb_typeof(params) = 'object')
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()

mailbox_limit_ledger

Every change to a mailbox

Defined in: 202609240800_panel_cap_ramp.sql

ColumnTypeConstraints
idbigserialPRIMARY KEY
attimestamptzNOT NULL DEFAULT now()
bison_sender_email_idinteger
email_addresstext
workspace_nametext
ms365_panelsmallint
kindtextNOT NULL CHECK (kind IN ('campaign', 'warmup'))
beforeinteger
afterinteger
sourcetextNOT NULL CHECK (source IN ('plan', 'plan_dry', 'manual', 'observed', 'rollback'))
reasontext
run_idtext
actortext
override_untiltimestamptz
notetext

panel_budget_snapshots

The panel-cap ramp

Defined in: 202609240800_panel_cap_ramp.sql

ColumnTypeConstraints
idbigserialPRIMARY KEY
panel_numbersmallintNOT NULL
run_attimestamptzNOT NULL DEFAULT now()
run_idtext
modetextNOT NULL CHECK (mode IN ('dark', 'dry_run', 'live'))
statustextNOT NULL CHECK (status IN ('planned', 'unmeasured', 'no_boxes', 'no_tier'))
capinteger
marginnumeric(4,3)
budget_totalinteger
boxesintegerNOT NULL DEFAULT 0
per_box_budgetinteger
seat_bandtext
tier_pctsmallint
fits_minimumbooleanNOT NULL DEFAULT false
campaign_totalintegerNOT NULL DEFAULT 0
warmup_totalintegerNOT NULL DEFAULT 0
raisesintegerNOT NULL DEFAULT 0
clampsintegerNOT NULL DEFAULT 0
writesintegerNOT NULL DEFAULT 0
observedinteger
detailjsonbNOT NULL DEFAULT '{}'::jsonb

task_evidence

One row per (task, evidence item) the reconciler judged; applied=false rows are the shadow-mode measurement set.

Defined in: 202609240900_task_reconciler.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
run_datedateNOT NULL
person_iduuidREFERENCES public.user_profiles(id) ON DELETE SET NULL
task_iduuidREFERENCES public.tasks(id) ON DELETE CASCADE
kindtextNOT NULL CHECK (kind IN ('pr', 'commit', 'digest', 'slack'))
reftextNOT NULL
excerpttext
occurred_attimestamptz
verdicttextCHECK (verdict IN ('done', 'progress', 'blocked', 'none'))
confidencenumeric
quotetext
hardbooleanNOT NULL DEFAULT false
appliedbooleanNOT NULL DEFAULT false
applied_actiontext
created_attimestamptzNOT NULL DEFAULT now()

client_call_notes

What a client asked for on a call, structured, so the work can be handed to anyone.

Defined in: 202609240930_task_context_outbox.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
meetingtextNOT NULL
call_datedateNOT NULL
client_nametext
agencytext
workspace_hinttext
contact_nametext
attendeesjsonbNOT NULL DEFAULT '[]'::jsonb
requestsjsonbNOT NULL DEFAULT '[]'::jsonb, -- [{ask, quote, owner_hint}]
factsjsonbNOT NULL DEFAULT '[]'::jsonb, -- [{topic, value, quote}]
decisionsjsonbNOT NULL DEFAULT '[]'::jsonb
next_stepsjsonbNOT NULL DEFAULT '[]'::jsonb
batch_iduuidREFERENCES public.task_proposal_batches(id) ON DELETE SET NULL
created_byuuidREFERENCES public.user_profiles(id)
created_attimestamptzNOT NULL DEFAULT now()

vault_outbox

Notes the platform wants in the team vault; flushed by vault_writer through the GitHub API.

Defined in: 202609240930_task_context_outbox.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
pathtextNOT NULL
modetextNOT NULL CHECK (mode IN ('append', 'replace'))
sectiontext,-- append: a marker line; present in the file means already written
contenttextNOT NULL
statustextNOT NULL DEFAULT 'pending' CHECK (status IN ('pending', 'done', 'failed', 'skipped'))
errortext
created_attimestamptzNOT NULL DEFAULT now()
applied_attimestamptz

meeting_schedule

Defined in: 202609241000_meeting_schedule.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
event_idtextNOT NULL
calendartextNOT NULL, -- the mailbox whose calendar it came from
titletextNOT NULL
starts_attimestamptzNOT NULL
ends_attimestamptzNOT NULL
attendeesjsonbNOT NULL DEFAULT '[]'::jsonb
externalbooleanNOT NULL DEFAULT false
profiletextNOT NULL, -- team | client_onboarding | client | exec | skip
labeltextNOT NULL, -- the meeting label the notes mail will carry
statustextNOT NULL DEFAULT 'scheduled' CHECK (status IN ('scheduled', 'ingested', 'no_notes', 'skipped', 'failed'))
attemptsintNOT NULL DEFAULT 0
detailtext
created_attimestamptzNOT NULL DEFAULT now()
updated_attimestamptzNOT NULL DEFAULT now()

work_ownership_rules

Who owns a task. Evaluate enabled rules of the asked scope_kind by ordinal ascending; the LAST match wins. scope_kind=default is the fallback: keep exactly one enabled default row (documented, not enforced by trigger). Seeded by work_ownership.seed_rules; hand-edited rows keep a note that does not start with "seed:" so the seeder leaves them alone.

Defined in: 202609241300_work_foundations.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
ordinalintegerNOT NULL DEFAULT 100
scope_kindtextNOT NULL
patterntextNOT NULL
owner_profile_iduuidNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
owner_roletextNULL
notetextNULL
enabledbooleanNOT NULL DEFAULT true
created_attimestamptzNOT NULL DEFAULT now()
updated_attimestamptzNOT NULL DEFAULT now()

work_rules

One row per automated rule with its mode. off: do nothing. shadow: compute and record what would happen, send nothing. suggest: ask a human (buttons/DM). apply: act. Read through work_rules.get_rule (60 s cache); a missing row reads as shadow.

Defined in: 202609241300_work_foundations.sql

ColumnTypeConstraints
rule_keytextPRIMARY KEY
modetextNOT NULL DEFAULT 'shadow'
paramsjsonbNOT NULL DEFAULT '{}'::jsonb
descriptiontextNULL
updated_attimestamptzNOT NULL DEFAULT now()

work_rule_overrides

A human undid or corrected what a rule did (or, in shadow/suggest, what it proposed). Override rate per rule = rows here / rule applications (task_timeline rows whose payload carries the rule_key) over a window; see work_rules.override_rate.

Defined in: 202609241300_work_foundations.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
rule_keytextNOT NULL REFERENCES public.work_rules(rule_key) ON DELETE CASCADE
task_iduuidNULL REFERENCES public.tasks(id) ON DELETE SET NULL
evidence_refsjsonbNOT NULL DEFAULT '[]'::jsonb
beforejsonbNULL
afterjsonbNULL
actor_iduuidNULL REFERENCES public.user_profiles(id) ON DELETE SET NULL
reasontextNULL
sourcetextNOT NULL DEFAULT 'system'
created_attimestamptzNOT NULL DEFAULT now()

work_entity_disagreements

Two sources disagree about an entity (e.g. Clients/anna-luna-agency.md says workspace 61, its ops note says platform_workspace_id 43). The seed job records the conflict here and picks nothing; a human resolves it.

Defined in: 202609241300_work_foundations.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
entity_typetextNOT NULL
canonical_nametextNOT NULL
fieldtextNOT NULL
statustextNOT NULL DEFAULT 'open'
created_attimestamptzNOT NULL DEFAULT now()

work_findings_config

One row per audit check key (audit_findings.check_key) or MCP finding class (mcp:<finding_class>). enabled=false means the finding is scored in work_findings_log but never becomes a task.

Defined in: 202609241400_work_items.sql

ColumnTypeConstraints
check_keytextPRIMARY KEY
sourcetextNOT NULL CHECK (source IN ('audit_findings', 'mcp_audit_findings'))
enabledbooleanNOT NULL DEFAULT false
severity_floortextNOT NULL DEFAULT 'warn' CHECK (severity_floor IN ('info', 'warn', 'high'))
hold_cyclesintegerNOT NULL DEFAULT 1
resolve_window_runsintegerNOT NULL DEFAULT 2
owner_scope_kindtextNOT NULL DEFAULT 'check_key'
fallback_owner_roletext
next_actiontext
notetext
updated_attimestamptzNOT NULL DEFAULT now()

work_findings_log

What findings.sync decided per finding per run. In shadow mode this is the whole output; in apply mode task_id points at the item touched.

Defined in: 202609241400_work_items.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
run_datedateNOT NULL
check_keytextNOT NULL
workspace_nametext
fingerprinttextNOT NULL
actiontextNOT NULL CHECK (action IN (
task_iduuidREFERENCES public.tasks(id) ON DELETE SET NULL
detailjsonbNOT NULL DEFAULT '{}'::jsonb
created_attimestamptzNOT NULL DEFAULT now()

llm_traces

One row per LLM call in the task pipeline: what went in (ids only), what came out, how sure it was, what was done with it, and what a human said afterwards.

Defined in: 202609241430_llm_traces.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
call_kindtextNOT NULL
modeltext
prompt_hashtext
schema_versiontext
input_idsjsonbNOT NULL DEFAULT '{}'::jsonb
outputjsonb
confidencenumeric
decisiontextCHECK (decision IS NULL OR decision IN ('auto', 'ask', 'skip', 'none'))
human_outcometext
usagejsonb
latency_msint
errortext
created_attimestamptzNOT NULL DEFAULT now()

brain_notes

One row per team-vault note the brain index knows; path is the vault-relative markdown path. deleted_at set (not removed) when the note leaves the vault or becomes excluded.

Defined in: 202609241500_brain_index.sql

ColumnTypeConstraints
pathtextPRIMARY KEY
titletextNOT NULL
doc_typetext
statustext
ownertext
tagstext[]NOT NULL DEFAULT '{}'::text[]
aliasestext[]NOT NULL DEFAULT '{}'::text[]
client_keytext
workspace_idsjsonbNOT NULL DEFAULT '{}'::jsonb
frontmatterjsonbNOT NULL DEFAULT '{}'::jsonb
summarytext
content_hashtextNOT NULL
commit_shatext
indexed_attimestamptzNOT NULL DEFAULT now()
deleted_attimestamptz

brain_chunks

Retrieval units of the brain index: one per H2/H3 section (split further near 300 tokens). tsv is generated from prefix + body; embedding is NULL until an embedder writes it.

Defined in: 202609241500_brain_index.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
note_pathtextNOT NULL REFERENCES public.brain_notes(path) ON DELETE CASCADE
headingtextNOT NULL DEFAULT ''
ordinalintegerNOT NULL
prefixtext
bodytextNOT NULL
tokensintegerNOT NULL DEFAULT 0
content_hashtextNOT NULL
tsvtsvectorGENERATED ALWAYS AS (to_tsvector('english', coalesce(prefix, '') || ' ' || body)) STORED
embeddingvector(1024)
commit_shatext
created_attimestamptzNOT NULL DEFAULT now()

Wikilinks between notes. to_path is the resolved vault path when the target is indexed, else the raw link target (unresolved links are kept so they resolve on a later run).

Defined in: 202609241500_brain_index.sql

ColumnTypeConstraints
from_pathtextNOT NULL REFERENCES public.brain_notes(path) ON DELETE CASCADE
to_pathtextNOT NULL
to_titletext
kindtextNOT NULL DEFAULT 'wikilink'

brain_index_state

Single row (id = 1): which vault (repo or local dir), the last commit indexed, when, and the live note/chunk counts. The incremental indexer diffs from last_commit_sha.

Defined in: 202609241500_brain_index.sql

ColumnTypeConstraints
idintegerPRIMARY KEY DEFAULT 1 CHECK (id = 1)
repotext
last_commit_shatext
last_run_attimestamptz
notesintegerNOT NULL DEFAULT 0
chunksintegerNOT NULL DEFAULT 0

work_handoffs

Every report-thread reply the hand-off intake judged; action=create rows carry the task in apply mode, or what would have been created in shadow.

Defined in: 202609241530_work_handoffs.sql

ColumnTypeConstraints
fingerprinttextPRIMARY KEY, -- slack:<channel>:<message_ts>
channel_idtextNOT NULL
thread_tstextNOT NULL
message_tstextNOT NULL
permalinktext
requester_iduuidREFERENCES public.user_profiles(id) ON DELETE SET NULL
owner_iduuidREFERENCES public.user_profiles(id) ON DELETE SET NULL
collaborator_idsuuid[]NOT NULL DEFAULT '{}'
titletext
actiontextNOT NULL CHECK (action IN ('create','skip_no_mention','skip_not_team','skip_ack','skip_question','skip_channel','noop','error'))
modetextNOT NULL, -- work_rules mode at the time: shadow | apply
task_iduuidREFERENCES public.tasks(id) ON DELETE SET NULL
detailjsonbNOT NULL DEFAULT '{}'::jsonb
created_attimestamptzNOT NULL DEFAULT now()

lead_loss_checks

Defined in: 202609250800_lead_loss_checks.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
lead_reply_iduuidNOT NULL UNIQUE, -- lead_replies.id of the reply in question
workspace_nametextNOT NULL
lead_emailtextNOT NULL
first_nametext
reply_datetimestamptz
reply_texttext
sourcetextNOT NULL, -- gate_said_lead | nurtured_not_billed | rejected_then_wrote_again | followup_unclassified | question_not_nurtured
scoresmallintNOT NULL DEFAULT 0, -- 0..99, likelihood the lead was lost
evidencejsonbNOT NULL DEFAULT '{}'::jsonb, -- {gate_confidence, gate_intent, nurture_intent, nurture_confidence, our_action, later_replies, later_interested, bison_folder, bison_interested, ...}
statustextNOT NULL DEFAULT 'open', -- open | lost | dismissed | resolved
resolutiontext,-- for resolved: marked as lead | deleted in Bison | marked not interested in Bison
decided_bytext
decided_attimestamptz
notetext
bison_urltext
first_seen_attimestamptzNOT NULL DEFAULT now()
checked_attimestamptzNOT NULL DEFAULT now()
updated_attimestamptzNOT NULL DEFAULT now()

exec_briefs

One row per executive-brief run (shadow or apply). The brief is about day; facts is everything the collectors found with baselines, attribution and context; judgments the model

Defined in: 202609251200_exec_briefs.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
daydateNOT NULL
window_starttimestamptz
window_endtimestamptz
factsjsonbNOT NULL DEFAULT '{}'::jsonb
linesjsonbNOT NULL DEFAULT '[]'::jsonb
judgmentsjsonbNOT NULL DEFAULT '[]'::jsonb
droppedjsonbNOT NULL DEFAULT '[]'::jsonb
reasoningtext
texttext
modeltext
trace_iduuidNULL
modetextNOT NULL
sent_totext[]DEFAULT '{}'
sent_attimestamptzNULL
emptybooleanNOT NULL DEFAULT false
created_attimestamptzDEFAULT now()

exec_brief_state

Single-row memory for the executive brief: the MS365 panel values seen on the previous run, so the next run reports only panels whose TERRL verdict or plan status changed.

Defined in: 202609251200_exec_briefs.sql

ColumnTypeConstraints
idintPRIMARY KEY DEFAULT 1
last_panel_statejsonbDEFAULT '{}'::jsonb
last_daydate

exec_brief_feedback

What Tommy or Ray said about one line of one brief. The last 30 rows are shown to the model on every run ("what the readers said about earlier lines"), so the brief improves from corrections without a code change.

Defined in: 202609251200_exec_briefs.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
brief_iduuidNOT NULL REFERENCES public.exec_briefs(id) ON DELETE CASCADE
line_indexintNOT NULL
verdicttextNOT NULL CHECK (verdict IN ('useful', 'noise', 'wrong'))
notetext
created_bytext
created_attimestamptzNOT NULL DEFAULT now()

domain_purchase_operator_attempts

Defined in: 20260925215015_aip_ws4_operator_mcp_claim.sql

ColumnTypeConstraints
submission_iduuidPRIMARY KEY REFERENCES public.domain_purchase_items(submission_id)
item_idbigintNOT NULL UNIQUE REFERENCES public.domain_purchase_items(id)
plan_idbigintNOT NULL REFERENCES public.domain_purchase_plans(id)
planning_generationuuidNOT NULL
onboarding_idintegerNOT NULL REFERENCES public.client_onboardings(id)
order_idintegerNOT NULL REFERENCES public.infrastructure_orders(id)
account_idintegerNOT NULL CHECK (account_id=1)
roottextNOT NULL CHECK (root='schmitzbenefitsagency.com')
price_centsintegerNOT NULL CHECK (price_cents=908)
spend_cap_centsintegerNOT NULL CHECK (spend_cap_cents=908)
registration_capintegerNOT NULL CHECK (registration_cap=1)
termsjsonbNOT NULL
args_fingerprinttextNOT NULL CHECK (args_fingerprint ~ '^[0-9a-f]{64}$')
payment_fingerprinttextNOT NULL CHECK (payment_fingerprint ~ '^[0-9a-f]{64}$')
token_digesttextNOT NULL CHECK (token_digest ~ '^[0-9a-f]{64}$')
preview_observed_attimestamptzNOT NULL
preview_expires_attimestamptz
absent_checked_attimestamptzNOT NULL
operator_idtextNOT NULL CHECK (length(operator_id)>0)
approval_referencetextNOT NULL CHECK (length(approval_reference)>=8)
claimed_attimestamptzNOT NULL DEFAULT now()
statetextNOT NULL DEFAULT 'claimed' CHECK (state IN
operation_idtextUNIQUE
no_charge_statustext
evidencejsonb
settled_attimestamptz
updated_attimestamptzNOT NULL DEFAULT now()

infra_mailin_destination_bindings

Owned Mailin provider creation intent. No API keys; creating is permanently reconcile-only after initial INSERT.

Defined in: 202609270130_mailin_destination_bindings.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
infrastructure_order_idintegerNOT NULL UNIQUE REFERENCES public.infrastructure_orders(id)
destination_workspacetextNOT NULL
destination_bison_workspace_idintegerNOT NULL CHECK (destination_bison_workspace_id > 0)
bison_instancetextNOT NULL
instance_urltextNOT NULL
registry_workspace_idintegerNOT NULL
token_idintegerNOT NULL
token_sha256textNOT NULL CHECK (token_sha256 ~ '^[0-9a-f]{64}$')
personatextNOT NULL CHECK (length(trim(persona)) > 0)
provider_nametextNOT NULL UNIQUE
provider_idintegerUNIQUE CHECK (provider_id > 0)
statustextNOT NULL DEFAULT 'creating' CHECK (status IN ('creating', 'ready'))
created_attimestamptzNOT NULL DEFAULT now()
verified_attimestamptz

domain_purchase_operator_expansions

Tony personal ws41/Maverick only; account1; config7 legacy_panel; Sarah Schmitz; one root and30 MS365 accounts per order. All claim attempts permanently consume caps.

Defined in: 20260927014309_aip_ws4_operator_expansions.sql

ColumnTypeConstraints
iduuidPRIMARY KEY DEFAULT gen_random_uuid()
rootstext[]NOT NULL CHECK (aip_ws4_operator_roots_valid(roots))
max_total_registrationsintegerNOT NULL CHECK (max_total_registrations BETWEEN 1 AND cardinality(roots))
max_total_spend_centsintegerNOT NULL CHECK (max_total_spend_cents BETWEEN 908 AND 9080)
quotejsonbNOT NULL CHECK (aip_ws4_operator_terms_valid(quote))
expires_attimestamptzNOT NULL
approved_bytextNOT NULL CHECK (length(trim(approved_by))>0)
approval_referencetextNOT NULL UNIQUE CHECK (length(trim(approval_reference)) BETWEEN 8 AND 200)
approved_attimestamptzNOT NULL DEFAULT clock_timestamp()

domain_purchase_operator_expansion_bindings

Defined in: 20260927014309_aip_ws4_operator_expansions.sql

ColumnTypeConstraints
plan_idbigintPRIMARY KEY REFERENCES public.domain_purchase_plans(id)
expansion_iduuidNOT NULL REFERENCES public.domain_purchase_operator_expansions(id)
item_idbigintNOT NULL UNIQUE REFERENCES public.domain_purchase_items(id)
roottextNOT NULL UNIQUE
onboarding_idintegerNOT NULL REFERENCES public.client_onboardings(id)
order_idintegerNOT NULL UNIQUE REFERENCES public.infrastructure_orders(id)
planning_generationuuidNOT NULL
bound_attimestamptzNOT NULL DEFAULT clock_timestamp()

infra_ws2_canary_revocations

Defined in: 20260927182518_mailin_pilot_approval.sql

ColumnTypeConstraints
policy_iduuidPRIMARY KEY REFERENCES public.infra_ws2_canary_policies(id)
revoked_bytextNOT NULL CHECK (length(trim(revoked_by)) > 0)
reason_referencetextNOT NULL CHECK (length(trim(reason_reference)) BETWEEN 1 AND 500)
revoked_attimestamptzNOT NULL DEFAULT clock_timestamp()

ms365_pilot_delivery_receipts

Defined in: 20260928000001_ms365_pilot_delivery.sql

ColumnTypeConstraints
run_idbigintPRIMARY KEY REFERENCES public.ms365_provisioning_runs(id)
order_idintegerNOT NULL UNIQUE REFERENCES public.infrastructure_orders(id)
receiptjsonbNOT NULL
verified_attimestamptzNOT NULL
actortextNOT NULL CHECK(length(trim(actor)) > 0)
created_attimestamptzNOT NULL DEFAULT clock_timestamp()

domain_owned_root_adoptions

Defined in: 20260928040000_ms365_child_units_owned_roots.sql

ColumnTypeConstraints
idbigserialPRIMARY KEY
roottextNOT NULL CHECK (root = lower(root) AND root ~ '^a-z0-9?.[a-z]{2,63}$')
registrar_account_idintegerNOT NULL REFERENCES public.registrar_accounts(id)
infrastructure_order_idintegerNOT NULL REFERENCES public.infrastructure_orders(id)
client_onboarding_idbigintNOT NULL
parent_order_idintegerREFERENCES public.infrastructure_orders(id)
provider_keytextNOT NULL DEFAULT 'microsoft_365' CHECK (provider_key = 'microsoft_365')
registration_datedateNOT NULL
expiration_datedate
registrar_statustextNOT NULL CHECK (registrar_status = 'registered')
receipt_referencetextNOT NULL CHECK (length(trim(receipt_reference)) > 0)
evidencejsonbNOT NULL
adopted_bytextNOT NULL CHECK (length(trim(adopted_by)) > 0)
adopted_attimestamptzNOT NULL DEFAULT clock_timestamp()
revoked_attimestamptz
revoked_reasontext

bison_change_log

Observed Bison changes (campaign state, leads, sends; account connection events). Written by the hourly campaign sync and the account webhooks. No actor: Bison does not expose one.

Defined in: 202609282100_bison_change_log.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
observed_atTIMESTAMPTZNOT NULL DEFAULT now()
dayDATENOT NULL, -- Chicago day of observed_at, set by the writer
workspace_nameTEXTNOT NULL
entity_typeTEXTNOT NULL CHECK (entity_type IN ('campaign', 'account'))
entity_idTEXTNOT NULL, -- Bison campaign id or sender email id
entity_nameTEXT,-- campaign name or mailbox address
changeTEXTNOT NULL, -- campaign_created, campaign_launched, campaign_resumed, campaign_paused
deltaINTEGER,-- leads added / emails sent since the previous observation
beforeJSONB
afterJSONB
sourceTEXTNOT NULL CHECK (source IN ('campaign_sync', 'webhook', 'snapshot'))
created_atTIMESTAMPTZNOT NULL DEFAULT now()

runtime_policies

Editable automation guidance text (Settings > Automation); code defaults in app/core/runtime_policy.py

Defined in: 202609291700_runtime_policies.sql

ColumnTypeConstraints
keyTEXTPRIMARY KEY
titleTEXTNOT NULL
textTEXTNOT NULL
updated_byTEXT
updated_atTIMESTAMPTZNOT NULL DEFAULT now()

panel_plan_reviews

Apply / Skip decisions on the ramp executor plan per panel per run (Panels tab readout, 2026-09-30)

Defined in: 202609300745_panel_plan_reviews.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
run_idTEXTNOT NULL
panel_numberINTEGERNOT NULL
decisionTEXTNOT NULL CHECK (decision IN ('apply', 'skip'))
noteTEXT
decided_byTEXT
decided_atTIMESTAMPTZNOT NULL DEFAULT now()
applied_run_idTEXT
resultJSONB

lead_claim_config

Defined in: 202609301600_lead_claim_sync.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL UNIQUE
modeTEXTNOT NULL DEFAULT 'off' CHECK (mode IN ('off', 'shadow', 'on'))
policyTEXTNOT NULL DEFAULT 'first_reply' CHECK (policy IN ('first_reply', 'round_robin'))
accept_window_minutesINTEGERNOT NULL DEFAULT 30
max_rotation_hopsINTEGERNOT NULL DEFAULT 2
rotation_cursorINTEGERNOT NULL DEFAULT 0
contention_window_secondsINTEGERNOT NULL DEFAULT 600
slack_channel_idTEXT
producersJSONBNOT NULL DEFAULT '[]'
admin_slack_user_idsJSONBNOT NULL DEFAULT '[]'
max_reply_age_hoursINTEGERNOT NULL DEFAULT 72
display_timezoneTEXTNOT NULL DEFAULT 'America/Los_Angeles'
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

lead_owners

Defined in: 202609301600_lead_claim_sync.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
lead_emailTEXTNOT NULL
statusTEXTNOT NULL DEFAULT 'assigned' CHECK (status IN ('proposed', 'assigned', 'open'))
owner_keyTEXT,-- roster portal_email, lowercase; NULL when open
owner_nameTEXT
owner_slack_user_idTEXT
portal_user_idUUID
sourceTEXT,-- email | portal | slack | round_robin | expiry
event_atTIMESTAMPTZ,-- when the human acted
claimed_atTIMESTAMPTZ,-- when the ledger recorded it
accept_deadlineTIMESTAMPTZ,-- proposals only
engaged_by_keyTEXT,-- a claim held behind a proposal
engaged_by_nameTEXT
engaged_atTIMESTAMPTZ
rotation_hopsINTEGERNOT NULL DEFAULT 0
portal_workspaceTEXT
slack_channel_idTEXT
slack_card_tsTEXT
announced_owner_keyTEXT,-- last (owner, status) posted to Slack
announced_statusTEXT
portal_applied_keyTEXT,-- last owner written to the portal
versionINTEGERNOT NULL DEFAULT 1
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

lead_claim_events

Defined in: 202609301600_lead_claim_sync.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
lead_emailTEXTNOT NULL
sourceTEXTNOT NULL
source_refTEXTNOT NULL
authorityTEXTNOT NULL DEFAULT 'claim', -- claim | reassign | release | propose
actor_keyTEXT,-- who is claiming / being assigned
actor_nameTEXT
actor_emailTEXT,-- the From address / Slack id / portal user
by_nameTEXT,-- who performed a reassign or release
event_atTIMESTAMPTZ
outcomeTEXTNOT NULL DEFAULT 'processing'
reasonTEXT
modeTEXT
previous_owner_keyTEXT
portal_writtenBOOLEANNOT NULL DEFAULT FALSE
portal_reasonTEXT
slack_postedBOOLEANNOT NULL DEFAULT FALSE
slack_reply_tsTEXT
slack_reasonTEXT
error_messageTEXT
processing_time_msINTEGER
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

campaign_rosters

Observed campaign membership per sender (operator roster refresh, 2026-10)

Defined in: 202610010900_operator_tables.sql

ColumnTypeConstraints
workspace_nameTEXTNOT NULL
campaign_idINTEGERNOT NULL
bison_sender_email_idINTEGERNOT NULL
campaign_nameTEXT
campaign_statusTEXT
presentBOOLEANNOT NULL DEFAULT true
first_seen_atTIMESTAMPTZNOT NULL DEFAULT now()
last_seen_atTIMESTAMPTZNOT NULL DEFAULT now()

infra_decisions

Infrastructure operator decisions ledger: every limit / warm-up / tag / membership change proposed, applied or observed (2026-10)

Defined in: 202610010900_operator_tables.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
atTIMESTAMPTZNOT NULL DEFAULT now()
run_idTEXT
policyTEXTNOT NULL
kindTEXTNOT NULL CHECK (kind IN ('campaign', 'warmup', 'warmup_enabled', 'burnt_tag', 'campaign_member'))
sourceTEXTNOT NULL DEFAULT 'operator' CHECK (source IN ('operator', 'external', 'human'))
statusTEXTNOT NULL DEFAULT 'proposed'
bison_sender_email_idINTEGERNOT NULL
email_addressTEXT
workspace_nameTEXTNOT NULL
ms365_panelSMALLINT
campaign_idINTEGER
beforeINTEGER
afterINTEGER
reasonTEXT
detailJSONB
decided_byTEXT
applied_atTIMESTAMPTZ
verified_atTIMESTAMPTZ
expires_atTIMESTAMPTZ
errorTEXT

infra_runs

Infrastructure operator run summaries (2026-10)

Defined in: 202610010900_operator_tables.sql

ColumnTypeConstraints
run_idTEXTPRIMARY KEY
started_atTIMESTAMPTZNOT NULL DEFAULT now()
finished_atTIMESTAMPTZ
kindTEXTNOT NULL DEFAULT 'daily' CHECK (kind IN ('daily', 'bounce_tick', 'review_apply', 'reverse'))
summaryJSONBNOT NULL DEFAULT '{}'::jsonb

email_account_limit_changes

Defined in: 202610010900_operator_tables.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
changed_atTIMESTAMPTZNOT NULL DEFAULT now()
bison_sender_email_idINTEGER
email_addressTEXT
workspace_nameTEXT
ms365_panelSMALLINT
kindTEXTNOT NULL CHECK (kind IN ('campaign', 'warmup', 'warmup_enabled', 'burnt_tag'))
beforeINTEGER
afterINTEGER
processed_atTIMESTAMPTZ

operator_box_stats_cache

Defined in: 202610010900_operator_tables.sql

ColumnTypeConstraints
email_addressTEXTPRIMARY KEY
sentBIGINTNOT NULL DEFAULT 0
bouncedBIGINTNOT NULL DEFAULT 0
repliedBIGINTNOT NULL DEFAULT 0
warmup_sentBIGINTNOT NULL DEFAULT 0
days_sendingBIGINTNOT NULL DEFAULT 0
last_send_dateDATE
first_campaign_send_atDATE
computed_atTIMESTAMPTZNOT NULL DEFAULT now()

operator_feedback

Review comments on infrastructure operator proposal lines (2026-10)

Defined in: 202610011300_operator_feedback.sql

ColumnTypeConstraints
idBIGSERIALPRIMARY KEY
atTIMESTAMPTZNOT NULL DEFAULT now()
authorTEXTNOT NULL
line_keyTEXTNOT NULL, -- "panel|93|panel_limits|warmup" or "root|ws|domain|burnt_tags|burnt_tag"
policyTEXT
verdictTEXTNOT NULL CHECK (verdict IN ('right', 'wrong', 'question'))
noteTEXT
snapshotJSONB
resolved_atTIMESTAMPTZ
resolved_byTEXT

burnt_verdicts

Nightly burn verdict per (workspace, root) at the tag line; the history the burnt lifecycle counts detections on (2026-10)

Defined in: 202610011500_burnt_lifecycle.sql

ColumnTypeConstraints
asofDATENOT NULL
workspace_nameTEXTNOT NULL
root_domainTEXTNOT NULL
stateTEXTNOT NULL, -- v3 state at the tag line: burnt | healthy | ramping | not_enough_data | idle
laneTEXT,-- rolling | remainder | bounce
watchBOOLEANNOT NULL DEFAULT false, -- burnt at the watch line only
zero_replyBOOLEANNOT NULL DEFAULT false, -- sustained burn with no reply at all (window and 30 days)
measuredBOOLEANNOT NULL DEFAULT false
freshBOOLEANNOT NULL DEFAULT false, -- enough sends in the last 7 days to be new evidence
detectedBOOLEANNOT NULL DEFAULT false, -- would start a lifecycle that day (own-lane sustained burn, or dead on arrival)
window_sentINTEGER
window_repliedINTEGER
window_rateNUMERIC
bounce_rateNUMERIC
sent_7dINTEGER
replied_7dINTEGER
days_burnt_last_7INTEGER
boxesINTEGER
recorded_atTIMESTAMPTZNOT NULL DEFAULT now()

burnt_roots

Burnt lifecycle per (workspace, root): detections, stage and the gates to the next step; advanced by every operator daily run (2026-10)

Defined in: 202610011500_burnt_lifecycle.sql

ColumnTypeConstraints
workspace_nameTEXTNOT NULL
root_domainTEXTNOT NULL
stageTEXTNOT NULL CHECK (stage IN ('grace', 'confirmed', 'delete', 'recovered', 'done'))
detectionsINTEGERNOT NULL DEFAULT 0, -- weekly detections in a row, each on fresh sends
zero_replyBOOLEANNOT NULL DEFAULT false
stalledBOOLEANNOT NULL DEFAULT false, -- no fresh sends at the last check: cannot move by itself
tag_onlyBOOLEANNOT NULL DEFAULT false, -- carries the Burnt tag but no detection is on record
first_detected_onDATENOT NULL
last_detected_onDATENOT NULL
last_evidence_onDATE
last_checked_onDATE
next_check_onDATE
recovered_onDATE
manual_burnt_onDATE,-- a person marked it truly burnt
manual_burnt_byTEXT
boxesINTEGERNOT NULL DEFAULT 0, -- present mailboxes on the root
boxes_taggedINTEGERNOT NULL DEFAULT 0
boxes_in_campaignINTEGERNOT NULL DEFAULT 0
boxes_warmup_onINTEGERNOT NULL DEFAULT 0
providerTEXT,-- azure | microsoft | google | mixed
vendorTEXT,-- who supplies the mailboxes; 'own panels' for our tenants
gatesJSONBNOT NULL DEFAULT '{}'::jsonb, -- what still blocks the next step, and the next action
evidenceJSONBNOT NULL DEFAULT '{}'::jsonb, -- the last verdict, for the board
cohort_idINTEGERREFERENCES public.burnt_cohorts(id) ON DELETE SET NULL
updated_atTIMESTAMPTZNOT NULL DEFAULT now()

campaign_roster_refreshes

Defined in: 202610011500_burnt_lifecycle.sql

ColumnTypeConstraints
workspace_nameTEXTPRIMARY KEY
refreshed_atTIMESTAMPTZNOT NULL
membersINTEGERNOT NULL DEFAULT 0
unreadINTEGERNOT NULL DEFAULT 0 -- campaigns whose roster could not be read in that refresh

lead_claim_clickup_tasks

Defined in: 202610011800_lead_claim_clickup.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
lead_emailTEXTNOT NULL
task_idTEXTNOT NULL
list_idTEXT
task_urlTEXT
applied_owner_keyTEXT,-- owner the task's assignee was last set to ('' = unassigned)
applied_statusTEXT,-- ledger status last reflected on the task
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

lead_claim_clickup_posts

Defined in: 202610011800_lead_claim_clickup.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
lead_emailTEXTNOT NULL
channel_idTEXTNOT NULL
message_idTEXTNOT NULL
posted_atTIMESTAMPTZNOT NULL DEFAULT NOW()
leadJSONBNOT NULL DEFAULT '{}'::jsonb, -- name, contact fields, custom variables as posted
briefJSONBNOT NULL DEFAULT '{}'::jsonb, -- readiness, what is in hand, what is missing
messagesJSONBNOT NULL DEFAULT '[]'::jsonb, -- the homeowner's own messages, oldest first
attachmentsJSONBNOT NULL DEFAULT '[]'::jsonb
linksJSONBNOT NULL DEFAULT '{}'::jsonb
reply_cursor_msBIGINTNOT NULL DEFAULT 0, -- newest thread reply already read
last_lead_reply_refTEXT,-- newest homeowner message already relayed
reminder_sent_atTIMESTAMPTZ
escalated_atTIMESTAMPTZ
owner_nudged_atTIMESTAMPTZ,-- claimed, but no email to the homeowner seen yet
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

lead_claim_clickup_backlog

Defined in: 202610011800_lead_claim_clickup.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
workspace_nameTEXTNOT NULL
lead_emailTEXTNOT NULL
priorityINTEGERNOT NULL DEFAULT 0, -- higher goes first
tierTEXT,-- waiting_on_us | ready_to_quote | engaged | interested
statusTEXTNOT NULL DEFAULT 'queued' CHECK (status IN ('queued', 'released', 'skipped'))
reasonTEXT
leadJSONBNOT NULL DEFAULT '{}'::jsonb
messagesJSONBNOT NULL DEFAULT '[]'::jsonb
waiting_sinceDATE
queued_atTIMESTAMPTZNOT NULL DEFAULT NOW()
released_atTIMESTAMPTZ
released_toTEXT,-- producer the lead was handed to
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

lead_claim_clickup_state

Defined in: 202610011800_lead_claim_clickup.sql

ColumnTypeConstraints
workspace_nameTEXTPRIMARY KEY
channel_cursor_msBIGINTNOT NULL DEFAULT 0
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

ops_alerts

Defined in: 202610041300_ops_alerts.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
seqBIGSERIALNOT NULL UNIQUE, -- stream cursor (EventSource since_seq)
severityTEXTNOT NULL DEFAULT 'warning' CHECK (severity IN ('info', 'warning', 'critical'))
sourceTEXTNOT NULL, -- emitter slug: ops, infra_disconnect, bounce, billing, ...
titleTEXTNOT NULL
bodyTEXTNOT NULL DEFAULT ''
link_pathTEXT,-- dashboard path, e.g. /infrastructure?ws=x
dedupe_keyTEXTNOT NULL, -- caller-supplied or sha1(source + title)
first_seenTIMESTAMPTZNOT NULL DEFAULT NOW()
last_seenTIMESTAMPTZNOT NULL DEFAULT NOW()
countINTEGERNOT NULL DEFAULT 1
acknowledged_byTEXT,-- user email; one ack silences everyone
acknowledged_atTIMESTAMPTZ
resolved_atTIMESTAMPTZ
escalated_atTIMESTAMPTZ,-- ops_alerts.escalate_unacknowledged stamp
metaJSONBNOT NULL DEFAULT '{}'::jsonb
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

ops_alert_prefs

Defined in: 202610041300_ops_alerts.sql

ColumnTypeConstraints
user_idUUIDPRIMARY KEY
min_severityTEXTNOT NULL DEFAULT 'info' CHECK (min_severity IN ('info', 'warning', 'critical'))
soundBOOLEANNOT NULL DEFAULT TRUE
quiet_hoursJSONB,-- {start:"22:00", end:"07:00", tz:"America/Chicago", critical:"notify"|"ring"|"silent"}
muted_sourcesTEXT[]NOT NULL DEFAULT '{}'
ringtoneTEXTNOT NULL DEFAULT 'classic', -- classic | chime | siren | pulse | bell
warning_soundBOOLEANNOT NULL DEFAULT TRUE
source_overridesJSONBNOT NULL DEFAULT '{}'::jsonb, -- {source: ring|notify|feed|mute}
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

desktop_app_policy

Defined in: 202610041300_ops_alerts.sql

ColumnTypeConstraints
appTEXTPRIMARY KEY CHECK (app IN ('dashboard', 'portal'))
min_versionTEXTNOT NULL DEFAULT '0.1.0'
disabledBOOLEANNOT NULL DEFAULT FALSE
messageTEXT
download_urlTEXT
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

ops_alert_routes

Defined in: 202610041300_ops_alerts.sql

ColumnTypeConstraints
idUUIDPRIMARY KEY DEFAULT gen_random_uuid()
sourceTEXTNOT NULL DEFAULT '', -- registry key or '' = any
min_severityTEXTNOT NULL CHECK (min_severity IN ('info', 'warning', 'critical'))
recipientsJSONBNOT NULL DEFAULT '{"all": true}'::jsonb, -- {"all": true} | {"emails": [...]}
behaviorTEXTNOT NULL CHECK (behavior IN ('ring', 'notify', 'feed', 'mute'))
ringtoneTEXT
ringtone_lockedBOOLEANNOT NULL DEFAULT FALSE
enabledBOOLEANNOT NULL DEFAULT TRUE
priorityINTEGERNOT NULL DEFAULT 100
created_byTEXT
created_atTIMESTAMPTZNOT NULL DEFAULT NOW()
updated_atTIMESTAMPTZNOT NULL DEFAULT NOW()

fairplan_replies

Defined in: 20261013220000_fairplan_replies.sql

ColumnTypeConstraints
iduuidprimary key default gen_random_uuid()
lead_reply_iduuidnot null unique
workspace_nametextnot null
lead_emailtextnot null
lead_nametext
bison_reply_idbigint
conversation_urltext
client_iduuid
client_tokentext
intenttextnot null check (intent in ('yes','no','question','later','other'))
reasoningtext
reply_texttext
drafttext
statustextnot null default 'pending' check (status in ('pending','sending','sent','skipped','failed','declined','review'))
decided_bytext
decided_attimestamptz
sent_attimestamptz
errortext
slack_channeltext
slack_tstext
created_attimestamptznot null default now()

operator_box_snapshots

what every mailbox looked like to the operator each night (limits, warm-up, tags, campaign membership); the diff between two nights, less the ledger, is what people and scripts changed

Defined in: 202610141500_operator_rails.sql

ColumnTypeConstraints
snapshot_datedatenot null
bison_sender_email_idintegernot null
workspace_nametextnot null
email_addresstextnot null
campaign_limitinteger
warmup_limitinteger
warmup_enabledboolean
bison_statustext
burntbooleannot null default false
probationbooleannot null default false
backupbooleannot null default false
in_active_campaignbooleannot null default false
ms365_panelinteger
infrastructure_order_idinteger
recorded_attimestamptznot null default now()

operator_box_origins

present mailboxes that came from another client

Defined in: 202610142200_operator_origins_ledger.sql

ColumnTypeConstraints
bison_sender_email_idintegerprimary key
email_addresstextnot null
workspace_nametextnot null, -- where it is now
root_domaintext
origin_workspacetextnot null, -- where it came from (a workspace slug)
origin_clienttext,-- the client's name as people say it (seed), when the slug is not enough
moved_atdate,-- the day it arrived here, when known
sourcetextnot null, -- mirror_moved_to | change_log | seed:<name> | person:<who>
vendortext
mailin_order_idinteger
recorded_attimestamptznot null default now()
updated_attimestamptznot null default now()

operator_fleet_ledger

nightly fleet counts per workspace x vendor x provider x own/backup as the operator read them (fleet_ledger.py); history kept

Defined in: 202610142200_operator_origins_ledger.sql

ColumnTypeConstraints
ledger_datedatenot null
workspace_nametextnot null
vendortextnot null default '-'
providertextnot null default '-'
backupbooleannot null default false
boxesintegernot null default 0
burntintegernot null default 0
probationintegernot null default 0
warmingintegernot null default 0, -- warm-up not done yet (order stage / warm-up age)
ready_idleintegernot null default 0, -- warmed, clean, on no campaign at all
liveintegernot null default 0, -- on an active campaign
paused_onlyintegernot null default 0, -- only on paused campaigns
warmup_onintegernot null default 0
recorded_attimestamptznot null default now()

registrar_domain_observations

Append-only registrar observations, not purchase receipts. Existing-roster seeds begin history at migration time; registry registration_date is never acquisition evidence.

Defined in: 202610171210_registrar_purchase_observations.sql

ColumnTypeConstraints
idbigserialPRIMARY KEY
roottextNOT NULL
account_idintegerNOT NULL REFERENCES public.registrar_accounts(id)
kindtextNOT NULL CHECK (kind IN ('discovered', 'changed'))
sourcetextNOT NULL CHECK (source IN ('registrar_api', 'registrar_csv', 'existing_roster', 'unspecified'))
collected_attimestamptzNOT NULL
recorded_attimestamptzNOT NULL DEFAULT now()
registration_datedate
previous_registration_datedate
expiration_datedate
previous_expiration_datedate
auto_renewboolean
previous_auto_renewboolean
registrar_statustext
previous_registrar_statustext

domain_lifecycle_alert_deliveries

Defined in: 202610171230_domain_lifecycle_alerts.sql

ColumnTypeConstraints
iduuidPRIMARY KEY
channel_idtextNOT NULL
bodytextNOT NULL
statustextNOT NULL DEFAULT 'pending' CHECK (status IN ('pending', 'sending', 'sent'))
attemptsintegerNOT NULL DEFAULT 0
lease_tokenuuid
lease_expires_attimestamptz
last_errortext
slack_tstext
sent_attimestamptz
created_attimestamptzNOT NULL DEFAULT now()
updated_attimestamptzNOT NULL DEFAULT now()

domain_lifecycle_alert_events

Defined in: 202610171230_domain_lifecycle_alerts.sql

ColumnTypeConstraints
channel_idtextNOT NULL
event_keytextNOT NULL
delivery_iduuidNOT NULL REFERENCES public.domain_lifecycle_alert_deliveries(id)
created_attimestamptzNOT NULL DEFAULT now()

Indexes

IndexTableColumns
idx_user_workspace_access_user_iduser_workspace_accessuser_id
idx_user_workspace_access_workspaceuser_workspace_accessworkspace_name
idx_user_workspace_access_roleuser_workspace_accessrole
idx_client_registry_workspace_nameclient_registryworkspace_name
idx_client_registry_activeclient_registryis_active
idx_client_registry_billing_typeclient_registrybilling_type
idx_client_settings_workspaceclient_settingsworkspace_name
idx_client_pricing_workspaceclient_pricingworkspace_name
idx_client_costs_workspace_monthclient_costsworkspace_name, month
idx_revenue_snapshots_workspace_monthmonthly_revenue_snapshotsworkspace_name, month
idx_client_zipcodes_workspaceclient_zipcodesworkspace_name
idx_client_zipcodes_stateclient_zipcodesstate
idx_client_zipcodes_monthclient_zipcodesmonth
idx_client_zipcodes_zipclient_zipcodeszip_code
idx_raw_contacts_upload_batchraw_contactsupload_batch_id
idx_raw_contacts_workspace_monthraw_contactsworkspace_name, month
idx_raw_contacts_statusraw_contactsprocessing_status
idx_raw_contacts_purchase_dateraw_contactsparsed_purchase_date
idx_raw_contacts_zipraw_contactsproperty_zip
idx_raw_contacts_scraping_jobraw_contactsscraping_job_id
idx_verified_contacts_workspace_monthverified_contactsworkspace_name, month
idx_verified_contacts_week_bucketverified_contactsweek_bucket
idx_verified_contacts_renewal_datesverified_contactsrenewal_start_date, renewal_end_date
idx_verified_contacts_upload_statusverified_contactsis_uploaded, week_bucket
idx_verified_contacts_debounce_statusverified_contactsdebounce_status
idx_verified_contacts_hnwverified_contactsis_high_net_worth
idx_weekly_batches_workspace_monthweekly_batchesworkspace_name, month
idx_weekly_batches_scheduleweekly_batchesscheduled_upload_date, bison_upload_status
idx_weekly_batches_statusweekly_batchesbison_upload_status
idx_upload_audit_batchupload_audit_logbatch_id
idx_upload_audit_workspace_monthupload_audit_logworkspace_name, month
idx_upload_audit_actionupload_audit_logaction
idx_upload_audit_statusupload_audit_logstatus
idx_upload_audit_dateupload_audit_logperformed_at DESC
idx_debounce_usage_monthdebounce_usagemonth
idx_debounce_usage_workspacedebounce_usageworkspace_name
idx_debounce_usage_datedebounce_usageverified_at DESC
idx_scraping_jobs_workspacescraping_jobsworkspace_name
idx_scraping_jobs_statusscraping_jobsstatus
idx_scraping_jobs_createdscraping_jobscreated_at DESC
idx_scraping_jobs_celery_taskscraping_jobscelery_task_id
idx_scraping_job_logs_job_idscraping_job_logsjob_id
idx_scraping_job_logs_logged_atscraping_job_logslogged_at DESC
idx_agent_runs_workflowagent_runsworkflow
idx_agent_runs_client_idagent_runsclient_id
idx_agent_runs_statusagent_runsstatus
idx_agent_runs_started_atagent_runsstarted_at DESC
idx_agent_errors_run_idagent_errorsrun_id
idx_agent_errors_stepagent_errorsstep
idx_agent_errors_typeagent_errorserror_type
idx_agent_errors_resolvedagent_errorsresolved
idx_site_credentials_sitesite_credentialssite
idx_site_credentials_usernamesite_credentialsusername
idx_client_leads_workspaceclient_leadsworkspace_name
idx_client_leads_pipelineclient_leadspipeline_stage
idx_client_leads_dateclient_leadsdate_received DESC
idx_client_leads_airtableclient_leadsairtable_id
idx_client_leads_updatedclient_leadsupdated_at DESC
idx_client_leads_emailclient_leadslead_email
idx_client_leads_interestedclient_leadsinterested
idx_client_leads_deletedclient_leadsdeleted_at
idx_email_accounts_workspaceemail_accountsworkspace_name
idx_email_accounts_statusemail_accountsstatus
idx_email_accounts_healthemail_accountshealth_score
idx_email_account_metadata_accountemail_account_metadataemail_account_id
idx_email_account_metadata_dateemail_account_metadatametric_date DESC
idx_user_profiles_emailuser_profilesemail
idx_user_profiles_default_workspaceuser_profilesdefault_workspace_name
idx_user_profiles_is_activeuser_profilesis_active
idx_user_workspace_access_activeuser_workspace_accessuser_id, workspace_name
idx_raw_contacts_workspace_statusraw_contactsworkspace_name, processing_status
idx_raw_contacts_workspace_monthraw_contactsworkspace_name, month
idx_raw_contacts_batchraw_contactsupload_batch_id
idx_raw_contacts_jobraw_contactsscraping_job_id
idx_raw_contacts_emailraw_contactsemail
idx_raw_contacts_workspace_status_monthraw_contactsworkspace_name, processing_status, month
idx_raw_contacts_email_domainraw_contactsemail_domain
idx_raw_contacts_purchase_yearraw_contactspurchase_year
idx_raw_contacts_ageraw_contactsage_years
idx_raw_contacts_dnc_landlineraw_contactsdnc_landline
idx_raw_contacts_dnc_cellraw_contactsdnc_cell
idx_raw_contacts_dobraw_contactsdate_of_birth
idx_raw_contacts_purchase_amountraw_contactspurchase_amount
idx_filter_rules_workspace_activeclient_filter_rulesworkspace_name, is_active, priority
idx_filter_rules_fieldclient_filter_rulesfield_name
idx_verified_contacts_head_of_householdverified_contactsis_head_of_household
idx_verified_contacts_email_domainverified_contactsemail_domain
idx_verified_contacts_engagementverified_contactslast_engagement_at DESC
idx_verified_contacts_campaign_targetingverified_contactsworkspace_name, is_uploaded, is_head_of_household, email_domain
idx_client_registry_email_bison_workspaceclient_registryemail_bison_workspace_id
idx_weekly_batches_bison_campaign_idweekly_batchesbison_campaign_id
idx_site_credentials_vault_secret_idsite_credentialsvault_secret_id
idx_credential_audit_credential_idcredential_audit_logcredential_id
idx_credential_audit_performed_bycredential_audit_logperformed_by
idx_credential_audit_actioncredential_audit_logaction
idx_credential_audit_created_atcredential_audit_logcreated_at DESC
idx_scraping_job_batches_job_idscraping_job_batchesjob_id
idx_scraping_job_batches_statusscraping_job_batchesstatus
idx_scraping_job_batches_workspacescraping_job_batchesworkspace_name
idx_scraping_job_batches_state_monthscraping_job_batchesstate, month
idx_scraping_job_batches_credentialscraping_job_batchescredential_id
idx_scraping_job_batches_celery_taskscraping_job_batchescelery_task_id
idx_scraping_job_batches_activescraping_job_batchesworkspace_name, status, created_at DESC
idx_campaign_metrics_batch_idcampaign_metricsbatch_id
idx_campaign_metrics_campaign_idcampaign_metricsemail_bison_campaign_id
idx_campaign_metrics_synced_atcampaign_metricssynced_at DESC
idx_raw_contacts_workspace_month_emailraw_contactsworkspace_name, month, email
idx_raw_contacts_workspace_month_addressraw_contactsworkspace_name, month, property_address
idx_debounce_bulk_workspacedebounce_bulk_jobsworkspace_name
idx_debounce_bulk_statusdebounce_bulk_jobsstatus
idx_debounce_bulk_list_iddebounce_bulk_jobsdebounce_list_id
idx_scraping_jobs_credential_usernamescraping_jobscredential_username
idx_filtering_tasks_workspacefiltering_tasksworkspace_name
idx_filtering_tasks_statusfiltering_tasksstatus
idx_filtering_tasks_createdfiltering_taskscreated_at DESC
idx_verification_tasks_workspaceverification_tasksworkspace_name
idx_verification_tasks_statusverification_tasksstatus
idx_verification_tasks_createdverification_taskscreated_at DESC
idx_verification_tasks_bulk_jobverification_tasksbulk_job_id
idx_pipeline_runs_workspacepipeline_runsworkspace_name
idx_pipeline_runs_statuspipeline_runsstatus
idx_pipeline_runs_run_idpipeline_runsrun_id
idx_pipeline_runs_created_atpipeline_runscreated_at DESC
idx_verified_contacts_upload_statusverified_contactsupload_status
idx_email_accounts_bison_idemail_accountsbison_sender_email_id
idx_email_accounts_workspace_bison_statusemail_accountsworkspace_name, bison_status
idx_email_accounts_warmup_scoreemail_accountswarmup_score
idx_email_accounts_sent_today_dateemail_accountsemails_sent_today_date
idx_campaign_metrics_statuscampaign_metricscampaign_status
idx_campaign_metrics_workspacecampaign_metricsworkspace_name
idx_campaign_metrics_completioncampaign_metricscompletion_percentage DESC
idx_campaign_metrics_workspace_statuscampaign_metricsworkspace_name, campaign_status
idx_client_leads_bison_id_intclient_leadsbison_lead_id_int
idx_client_leads_campaign_statusclient_leadsworkspace_name, lead_campaign_status
idx_client_leads_bison_campaignclient_leadsbison_campaign_id
idx_client_leads_verification_statusclient_leadsbison_verification_status
idx_client_leads_synced_atclient_leadsbison_lead_synced_at DESC
idx_client_leads_automated_replyclient_leadsis_automated_reply
idx_client_targets_workspaceclient_targetsworkspace_name
idx_client_targets_monthclient_targetsmonth DESC
idx_client_targets_workspace_monthclient_targetsworkspace_name, month
idx_client_targets_contacts_progressclient_targetscontacts_progress DESC
idx_client_targets_leads_progressclient_targetsleads_progress DESC
idx_crm_delivery_workspacecrm_delivery_logworkspace_name
idx_crm_delivery_lead_emailcrm_delivery_loglead_email
idx_crm_delivery_successcrm_delivery_logsuccess
idx_crm_delivery_createdcrm_delivery_logcreated_at
idx_crm_delivery_pending_retrycrm_delivery_lognext_retry_at
idx_slack_notifications_uniqueslack_notifications_sentreply_id, notification_type
idx_slack_notifications_workspaceslack_notifications_sentworkspace_name
idx_lead_replies_workspacelead_repliesworkspace_name
idx_lead_replies_emaillead_replieslead_email
idx_lead_replies_interestedlead_repliesis_interested
idx_lead_replies_datelead_repliesreply_date DESC
idx_lead_replies_live_enabledlead_replieslive_replies_enabled, reply_date DESC
idx_webhook_log_workspacewebhook_delivery_logworkspace_name
idx_webhook_log_eventwebhook_delivery_logevent_type
idx_webhook_log_createdwebhook_delivery_logcreated_at DESC
idx_webhook_log_failureswebhook_delivery_logsuccess
idx_webhook_health_workspacewebhook_healthworkspace_name
idx_webhook_health_unhealthywebhook_healthis_healthy
idx_raw_contacts_source_typeraw_contactssource_type
idx_raw_contacts_master_vendorraw_contactsmaster_vendor_id
idx_raw_contacts_master_dedupraw_contactsworkspace_name, month, master_vendor_id
idx_raw_contacts_home_value_coderaw_contactshome_value_code
idx_campaign_crm_routing_campaign_idcampaign_crm_routingcampaign_id
idx_campaign_crm_routing_workspacecampaign_crm_routingworkspace_name
idx_campaign_crm_routing_activecampaign_crm_routingis_active
idx_scraping_jobs_csv_processing_statusscraping_jobscsv_processing_status
idx_tasks_statustasksstatus
idx_tasks_assignee_idtasksassignee_id
idx_tasks_prioritytaskspriority
idx_tasks_due_datetasksdue_date
idx_tasks_created_bytaskscreated_by
idx_tasks_created_attaskscreated_at DESC
idx_lead_replies_response_timelead_repliesworkspace_name, our_reply_sent_at
idx_auto_reply_log_workspaceauto_reply_logworkspace_name, created_at DESC
idx_auto_reply_log_rate_limitauto_reply_logworkspace_name, sent_successfully, created_at
idx_reply_templates_workspacereply_templatesworkspace_name
idx_sent_replies_workspacesent_repliesworkspace_name, created_at DESC
idx_sent_replies_bison_replysent_repliesbison_reply_id
idx_sma_policies_workspacesma_policiesworkspace_name
idx_client_metrics_workspace_dateclient_metricsworkspace_name, metric_date DESC
idx_client_metrics_uniqueclient_metricsworkspace_name, metric_date, metric_type
idx_monthly_daily_revenue_monthmonthly_daily_revenue_historymonth_year, day
idx_workspace_metrics_last_bounce_alertworkspace_metricsworkspace_name, last_bounce_alert_at
idx_monthly_daily_revenue_uniquemonthly_daily_revenue_historymonth_year, day
idx_client_leads_workspace_emailclient_leadsworkspace_name, lead_email
idx_lead_replies_workspace_email_datelead_repliesworkspace_name, lead_email, reply_date DESC
idx_wsc_typeworkspace_stats_cachecache_type
idx_wsc_workspaceworkspace_stats_cacheworkspace_name
idx_wsc_date_descworkspace_stats_cachestat_date DESC
idx_wsc_type_wsworkspace_stats_cachecache_type, workspace_name
idx_raw_contacts_monthraw_contactsmonth
idx_verified_contacts_monthverified_contactsmonth
idx_pipeline_stats_cache_monthpipeline_stats_cachemonth
idx_wds_dateworkspace_daily_statsstat_date DESC
idx_wds_ws_dateworkspace_daily_statsworkspace_name, stat_date DESC
idx_email_accounts_mx_checkedemail_accountsmx_checked_at
idx_infra_orders_workspaceinfrastructure_ordersworkspace_name
idx_infra_orders_stageinfrastructure_ordersstage
idx_infra_orders_workspace_stageinfrastructure_ordersworkspace_name, stage
idx_order_events_orderinfrastructure_order_eventsorder_id
idx_onboarding_drafts_statusonboarding_draftsstatus
idx_onboarding_drafts_created_byonboarding_draftscreated_by
idx_agent_threads_useragent_threadsuser_id
idx_agent_threads_updatedagent_threadsupdated_at DESC
idx_agent_messages_threadagent_messagesthread_id, created_at
idx_email_accounts_domainemail_accountsdomain
idx_email_accounts_ws_domainemail_accountsworkspace_name, domain
idx_task_events_status_createdtask_eventsstatus, created_at DESC
idx_task_events_createdtask_eventscreated_at
idx_hof_nominations_categoryhall_of_fame_nominationscategory
idx_hof_nominations_vote_counthall_of_fame_nominationsvote_count DESC
idx_hof_nominations_createdhall_of_fame_nominationscreated_at DESC
idx_hof_nominations_workspacehall_of_fame_nominationsworkspace_name
idx_hof_votes_nominationhall_of_fame_votesnomination_id
idx_hof_votes_userhall_of_fame_votesuser_email
idx_tasks_source_kindtasks(source->>'kind'
idx_user_profiles_is_team_memberuser_profilesis_team_member
idx_task_activity_task_id_created_attask_activitytask_id, created_at DESC
idx_task_activity_event_typetask_activityevent_type
idx_lead_replies_intentlead_repliesintent
idx_ai_gen_log_workspaceai_generation_logworkspace_name, created_at DESC
idx_prompt_eval_workspaceprompt_eval_resultsworkspace_name, created_at DESC
uq_crm_destinations_routecrm_destinationsworkspace_name, crm_type, external_api_url, COALESCE(campaign_id, -1
idx_crm_destinations_workspacecrm_destinationsworkspace_name
idx_crm_destinations_campaigncrm_destinationscampaign_id
idx_crm_delivery_log_idempotencycrm_delivery_logbison_reply_id, destination_id
idx_crm_delivery_log_parentcrm_delivery_logparent_delivery_id
idx_client_registry_v2_routingclient_registryworkspace_name
idx_raw_contacts_workspace_month_emailraw_contactsworkspace_name, month
idx_raw_contacts_workspace_master_vendorraw_contactsworkspace_name
idx_resources_categoryresourcescategory
idx_resources_typeresourcesresource_type
idx_resources_created_atresourcescreated_at DESC
idx_resource_requests_status_createdresource_requestsstatus, created_at DESC
idx_resource_requests_requesterresource_requestsrequester_user_id, created_at DESC
idx_revenue_refunds_workspace_monthrevenue_refundsworkspace_name, month
idx_revenue_refunds_monthrevenue_refundsmonth
uq_revenue_refunds_workspace_month_emailrevenue_refundsworkspace_name, month, lead_email
idx_revenue_referrals_workspace_monthrevenue_referralsworkspace_name, month
idx_revenue_referrals_monthrevenue_referralsmonth
idx_task_timeline_task_id_created_attask_timelinetask_id, created_at DESC
idx_task_timeline_kindtask_timelinekind
idx_user_profiles_slack_user_iduser_profilesslack_user_id
idx_slack_event_dedup_processed_atslack_event_dedupprocessed_at
CONCURRENTLYverified_contactsprovider
CONCURRENTLYdebounce_usageprovider
idx_email_accounts_last_webhook_atemail_accountslast_webhook_at DESC
idx_audit_verticals_enabledaudit_verticalsenabled
idx_audit_recommendation_rules_lookupaudit_recommendation_rulesloop_type, vertical_id
idx_audit_sync_state_stage_statusaudit_sync_statestage, last_status, last_audited_at
idx_audit_sync_state_workspaceaudit_sync_stateworkspace_name, vertical_id
idx_audit_rank_by_subject_loweraudit_rank_by_subjectvertical_id, interested_rate_lower_pct DESC
idx_audit_rank_by_pitch_loweraudit_rank_by_pitchvertical_id, interested_rate_lower_pct DESC
idx_audit_rank_by_parent_template_loweraudit_rank_by_parent_templatevertical_id, interested_rate_lower_pct DESC
idx_audit_rank_by_master_template_loweraudit_rank_by_master_templatevertical_id, interested_rate_lower_pct DESC
idx_audit_rank_by_step_positionaudit_rank_by_stepvertical_id, step_position
idx_audit_rank_by_sender_combo_loweraudit_rank_by_sender_combovertical_id, interested_per_send_lower_pct DESC
idx_audit_rank_by_sender_domain_loweraudit_rank_by_sender_domainvertical_id, interested_per_send_lower_pct DESC
idx_audit_rank_by_sender_local_pattern_loweraudit_rank_by_sender_local_patternvertical_id, interested_per_send_lower_pct DESC
uniq_audit_recommendations_activeaudit_recommendationsworkspace_name, loop_type, (evidence_payload->>'state_hash'
idx_audit_recommendations_workspace_statusaudit_recommendationsworkspace_name, status, generated_at DESC
idx_audit_recommendations_expiresaudit_recommendationsexpires_at
uniq_audit_deployments_rec_sourceaudit_deploymentsrecommendation_id, signal_source
idx_audit_deployments_deployed_ataudit_deploymentsdeployed_at
idx_audit_outcomes_deploymentaudit_outcomesdeployment_id, measured_at DESC
idx_audit_outcomes_verdictaudit_outcomesverdict, measured_at DESC
idx_xpressdocs_backfill_jobs_statusxpressdocs_backfill_jobsstatus
idx_xpressdocs_backfill_jobs_credential_statusxpressdocs_backfill_jobscredential_username, status
idx_xpressdocs_backfill_jobs_month_yearxpressdocs_backfill_jobsmonth_year
idx_xpressdocs_backfill_jobs_state_monthxpressdocs_backfill_jobsstate, month_year
idx_xpressdocs_backfill_jobs_scraping_job_idxpressdocs_backfill_jobsscraping_job_id
idx_xpressdocs_backfill_jobs_needs_syncxpressdocs_backfill_jobsupdated_at
idx_audit_replies_campaignaudit_repliesworkspace_name, campaign_id, received_at DESC
idx_audit_replies_scheduledaudit_repliesworkspace_name, scheduled_email_id
idx_audit_replies_interestedaudit_repliesworkspace_name, is_interested
idx_audit_origins_campaign_stepaudit_originsworkspace_name, campaign_id, sequence_step_id
idx_audit_origins_senderaudit_originsworkspace_name, sender_email_id
idx_audit_origins_subjectaudit_originsemail_subject
idx_audit_step_stats_campaign_stepaudit_step_statsworkspace_name, campaign_id, sequence_step_id
idx_audit_step_stats_subjectaudit_step_statsemail_subject
idx_lead_replies_sender_datelead_repliessender_email, reply_date DESC
idx_audit_senders_domainaudit_sendersworkspace_name, domain
idx_audit_senders_local_patternaudit_senderslocal_pattern
idx_audit_senders_activeaudit_sendersworkspace_name, status
idx_eads_email_dateemail_account_daily_statsemail_address, stat_date DESC
idx_eads_workspace_dateemail_account_daily_statsworkspace_name, stat_date DESC
idx_eads_dateemail_account_daily_statsstat_date DESC
idx_eads_anomalyemail_account_daily_statsstat_date DESC
idx_audit_origins_outcomeaudit_originsworkspace_name, outcome
idx_audit_briefings_workspace_latestaudit_briefingsworkspace_name, generated_at DESC
idx_audit_briefings_verticalaudit_briefingsvertical_id, generated_at DESC
idx_volume_tracking_dateworkspace_volume_trackingtracking_date DESC
idx_client_registry_client_type_activeclient_registryclient_type
idx_billing_subs_workspacebilling_subscriptionsworkspace_name
idx_billing_subs_signaturebilling_subscriptionsbillable_units, rate
idx_billing_subs_invoice_prefixbilling_subscriptionsinvoice_prefix
idx_billing_receipts_paid_atbilling_receiptspaid_at DESC
idx_billing_receipts_invoice_prefixbilling_receiptsinvoice_prefix
idx_billing_receipts_match_confidencebilling_receiptsmatch_confidence
idx_billing_receipts_matched_subbilling_receiptsmatched_subscription_id
idx_billing_disputes_statusbilling_disputesstatus, opened_at DESC
idx_billing_disputes_typebilling_disputesdispute_type
idx_billing_subs_variance_overbilledbilling_subscriptionsvariance_units
idx_raw_contacts_workspace_month_master_vendorraw_contactsworkspace_name, month
idx_audit_stage_runs_stage_startedaudit_stage_runsstage, started_at DESC
idx_audit_stage_runs_workspaceaudit_stage_runsworkspace_name, started_at DESC
idx_webhook_log_receivedwebhook_delivery_logingested_at
idx_ifp_auto_markinterested_format_promotionsauto_mark
idx_email_accounts_mx_checked_atemail_accountsmx_checked_at
idx_email_account_daily_stats_stat_dateemail_account_daily_statsstat_date
idx_awp_vertical_pitchaudit_workspace_pitchesvertical_id, pitch_body_fingerprint
idx_awp_ws_subjectaudit_workspace_pitchesworkspace_name, subject_norm
idx_carrier_scrub_runs_workspacecarrier_scrub_runsworkspace_name
idx_carrier_scrub_runs_statuscarrier_scrub_runsstatus
uq_carrier_scrub_runs_activecarrier_scrub_runsworkspace_name, target_month
uq_carrier_affiliations_identitycarrier_affiliationscarrier, last_name, first_name, property_zip
idx_carrier_affiliations_zipcarrier_affiliationsproperty_zip
idx_carrier_affiliations_carriercarrier_affiliationscarrier
idx_spam_block_events_pendingspam_block_eventsworkspace_name, detected_at
idx_spam_block_events_workspace_timespam_block_eventsworkspace_name, detected_at DESC
idx_spam_block_events_domain_timespam_block_eventssender_domain, detected_at DESC
idx_operating_source_accounts_system_enabledoperating_source_accountssource_system, ingest_enabled
idx_operating_source_accounts_owner_user_idoperating_source_accountsowner_user_id
idx_operating_source_events_system_occurred_atoperating_source_eventssource_system, occurred_at DESC
idx_operating_source_events_status_ingestedoperating_source_eventsprocessing_status, ingested_at
idx_operating_source_events_thread_keyoperating_source_eventsthread_key
idx_operating_threads_last_activity_atoperating_threadslast_activity_at DESC
idx_operating_threads_primary_client_workspace_nameoperating_threadsprimary_client_workspace_name
idx_operating_threads_primary_entity_idoperating_threadsprimary_entity_id
idx_operating_thread_messages_thread_occurred_atoperating_thread_messagesthread_id, occurred_at
idx_operating_thread_messages_source_event_idoperating_thread_messagessource_event_id
idx_operating_source_artifacts_artifact_kindoperating_source_artifactsartifact_kind
idx_operating_source_artifacts_source_event_idoperating_source_artifactssource_event_id
idx_operating_intake_runs_system_startedoperating_intake_runssource_system, started_at DESC
idx_operating_intake_runs_account_startedoperating_intake_runssource_account_id, started_at DESC
idx_slack_conversations_ingest_enabledslack_conversationsingest_enabled
idx_slack_conversations_client_idslack_conversationsclient_id
idx_slack_users_user_profile_idslack_usersuser_profile_id
idx_slack_events_raw_messageslack_events_rawteam_id, channel_id, message_ts
idx_slack_events_raw_status_receivedslack_events_rawprocessing_status, received_at
idx_slack_messages_threadslack_messagesteam_id, channel_id, thread_ts
idx_slack_messages_channel_updatedslack_messagesteam_id, channel_id, updated_at DESC
idx_slack_messages_is_deletedslack_messagesis_deleted
idx_operating_timeline_events_workspace_statusoperating_timeline_eventsworkspace_name, event_status
idx_operating_timeline_events_type_discoveredoperating_timeline_eventsevent_type, discovered_at DESC
idx_operating_timeline_events_client_registryoperating_timeline_eventsclient_registry_id
idx_operating_timeline_event_links_fromoperating_timeline_event_linksfrom_event_id
idx_operating_timeline_event_links_tooperating_timeline_event_linksto_event_id
idx_slack_channel_policies_team_channelslack_channel_policiesteam_id, channel_id
idx_slack_channel_policies_team_priorityslack_channel_policiesteam_id, priority ASC, created_at ASC
idx_slack_channel_coverage_events_channel_createdslack_channel_coverage_eventsteam_id, channel_id, created_at DESC
idx_slack_channel_coverage_events_type_createdslack_channel_coverage_eventsevent_type, created_at DESC
idx_operating_intake_items_slack_thread_uniqueoperating_intake_itemsteam_id, channel_id, thread_ts
idx_operating_intake_items_review_statusoperating_intake_itemsreview_status, created_at DESC
idx_brain_writeback_queue_status_createdbrain_writeback_queuewriteback_status, created_at ASC
idx_client_onboardings_stageclient_onboardingsstage
idx_client_onboardings_workspaceclient_onboardingsclient_workspace_name
idx_client_onboardings_startedclient_onboardingsstarted_at DESC
idx_infra_orders_onboardinginfrastructure_ordersclient_onboarding_id
idx_onboarding_steps_openonboarding_stepsstatus
idx_onboarding_steps_onboardingonboarding_stepsclient_onboarding_id
idx_ev_second_pass_queue_statusemail_verification_second_pass_queuequeue_status, created_at
idx_ev_second_pass_queue_workspace_monthemail_verification_second_pass_queueworkspace_name, month, queue_status
idx_ev_second_pass_queue_emailemail_verification_second_pass_queueemail
idx_operating_entities_canonical_nameoperating_entitiescanonical_name
idx_operating_entities_last_seenoperating_entitieslast_seen_at DESC
idx_operating_entity_matches_source_entityoperating_entity_matchessource_system, source_ref_key, entity_id
idx_operating_entity_matches_thread_primaryoperating_entity_matchesthread_id, is_primary
idx_operating_entity_matches_event_primaryoperating_entity_matchessource_event_id, is_primary
idx_operating_entity_matches_type_bandoperating_entity_matchesentity_type, confidence_band
idx_operating_classifications_source_ref_onceoperating_intake_classificationssource_system, source_ref_key
idx_operating_classifications_threadoperating_intake_classificationsthread_id
idx_operating_classifications_eventoperating_intake_classificationssource_event_id
idx_operating_classifications_outcome_createdoperating_intake_classificationsoutcome, created_at DESC
idx_operating_classifications_high_risk_bandoperating_intake_classificationshigh_risk, confidence_band
idx_operating_review_items_status_createdoperating_intake_review_itemsstatus, created_at DESC
idx_operating_review_items_queue_statusoperating_intake_review_itemsreview_queue, status
idx_operating_review_items_source_refoperating_intake_review_itemssource_system, source_ref_key
idx_operating_review_items_client_workspaceoperating_intake_review_itemsclient_workspace_name
idx_operating_review_items_suggested_owneroperating_intake_review_itemssuggested_owner_user_id
idx_operating_writebacks_target_statusoperating_intake_writebackstarget_system, status
idx_operating_writebacks_review_itemoperating_intake_writebacksreview_item_id
idx_operating_writebacks_create_task_onceoperating_intake_writebacksreview_item_id
idx_operating_digest_runs_type_periodoperating_digest_runsdigest_type, period_start DESC, period_end DESC
idx_operating_entity_aliases_unique_activeoperating_entity_aliases`entity_type,
normalized_alias,
alias_type`
idx_operating_entity_aliases_lookupoperating_entity_aliasesentity_type, normalized_alias, status
idx_operating_entity_aliases_entity_idoperating_entity_aliasesentity_id
idx_operating_entity_aliases_created_byoperating_entity_aliasescreated_by
idx_operating_entity_aliases_reviewed_byoperating_entity_aliasesreviewed_by
idx_operating_timeline_events_event_key_uniqueoperating_timeline_eventsevent_key
idx_operating_timeline_events_client_dateoperating_timeline_eventsclient_registry_id, occurred_at DESC
idx_operating_timeline_events_entity_dateoperating_timeline_eventsentity_id, occurred_at DESC
idx_operating_timeline_events_processoperating_timeline_eventsprocess_ref, occurred_at DESC
idx_operating_timeline_event_links_uniqueoperating_timeline_event_linksfrom_event_id, to_event_id, link_type
idx_operating_brain_patch_candidates_dedupeoperating_brain_patch_candidatestarget_note_path, target_anchor, patch_type, process_key, patch_hash
idx_operating_brain_patch_candidates_promotion_runoperating_brain_patch_candidatespromotion_run_id
idx_operating_brain_patch_candidates_reviewed_byoperating_brain_patch_candidatesreviewed_by
idx_operating_intake_items_client_idoperating_intake_itemsclient_id
idx_brain_writeback_queue_source_item_idbrain_writeback_queuesource_item_id
idx_operating_entity_aliases_entity_idoperating_entity_aliasesentity_id
idx_operating_entity_aliases_created_byoperating_entity_aliasescreated_by
idx_operating_entity_aliases_reviewed_byoperating_entity_aliasesreviewed_by
idx_operating_brain_patch_candidates_promotion_runoperating_brain_patch_candidatespromotion_run_id
idx_operating_brain_patch_candidates_reviewed_byoperating_brain_patch_candidatesreviewed_by
idx_operating_backfill_items_job_statusoperating_backfill_itemsjob_id, status, attempts ASC, source_ref_key ASC
uq_audit_findings_openaudit_findingsworkspace_name, check_key
idx_audit_findings_status_openaudit_findingslast_seen_date DESC
idx_audit_findings_workspaceaudit_findingsworkspace_name, last_seen_date DESC
idx_operating_timeline_summary_repair_backup_event_idoperating_timeline_summary_repair_backupevent_id
idx_operating_timeline_summary_repair_backup_repair_run_idoperating_timeline_summary_repair_backuprepair_run_id
idx_auto_forward_config_workspace_nameauto_forward_configworkspace_name
idx_auto_forward_log_bison_reply_numeric_idauto_forward_logbison_reply_numeric_id
idx_auto_forward_log_workspace_nameauto_forward_logworkspace_name, created_at DESC
idx_auto_forward_log_lead_emailauto_forward_loglead_email, created_at DESC
idx_auto_forward_log_lead_reply_idauto_forward_loglead_reply_id
idx_infra_orders_bison_campaign_idinfrastructure_ordersbison_campaign_id
idx_infra_orders_needs_reviewinfrastructure_ordersneeds_review
idx_wdf_runworkspace_diagnostics_findingsrun_id
idx_wdf_workspaceworkspace_diagnostics_findingsworkspace_name, created_at DESC
idx_wdf_checkworkspace_diagnostics_findingscheck_code, created_at DESC
idx_email_accounts_infra_orderemail_accountsinfrastructure_order_id
idx_email_accounts_unlinked_warmingemail_accountsworkspace_name
idx_client_announcements_statusclient_announcementsstatus
idx_client_announcements_created_atclient_announcementscreated_at DESC
uq_announcement_deliveryannouncement_deliveriesannouncement_id, workspace_name, channel, recipient
idx_announcement_deliveries_announcementannouncement_deliveriesannouncement_id
uq_announcement_readannouncement_readsannouncement_id, user_id
idx_announcement_reads_userannouncement_readsuser_id
uq_announcement_email_optoutannouncement_email_optoutsworkspace_name, email
uq_announcement_extra_recipientannouncement_extra_recipientsworkspace_name, email
idx_order_send_activity_snapshot_dateorder_send_activitysnapshot_date
idx_infra_workspace_daily_snapshot_dateinfra_workspace_dailysnapshot_date
uq_announcement_source_eventclient_announcementssource_event_key
idx_client_announcements_sourceclient_announcementssource
uq_sender_disconnect_opensender_disconnect_stateworkspace_name, email_address
idx_sds_open_first_seensender_disconnect_statefirst_disconnected_at
idx_sds_workspacesender_disconnect_stateworkspace_name
uq_account_deletion_queue_pendingaccount_deletion_queuebison_sender_email_id
idx_account_deletion_queue_status_workspaceaccount_deletion_queuestatus, workspace_name
uq_burnt_cohorts_openburnt_cohortsworkspace_name, root_domain
idx_burnt_cohorts_scan_weekburnt_cohortsscan_week DESC
idx_burnt_cohorts_statusburnt_cohortsstatus
idx_burnt_cohorts_delete_afterburnt_cohortsdelete_after
idx_infra_orders_replaces_cohortinfrastructure_ordersreplaces_cohort_id
uq_warmup_health_openwarmup_healthworkspace_name, root_domain
idx_warmup_health_status_seenwarmup_healthstatus, last_seen_at DESC
idx_warmup_health_scan_runwarmup_healthscan_run_id
idx_warmup_health_wswarmup_healthworkspace_name, status
idx_client_metrics_unmeasuredclient_metricsmetric_date, workspace_name
idx_sds_open_eligiblesender_disconnect_stateadapter, next_eligible_at
idx_email_accounts_ms365_panelemail_accountsms365_panel
idx_email_accounts_ms365_tenantemail_accountsms365_tenant_id
uq_expired_token_run_ws_emailexpired_token_snapshotrun_date, workspace_name, email_address
idx_expired_token_run_dateexpired_token_snapshotrun_date DESC
idx_expired_token_ownerexpired_token_snapshotrun_date, owner
idx_hall_of_fame_nominations_featuredhall_of_fame_nominationsvote_count DESC, created_at DESC
idx_reconnect_daily_cohort_openreconnect_daily_cohortcohort_date
idx_audit_rank_by_subject_loweraudit_rank_by_subjectvertical_id, window_key, interested_rate_lower_pct DESC
idx_audit_rank_by_pitch_loweraudit_rank_by_pitchvertical_id, window_key, interested_rate_lower_pct DESC
idx_mcp_audit_log_created_atmcp_audit_logcreated_at
idx_mcp_audit_log_user_idmcp_audit_loguser_id
idx_key_candidates_workspace_namekey_candidatesworkspace_name
idx_mcp_audit_runs_created_atmcp_audit_runscreated_at
idx_mcp_audit_findings_run_idmcp_audit_findingsrun_id
idx_mcp_audit_findings_workspace_namemcp_audit_findingsworkspace_name
idx_burnt_cohorts_bounce_waveburnt_cohortsworkspace_name, detected_at DESC
idx_job_runs_task_name_startedjob_runstask_name, started_at DESC
idx_kpi_shadow_compare_run_atkpi_shadow_comparerun_at DESC
idx_kpi_shadow_compare_wskpi_shadow_compareworkspace_name, run_at DESC
idx_workspace_window_stats_syncedworkspace_window_statswindow_days, synced_at DESC
idx_intraday_snapshots_day_wsintraday_snapshotschicago_day, workspace_name
idx_mcp_known_causes_workspacemcp_known_causesworkspace_name
idx_mcp_known_causes_activemcp_known_causesis_active
uq_client_registry_bison_ws_activeclient_registrybison_workspace_id
idx_irq_active_holdinterested_review_queueworkspace_name, lower(lead_email
idx_irq_ws_email_blockinginterested_review_queueworkspace_name, lower(lead_email
idx_irq_status_createdinterested_review_queuestatus, created_at
bison_tokens_team_id_idxbison_tokensteam_id
idx_mcp_users_user_profile_idmcp_usersuser_profile_id
idx_task_proposals_batch_idtask_proposalsbatch_id
idx_task_proposal_batches_reviewer_statustask_proposal_batchesreviewer_id, status, created_at DESC
idx_task_proposal_batches_created_bytask_proposal_batchescreated_by, created_at DESC
idx_task_bot_events_tstask_bot_eventsts DESC
idx_task_bot_events_profile_tstask_bot_eventsprofile_id, ts DESC
email_accounts_instance_sender_keyemail_accountsbison_instance, bison_sender_email_id
idx_email_accounts_presentemail_accountsbison_instance, workspace_name
account_sync_waves_wave_instance_ws_keyaccount_sync_waveswave_id, bison_instance, workspace_name
idx_account_sync_waves_ws_completeaccount_sync_wavesworkspace_name, bison_instance, completed_at DESC
idx_account_sync_waves_waveaccount_sync_waveswave_id
idx_nurture_candidates_status_creatednurture_candidatesstatus, created_at
idx_nurture_candidates_ws_emailnurture_candidatesworkspace_name, lower(lead_email
idx_nurture_candidates_batchnurture_candidatesbatch_id
idx_nurture_candidates_queuenurture_candidatesstatus, priority, reply_date DESC
kpi_client_settings_audit_workspace_changed_idxkpi_client_settings_auditworkspace_name, changed_at DESC
nurture_lab_runs_created_idxnurture_lab_runscreated_at DESC
idx_domain_daily_stats_datedomain_daily_statsstat_date
idx_domain_daily_stats_root_datedomain_daily_statsroot_domain, stat_date
idx_domain_stats_runs_ws_starteddomain_stats_runsworkspace_name, started_at DESC
infra_targets_audit_key_changed_idxinfra_targets_auditscope, key, changed_at DESC
registrar_domains_expiration_idxregistrar_domainsexpiration_date
registrar_domains_account_idxregistrar_domainsaccount_id
infra_vendor_orders_order_idxinfra_vendor_ordersinfrastructure_order_id
infra_vendor_orders_live_root_uqinfra_vendor_ordersinfrastructure_order_id, vendor, root
infra_vendor_orders_vendor_id_uqinfra_vendor_ordersvendor, vendor_order_id
infra_vendor_tickets_order_idxinfra_vendor_ticketsinfrastructure_order_id
infra_vendor_tickets_open_idxinfra_vendor_ticketsstatus
infra_sender_moves_order_idxinfra_sender_movesinfrastructure_order_id
infra_sender_moves_batch_idxinfra_sender_movesbatch_id
infra_pipeline_steps_onboarding_idxinfra_pipeline_stepsclient_onboarding_id, created_at
infra_pipeline_steps_order_idxinfra_pipeline_stepsinfrastructure_order_id, created_at
infra_pipeline_steps_open_idxinfra_pipeline_stepsstatus, updated_at
infra_pipeline_steps_updated_idxinfra_pipeline_stepsupdated_at DESC
domain_purchase_plans_onboarding_idxdomain_purchase_plansclient_onboarding_id
domain_purchase_plans_status_idxdomain_purchase_plansstatus
domain_purchase_items_plan_status_idxdomain_purchase_itemsplan_id, status
domain_purchase_items_purchased_at_idxdomain_purchase_itemspurchased_at
domain_dns_intents_onboarding_idxdomain_dns_intentsclient_onboarding_id
domain_dns_intents_drift_state_idxdomain_dns_intentsdrift_state
ms365_provisioning_runs_open_order_uqms365_provisioning_runsorder_id
ms365_provisioning_runs_status_idxms365_provisioning_runsstatus
ms365_provisioning_runs_panel_idxms365_provisioning_runspanel_number
ms365_provisioning_run_logs_run_idxms365_provisioning_run_logsrun_id, logged_at
ms365_provisioning_run_logs_step_idxms365_provisioning_run_logsstep, logged_at
ms365_seat_reservations_active_idxms365_seat_reservationspanel_number
ms365_recon_findings_open_uqms365_recon_findingskind, COALESCE(panel_number, 0
idx_ms365_domain_tenants_tenantms365_domain_tenantstenant_id
idx_ms365_domain_tenants_resolved_atms365_domain_tenantsresolved_at
idx_ms365_panel_tag_runs_startedms365_panel_tag_runsstarted_at DESC
domain_root_assignments_order_idxdomain_root_assignmentsinfrastructure_order_id
infra_ws2_canary_one_enabledinfra_ws2_canary_policiesenabled
infra_ws2_canary_scope_order_idxinfra_ws2_canary_scopesinfrastructure_order_id
infra_ws2_canary_identity_uqinfra_ws2_canary_reservationsaction, (CASE WHEN action = 'placement' THEN '*' ELSE bison_instance END
infra_ws2_canary_budget_idxinfra_ws2_canary_reservationspolicy_id, reserved_at
infra_ws2_canary_receipt_idxinfra_ws2_canary_reservationsreservation_id
infra_ws2_staging_recovery_idxinfra_ws2_canary_reservationsrecovery_checked_at NULLS FIRST, id
infra_ws2_canary_reservation_scope_idxinfra_ws2_canary_reservationsscope_id
infra_pipeline_observations_flag_time_idxinfra_pipeline_step_observationsflag_key, observed_at DESC, id DESC
infra_pipeline_observations_time_idxinfra_pipeline_step_observationsobserved_at DESC, id DESC
infra_pipeline_observations_scope_step_idxinfra_pipeline_step_observationsscope_key, step_key, id DESC
infra_pipeline_observations_step_id_idxinfra_pipeline_step_observationsstep_key, id DESC
idx_order_events_to_stage_createdinfrastructure_order_eventsto_stage, created_at
idx_bounce_digest_events_pendingbounce_digest_eventsprocessed_at, event_key
idx_warmup_gate_snapshots_datewarmup_gate_snapshotssnapshot_date
idx_mailbox_limit_ledger_panel_atmailbox_limit_ledgerms365_panel, at DESC
idx_mailbox_limit_ledger_sender_atmailbox_limit_ledgerbison_sender_email_id, at DESC
idx_mailbox_limit_ledger_reason_atmailbox_limit_ledgerreason, at DESC
idx_panel_budget_snapshots_panel_runpanel_budget_snapshotspanel_number, run_at DESC
task_evidence_run_date_idxtask_evidencerun_date
task_evidence_task_idxtask_evidencetask_id
vault_outbox_status_idxvault_outboxstatus, created_at
meeting_schedule_day_idxmeeting_schedulestarts_at
work_ownership_rules_enabled_ordinal_idxwork_ownership_rulesenabled, ordinal
work_ownership_rules_owner_idxwork_ownership_rulesowner_profile_id
work_rule_overrides_rule_created_idxwork_rule_overridesrule_key, created_at DESC
work_rule_overrides_task_idxwork_rule_overridestask_id
work_entity_disagreements_open_uniquework_entity_disagreementsentity_type, canonical_name, field
work_entity_disagreements_status_idxwork_entity_disagreementsstatus, created_at DESC
tasks_fingerprint_live_uqtasksfingerprint
tasks_kind_status_idxtaskskind, status
work_findings_log_run_date_idxwork_findings_logrun_date
work_findings_log_fingerprint_idxwork_findings_logfingerprint
llm_traces_call_kind_created_at_idxllm_tracescall_kind, created_at
llm_traces_decision_idxllm_tracesdecision
brain_notes_doc_type_idxbrain_notesdoc_type
brain_notes_client_key_idxbrain_notesclient_key
brain_chunks_note_ordinalbrain_chunksnote_path, ordinal
brain_links_to_path_idxbrain_linksto_path
work_handoffs_created_idxwork_handoffscreated_at DESC
work_handoffs_owner_idxwork_handoffsowner_id, created_at DESC
lead_loss_checks_status_idxlead_loss_checksstatus, score DESC
lead_loss_checks_seen_idxlead_loss_checksfirst_seen_at DESC
exec_briefs_day_idxexec_briefsday DESC
exec_brief_feedback_created_idxexec_brief_feedbackcreated_at DESC
client_onboardings_pilot_idempotency_key_idxclient_onboardings(form_payload->>'pilot_idempotency_key'
domain_purchase_operator_expansion_bindings_expansion_idxdomain_purchase_operator_expansion_bindingsexpansion_id
domain_purchase_operator_attempts_expansion_idxdomain_purchase_operator_attemptsexpansion_id
infrastructure_orders_child_unit_root_uniqinfrastructure_ordersparent_order_id, child_root
infrastructure_orders_parent_order_idxinfrastructure_ordersparent_order_id
domain_owned_root_adoptions_active_rootdomain_owned_root_adoptionsroot
domain_owned_root_adoptions_active_orderdomain_owned_root_adoptionsinfrastructure_order_id
idx_bison_change_log_day_wsbison_change_logday, workspace_name
idx_bison_change_log_observedbison_change_logobserved_at DESC
idx_bison_change_log_entitybison_change_logworkspace_name, entity_type, entity_id
panel_plan_reviews_run_idxpanel_plan_reviewsrun_id
idx_lead_owners_proposedlead_ownersaccept_deadline
idx_lead_claim_events_leadlead_claim_eventsworkspace_name, lead_email, created_at DESC
campaign_rosters_sender_idxcampaign_rostersbison_sender_email_id
campaign_rosters_ws_idxcampaign_rostersworkspace_name, campaign_status
infra_decisions_run_idxinfra_decisionsrun_id
infra_decisions_box_idxinfra_decisionsbison_sender_email_id, kind, at DESC
infra_decisions_status_idxinfra_decisionsstatus, policy, at DESC
infra_decisions_external_idxinfra_decisionsbison_sender_email_id, kind, expires_at
email_account_limit_changes_open_idxemail_account_limit_changesid
operator_feedback_open_idxoperator_feedbackat DESC
campaign_rosters_page_idxcampaign_rostersbison_sender_email_id, campaign_id, workspace_name
burnt_verdicts_root_idxburnt_verdictsworkspace_name, root_domain, asof DESC
burnt_roots_stage_idxburnt_rootsstage, workspace_name
idx_lead_claim_clickup_backlog_nextlead_claim_clickup_backlogworkspace_name, priority DESC
idx_ops_alerts_dedupe_openops_alertsdedupe_key
idx_ops_alerts_seqops_alertsseq
idx_ops_alerts_severity_unackedops_alertsseverity, acknowledged_at
idx_ops_alerts_first_seenops_alertsfirst_seen DESC
idx_ops_alert_routes_enabled_sourceops_alert_routesenabled, source
fairplan_replies_status_idxfairplan_repliesstatus, created_at desc
operator_box_snapshots_ws_idxoperator_box_snapshotsworkspace_name, snapshot_date
operator_box_origins_ws_idxoperator_box_originsworkspace_name, origin_workspace
operator_fleet_ledger_ws_idxoperator_fleet_ledgerworkspace_name, ledger_date
infrastructure_orders_backup_origin_idxinfrastructure_ordersorigin_workspace
registrar_domain_observations_discovery_idxregistrar_domain_observationsroot, account_id
registrar_domain_observations_history_idxregistrar_domain_observationsaccount_id, root, id DESC
domain_lifecycle_alert_pending_idxdomain_lifecycle_alert_deliverieschannel_id, id
domain_lifecycle_alert_event_delivery_idxdomain_lifecycle_alert_eventsdelivery_id
idx_registrar_accounts_covered_byregistrar_accountscovered_by_account_id

Entity Relationships (Core Pipeline)

erDiagram
    client_registry ||--o{ user_workspace_access : has_users
    client_registry ||--o{ scraping_jobs : runs
    client_registry ||--o{ raw_contacts : owns
    scraping_jobs ||--o{ raw_contacts : produces
    raw_contacts ||--o{ filtered_contacts : filters_to
    filtered_contacts ||--o{ verified_contacts : verifies_to
    verified_contacts }o--|| contact_batches : batched_into
    client_registry ||--o{ bison_account_sync : syncs_with
    client_registry ||--o{ client_leads : tracks
    client_registry ||--o{ client_targets : configures

On this page

MigrationsTablesuser_workspace_accessclient_registryclient_settingsclient_pricingclient_costsmonthly_revenue_snapshotsclient_zipcodesraw_contactsverified_contactsweekly_batchesupload_audit_logdebounce_usagescraping_jobsscraping_job_logsagent_runsagent_errorssite_credentialsclient_leadsemail_accountsemail_account_metadataemail_account_pollinguser_profilesclient_filter_rulescredential_audit_logscraping_job_batchescampaign_metricsdebounce_bulk_jobsfiltering_tasksverification_taskspipeline_runsclient_targetscrm_delivery_logslack_notifications_sentlead_replieswebhook_delivery_logwebhook_healthhome_value_codescampaign_crm_routingtasksauto_reply_configauto_reply_logreply_templatessent_repliessma_policiesclient_metricsmonthly_daily_revenue_historyworkspace_stats_cachepipeline_stats_cacheworkspace_daily_statsreseller_configsinfrastructure_ordersinfrastructure_order_eventsonboarding_draftsagent_threadsagent_messagestask_eventshall_of_fame_nominationshall_of_fame_votestask_activityai_generation_logprompt_eval_resultscrm_destinationsresourcesresource_requestsrevenue_refundsrevenue_referralstask_timelineslack_event_dedupaudit_verticalsaudit_recommendation_rulesaudit_sync_stateaudit_rank_by_subjectaudit_rank_by_pitchaudit_rank_by_parent_templateaudit_rank_by_master_templateaudit_rank_by_stepaudit_rank_by_sender_comboaudit_rank_by_sender_domainaudit_rank_by_sender_local_patternaudit_recommendationsaudit_deploymentsaudit_outcomesxpressdocs_backfill_jobsaudit_repliesaudit_originsaudit_step_statsaudit_sendersemail_account_daily_statsaudit_briefingsworkspace_volume_trackingbilling_subscriptionsbilling_receiptsbilling_disputesaudit_stage_runsinterested_format_promotionsaudit_workspace_pitchesaudit_audience_statscarrier_scrub_runscarrier_affiliationsspam_block_eventsoperating_source_accountsoperating_source_eventsoperating_threadsoperating_thread_messagesoperating_source_artifactsoperating_intake_runsslack_conversationsslack_usersslack_events_rawslack_messagesslack_ingest_runsoperating_timeline_eventsoperating_timeline_event_linksoperating_timeline_export_runsslack_channel_policiesslack_channel_coverage_eventsoperating_intake_itemsbrain_writeback_queueclient_onboardingsonboarding_stepsemail_verification_second_pass_queueoperating_entitiesoperating_entity_matchesoperating_intake_classificationsoperating_intake_review_itemsoperating_intake_writebacksoperating_digest_runsoperating_entity_aliasesoperating_process_taxonomyoperating_promotion_runsoperating_brain_patch_candidatesoperating_backfill_jobsoperating_backfill_itemsstat_pollution_backup_2026_07audit_rulesaudit_findingsoperating_timeline_summary_repair_backupauto_forward_configauto_forward_loginfra_reconciliation_runsdiagnostics_runsworkspace_diagnostics_findingsbison_campaign_snapshotsclient_announcementsannouncement_deliveriesannouncement_readsannouncement_email_optoutsannouncement_extra_recipientsorder_send_activityinfra_workspace_dailyannouncement_event_policiessender_disconnect_stateannouncement_pipeline_enrollmentaccount_deletion_queueburnt_cohortswarmup_healthreconnect_domain_exclusionsms365_panelsexpired_token_snapshotreconnect_daily_cohortmcp_usersmcp_audit_logkey_candidatesmcp_audit_runsmcp_audit_findingsjob_runskpi_shadow_compareworkspace_window_statsintraday_snapshotsaudit_reply_timing_statsmcp_known_causesschema_migrationsinterested_review_queuetask_proposal_batchestask_proposalstask_bot_eventsaccount_sync_wavesnurture_candidatestask_person_labelskpi_client_settings_auditnurture_lab_runsdomain_daily_statsdomain_stats_runsinfra_sizing_standardsclient_infra_targetsinfra_targets_auditregistrar_accountsregistrar_domainsregistrar_secret_revealsregistrar_burn_seedsinfra_vendor_ordersinfra_vendor_ticketsinfra_sender_movesinfra_credstore_pullsinfra_pipeline_stepsdomain_purchase_plansdomain_purchase_itemsdomain_dns_intentsms365_provisioning_runsms365_provisioning_run_logsms365_seat_reservationsms365_recon_findingsms365_domain_tenantsms365_panel_tag_runsdomain_root_assignmentsinfra_ws2_canary_policiesinfra_ws2_canary_scopesinfra_ws2_canary_reservationsinfra_pipeline_step_observationsbounce_digest_eventswarmup_gate_snapshotsmailbox_limit_ledgerpanel_budget_snapshotstask_evidenceclient_call_notesvault_outboxmeeting_schedulework_ownership_ruleswork_ruleswork_rule_overrideswork_entity_disagreementswork_findings_configwork_findings_logllm_tracesbrain_notesbrain_chunksbrain_linksbrain_index_statework_handoffslead_loss_checksexec_briefsexec_brief_stateexec_brief_feedbackdomain_purchase_operator_attemptsinfra_mailin_destination_bindingsdomain_purchase_operator_expansionsdomain_purchase_operator_expansion_bindingsinfra_ws2_canary_revocationsms365_pilot_delivery_receiptsdomain_owned_root_adoptionsbison_change_logruntime_policiespanel_plan_reviewslead_claim_configlead_ownerslead_claim_eventscampaign_rostersinfra_decisionsinfra_runsemail_account_limit_changesoperator_box_stats_cacheoperator_feedbackburnt_verdictsburnt_rootscampaign_roster_refresheslead_claim_clickup_taskslead_claim_clickup_postslead_claim_clickup_backloglead_claim_clickup_stateops_alertsops_alert_prefsdesktop_app_policyops_alert_routesfairplan_repliesoperator_box_snapshotsoperator_box_originsoperator_fleet_ledgerregistrar_domain_observationsdomain_lifecycle_alert_deliveriesdomain_lifecycle_alert_eventsIndexesEntity Relationships (Core Pipeline)