{
  "id": "30e8c5da-5037-4134-ac88-6072424064fd",
  "prevId": "49f14a86-25bb-4d42-9edd-e69115c7a650",
  "version": "7",
  "dialect": "postgresql",
  "tables": {
    "public.agent_events": {
      "name": "agent_events",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "bigserial",
          "primaryKey": true,
          "notNull": true
        },
        "investigation_id": {
          "name": "investigation_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "seq": {
          "name": "seq",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "payload": {
          "name": "payload",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "agent_events_seq_idx": {
          "name": "agent_events_seq_idx",
          "columns": [
            {
              "expression": "investigation_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "seq",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "agent_events_investigation_id_investigations_id_fk": {
          "name": "agent_events_investigation_id_investigations_id_fk",
          "tableFrom": "agent_events",
          "tableTo": "investigations",
          "columnsFrom": [
            "investigation_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.claims": {
      "name": "claims",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "investigation_id": {
          "name": "investigation_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "text": {
          "name": "text",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'open'"
        },
        "confidence": {
          "name": "confidence",
          "type": "real",
          "primaryKey": false,
          "notNull": true,
          "default": 0.5
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "claims_investigation_idx": {
          "name": "claims_investigation_idx",
          "columns": [
            {
              "expression": "investigation_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "claims_investigation_id_investigations_id_fk": {
          "name": "claims_investigation_id_investigations_id_fk",
          "tableFrom": "claims",
          "tableTo": "investigations",
          "columnsFrom": [
            "investigation_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.competitors": {
      "name": "competitors",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "url": {
          "name": "url",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "competitors_name_idx": {
          "name": "competitors_name_idx",
          "columns": [
            {
              "expression": "name",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.evidence": {
      "name": "evidence",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "investigation_id": {
          "name": "investigation_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "source_id": {
          "name": "source_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "claim_id": {
          "name": "claim_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "kind": {
          "name": "kind",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "quote": {
          "name": "quote",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "summary": {
          "name": "summary",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "strength": {
          "name": "strength",
          "type": "real",
          "primaryKey": false,
          "notNull": true,
          "default": 0.5
        },
        "fingerprint": {
          "name": "fingerprint",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "evidence_investigation_idx": {
          "name": "evidence_investigation_idx",
          "columns": [
            {
              "expression": "investigation_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "evidence_fingerprint_idx": {
          "name": "evidence_fingerprint_idx",
          "columns": [
            {
              "expression": "investigation_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "fingerprint",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "evidence_investigation_id_investigations_id_fk": {
          "name": "evidence_investigation_id_investigations_id_fk",
          "tableFrom": "evidence",
          "tableTo": "investigations",
          "columnsFrom": [
            "investigation_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "evidence_source_id_sources_id_fk": {
          "name": "evidence_source_id_sources_id_fk",
          "tableFrom": "evidence",
          "tableTo": "sources",
          "columnsFrom": [
            "source_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        },
        "evidence_claim_id_claims_id_fk": {
          "name": "evidence_claim_id_claims_id_fk",
          "tableFrom": "evidence",
          "tableTo": "claims",
          "columnsFrom": [
            "claim_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.hypotheses": {
      "name": "hypotheses",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "investigation_id": {
          "name": "investigation_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "parent_hypothesis_id": {
          "name": "parent_hypothesis_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "statement": {
          "name": "statement",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'proposed'"
        },
        "confidence": {
          "name": "confidence",
          "type": "real",
          "primaryKey": false,
          "notNull": true,
          "default": 0.5
        },
        "rationale": {
          "name": "rationale",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "adversarial_checked": {
          "name": "adversarial_checked",
          "type": "boolean",
          "primaryKey": false,
          "notNull": true,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "hypotheses_investigation_idx": {
          "name": "hypotheses_investigation_idx",
          "columns": [
            {
              "expression": "investigation_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "hypotheses_investigation_id_investigations_id_fk": {
          "name": "hypotheses_investigation_id_investigations_id_fk",
          "tableFrom": "hypotheses",
          "tableTo": "investigations",
          "columnsFrom": [
            "investigation_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.hypothesis_evidence": {
      "name": "hypothesis_evidence",
      "schema": "",
      "columns": {
        "hypothesis_id": {
          "name": "hypothesis_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "evidence_id": {
          "name": "evidence_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "relation": {
          "name": "relation",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "weight": {
          "name": "weight",
          "type": "real",
          "primaryKey": false,
          "notNull": true,
          "default": 0.5
        }
      },
      "indexes": {},
      "foreignKeys": {
        "hypothesis_evidence_hypothesis_id_hypotheses_id_fk": {
          "name": "hypothesis_evidence_hypothesis_id_hypotheses_id_fk",
          "tableFrom": "hypothesis_evidence",
          "tableTo": "hypotheses",
          "columnsFrom": [
            "hypothesis_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "hypothesis_evidence_evidence_id_evidence_id_fk": {
          "name": "hypothesis_evidence_evidence_id_evidence_id_fk",
          "tableFrom": "hypothesis_evidence",
          "tableTo": "evidence",
          "columnsFrom": [
            "evidence_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "hypothesis_evidence_hypothesis_id_evidence_id_pk": {
          "name": "hypothesis_evidence_hypothesis_id_evidence_id_pk",
          "columns": [
            "hypothesis_id",
            "evidence_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.investigation_steps": {
      "name": "investigation_steps",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "investigation_id": {
          "name": "investigation_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "step_number": {
          "name": "step_number",
          "type": "integer",
          "primaryKey": false,
          "notNull": true
        },
        "model": {
          "name": "model",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "input_tokens": {
          "name": "input_tokens",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "output_tokens": {
          "name": "output_tokens",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "cost_usd": {
          "name": "cost_usd",
          "type": "real",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "latency_ms": {
          "name": "latency_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "tool_name": {
          "name": "tool_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "tool_args": {
          "name": "tool_args",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": false
        },
        "tool_result_summary": {
          "name": "tool_result_summary",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "decision_summary": {
          "name": "decision_summary",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "error": {
          "name": "error",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "steps_investigation_idx": {
          "name": "steps_investigation_idx",
          "columns": [
            {
              "expression": "investigation_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "step_number",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "investigation_steps_investigation_id_investigations_id_fk": {
          "name": "investigation_steps_investigation_id_investigations_id_fk",
          "tableFrom": "investigation_steps",
          "tableTo": "investigations",
          "columnsFrom": [
            "investigation_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.investigations": {
      "name": "investigations",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "objective": {
          "name": "objective",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'pending'"
        },
        "phase": {
          "name": "phase",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'scouting'"
        },
        "stop_reason": {
          "name": "stop_reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "conclusion": {
          "name": "conclusion",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "outcome": {
          "name": "outcome",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "budget": {
          "name": "budget",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "budget_used": {
          "name": "budget_used",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "prompt_version": {
          "name": "prompt_version",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "tool_schema_version": {
          "name": "tool_schema_version",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "model": {
          "name": "model",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "error": {
          "name": "error",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "started_at": {
          "name": "started_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        },
        "completed_at": {
          "name": "completed_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {
        "investigations_status_idx": {
          "name": "investigations_status_idx",
          "columns": [
            {
              "expression": "status",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "investigations_created_idx": {
          "name": "investigations_created_idx",
          "columns": [
            {
              "expression": "created_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "investigations_user_id_users_id_fk": {
          "name": "investigations_user_id_users_id_fk",
          "tableFrom": "investigations",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.opportunities": {
      "name": "opportunities",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "investigation_id": {
          "name": "investigation_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "hypothesis_id": {
          "name": "hypothesis_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "summary": {
          "name": "summary",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "problem": {
          "name": "problem",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "why_now": {
          "name": "why_now",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "risks": {
          "name": "risks",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "skeptic_case": {
          "name": "skeptic_case",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "report_md": {
          "name": "report_md",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'candidate'"
        },
        "worth_score": {
          "name": "worth_score",
          "type": "real",
          "primaryKey": false,
          "notNull": false
        },
        "evidence_confidence": {
          "name": "evidence_confidence",
          "type": "real",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "opportunities_investigation_idx": {
          "name": "opportunities_investigation_idx",
          "columns": [
            {
              "expression": "investigation_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "opportunities_score_idx": {
          "name": "opportunities_score_idx",
          "columns": [
            {
              "expression": "worth_score",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "opportunities_investigation_id_investigations_id_fk": {
          "name": "opportunities_investigation_id_investigations_id_fk",
          "tableFrom": "opportunities",
          "tableTo": "investigations",
          "columnsFrom": [
            "investigation_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "opportunities_hypothesis_id_hypotheses_id_fk": {
          "name": "opportunities_hypothesis_id_hypotheses_id_fk",
          "tableFrom": "opportunities",
          "tableTo": "hypotheses",
          "columnsFrom": [
            "hypothesis_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.opportunity_competitors": {
      "name": "opportunity_competitors",
      "schema": "",
      "columns": {
        "opportunity_id": {
          "name": "opportunity_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "competitor_id": {
          "name": "competitor_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "note": {
          "name": "note",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "opportunity_competitors_opportunity_id_opportunities_id_fk": {
          "name": "opportunity_competitors_opportunity_id_opportunities_id_fk",
          "tableFrom": "opportunity_competitors",
          "tableTo": "opportunities",
          "columnsFrom": [
            "opportunity_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "opportunity_competitors_competitor_id_competitors_id_fk": {
          "name": "opportunity_competitors_competitor_id_competitors_id_fk",
          "tableFrom": "opportunity_competitors",
          "tableTo": "competitors",
          "columnsFrom": [
            "competitor_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "opportunity_competitors_opportunity_id_competitor_id_pk": {
          "name": "opportunity_competitors_opportunity_id_competitor_id_pk",
          "columns": [
            "opportunity_id",
            "competitor_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.opportunity_evidence": {
      "name": "opportunity_evidence",
      "schema": "",
      "columns": {
        "opportunity_id": {
          "name": "opportunity_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "evidence_id": {
          "name": "evidence_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'context'"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "opportunity_evidence_opportunity_id_opportunities_id_fk": {
          "name": "opportunity_evidence_opportunity_id_opportunities_id_fk",
          "tableFrom": "opportunity_evidence",
          "tableTo": "opportunities",
          "columnsFrom": [
            "opportunity_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "opportunity_evidence_evidence_id_evidence_id_fk": {
          "name": "opportunity_evidence_evidence_id_evidence_id_fk",
          "tableFrom": "opportunity_evidence",
          "tableTo": "evidence",
          "columnsFrom": [
            "evidence_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "opportunity_evidence_opportunity_id_evidence_id_pk": {
          "name": "opportunity_evidence_opportunity_id_evidence_id_pk",
          "columns": [
            "opportunity_id",
            "evidence_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.opportunity_scores": {
      "name": "opportunity_scores",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "opportunity_id": {
          "name": "opportunity_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "dimension": {
          "name": "dimension",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "score": {
          "name": "score",
          "type": "real",
          "primaryKey": false,
          "notNull": true
        },
        "confidence": {
          "name": "confidence",
          "type": "real",
          "primaryKey": false,
          "notNull": true
        },
        "reasoning": {
          "name": "reasoning",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "evidence_ids": {
          "name": "evidence_ids",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "opportunity_scores_dim_idx": {
          "name": "opportunity_scores_dim_idx",
          "columns": [
            {
              "expression": "opportunity_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "dimension",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "opportunity_scores_opportunity_id_opportunities_id_fk": {
          "name": "opportunity_scores_opportunity_id_opportunities_id_fk",
          "tableFrom": "opportunity_scores",
          "tableTo": "opportunities",
          "columnsFrom": [
            "opportunity_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.saved_opportunities": {
      "name": "saved_opportunities",
      "schema": "",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "opportunity_id": {
          "name": "opportunity_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "saved_opportunities_user_id_users_id_fk": {
          "name": "saved_opportunities_user_id_users_id_fk",
          "tableFrom": "saved_opportunities",
          "tableTo": "users",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "saved_opportunities_opportunity_id_opportunities_id_fk": {
          "name": "saved_opportunities_opportunity_id_opportunities_id_fk",
          "tableFrom": "saved_opportunities",
          "tableTo": "opportunities",
          "columnsFrom": [
            "opportunity_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "saved_opportunities_user_id_opportunity_id_pk": {
          "name": "saved_opportunities_user_id_opportunity_id_pk",
          "columns": [
            "user_id",
            "opportunity_id"
          ]
        }
      },
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.searches": {
      "name": "searches",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "investigation_id": {
          "name": "investigation_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "query": {
          "name": "query",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "intent": {
          "name": "intent",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "provider": {
          "name": "provider",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "default": "'firecrawl'"
        },
        "result_count": {
          "name": "result_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "results": {
          "name": "results",
          "type": "jsonb",
          "primaryKey": false,
          "notNull": true
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "searches_investigation_idx": {
          "name": "searches_investigation_idx",
          "columns": [
            {
              "expression": "investigation_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "searches_investigation_id_investigations_id_fk": {
          "name": "searches_investigation_id_investigations_id_fk",
          "tableFrom": "searches",
          "tableTo": "investigations",
          "columnsFrom": [
            "investigation_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.source_contents": {
      "name": "source_contents",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "source_id": {
          "name": "source_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": true
        },
        "content_hash": {
          "name": "content_hash",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "markdown": {
          "name": "markdown",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "http_status": {
          "name": "http_status",
          "type": "integer",
          "primaryKey": false,
          "notNull": false
        },
        "word_count": {
          "name": "word_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "default": 0
        },
        "retrieved_at": {
          "name": "retrieved_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "source_contents_source_idx": {
          "name": "source_contents_source_idx",
          "columns": [
            {
              "expression": "source_id",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            },
            {
              "expression": "retrieved_at",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "source_contents_hash_idx": {
          "name": "source_contents_hash_idx",
          "columns": [
            {
              "expression": "content_hash",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "source_contents_source_id_sources_id_fk": {
          "name": "source_contents_source_id_sources_id_fk",
          "tableFrom": "source_contents",
          "tableTo": "sources",
          "columnsFrom": [
            "source_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.sources": {
      "name": "sources",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "url": {
          "name": "url",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "canonical_url": {
          "name": "canonical_url",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "domain": {
          "name": "domain",
          "type": "text",
          "primaryKey": false,
          "notNull": true
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "first_seen_investigation_id": {
          "name": "first_seen_investigation_id",
          "type": "uuid",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {
        "sources_canonical_idx": {
          "name": "sources_canonical_idx",
          "columns": [
            {
              "expression": "canonical_url",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": true,
          "concurrently": false,
          "method": "btree",
          "with": {}
        },
        "sources_domain_idx": {
          "name": "sources_domain_idx",
          "columns": [
            {
              "expression": "domain",
              "isExpression": false,
              "asc": true,
              "nulls": "last"
            }
          ],
          "isUnique": false,
          "concurrently": false,
          "method": "btree",
          "with": {}
        }
      },
      "foreignKeys": {
        "sources_first_seen_investigation_id_investigations_id_fk": {
          "name": "sources_first_seen_investigation_id_investigations_id_fk",
          "tableFrom": "sources",
          "tableTo": "investigations",
          "columnsFrom": [
            "first_seen_investigation_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "no action",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    },
    "public.users": {
      "name": "users",
      "schema": "",
      "columns": {
        "id": {
          "name": "id",
          "type": "uuid",
          "primaryKey": true,
          "notNull": true,
          "default": "gen_random_uuid()"
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": false
        },
        "created_at": {
          "name": "created_at",
          "type": "timestamp with time zone",
          "primaryKey": false,
          "notNull": true,
          "default": "now()"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {
        "users_email_unique": {
          "name": "users_email_unique",
          "nullsNotDistinct": false,
          "columns": [
            "email"
          ]
        }
      },
      "policies": {},
      "checkConstraints": {},
      "isRLSEnabled": false
    }
  },
  "enums": {},
  "schemas": {},
  "sequences": {},
  "roles": {},
  "policies": {},
  "views": {},
  "_meta": {
    "columns": {},
    "schemas": {},
    "tables": {}
  }
}