Skip to content

Open source alternative to Semrush and Ahrefs

127 KB
Raw Blame
{
  "version": "6",
  "dialect": "sqlite",
  "id": "4b201370-fcf1-4b2c-b608-42301f5bc5f7",
  "prevId": "1045185e-80d7-47f5-9957-9a6b2f8fc306",
  "tables": {
    "backlink_snapshots": {
      "name": "backlink_snapshots",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "domain": {
          "name": "domain",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "rank": {
          "name": "rank",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "backlinks": {
          "name": "backlinks",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "referring_domains": {
          "name": "referring_domains",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "broken_backlinks": {
          "name": "broken_backlinks",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "new_backlinks": {
          "name": "new_backlinks",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "lost_backlinks": {
          "name": "lost_backlinks",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "new_referring_domains": {
          "name": "new_referring_domains",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "lost_referring_domains": {
          "name": "lost_referring_domains",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "captured_at": {
          "name": "captured_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {
        "backlink_snapshots_project_captured_idx": {
          "name": "backlink_snapshots_project_captured_idx",
          "columns": [
            "project_id",
            "captured_at"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "backlink_snapshots_project_id_projects_id_fk": {
          "name": "backlink_snapshots_project_id_projects_id_fk",
          "tableFrom": "backlink_snapshots",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "crawler_credentials": {
      "name": "crawler_credentials",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "host": {
          "name": "host",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "provider": {
          "name": "provider",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "signature_input": {
          "name": "signature_input",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "signature": {
          "name": "signature",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "expires_at": {
          "name": "expires_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_by_user_id": {
          "name": "created_by_user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {
        "crawler_credentials_project_host_idx": {
          "name": "crawler_credentials_project_host_idx",
          "columns": [
            "project_id",
            "host"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "crawler_credentials_project_id_projects_id_fk": {
          "name": "crawler_credentials_project_id_projects_id_fk",
          "tableFrom": "crawler_credentials",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "dashboard_step_dismissals": {
      "name": "dashboard_step_dismissals",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "step": {
          "name": "step",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "dashboard_step_dismissals_project_idx": {
          "name": "dashboard_step_dismissals_project_idx",
          "columns": [
            "project_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "dashboard_step_dismissals_user_id_user_id_fk": {
          "name": "dashboard_step_dismissals_user_id_user_id_fk",
          "tableFrom": "dashboard_step_dismissals",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "dashboard_step_dismissals_project_id_projects_id_fk": {
          "name": "dashboard_step_dismissals_project_id_projects_id_fk",
          "tableFrom": "dashboard_step_dismissals",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "dashboard_step_dismissals_user_id_project_id_step_pk": {
          "columns": [
            "user_id",
            "project_id",
            "step"
          ],
          "name": "dashboard_step_dismissals_user_id_project_id_step_pk"
        }
      },
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "data_refresh_claims": {
      "name": "data_refresh_claims",
      "columns": {
        "key": {
          "name": "key",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "token": {
          "name": "token",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "next_attempt_at": {
          "name": "next_attempt_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "data_refresh_claims_organization_id_organization_id_fk": {
          "name": "data_refresh_claims_organization_id_organization_id_fk",
          "tableFrom": "data_refresh_claims",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "keyword_metrics": {
      "name": "keyword_metrics",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "keyword": {
          "name": "keyword",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "location_code": {
          "name": "location_code",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "language_code": {
          "name": "language_code",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'en'"
        },
        "search_volume": {
          "name": "search_volume",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "cpc": {
          "name": "cpc",
          "type": "real",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "competition": {
          "name": "competition",
          "type": "real",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "keyword_difficulty": {
          "name": "keyword_difficulty",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "intent": {
          "name": "intent",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "monthly_searches": {
          "name": "monthly_searches",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "fetched_at": {
          "name": "fetched_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {
        "keyword_metrics_unique_project_keyword_location_language": {
          "name": "keyword_metrics_unique_project_keyword_location_language",
          "columns": [
            "project_id",
            "keyword",
            "location_code",
            "language_code"
          ],
          "isUnique": true
        },
        "keyword_metrics_lookup_idx": {
          "name": "keyword_metrics_lookup_idx",
          "columns": [
            "project_id",
            "keyword",
            "location_code",
            "language_code",
            "fetched_at"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "keyword_metrics_project_id_projects_id_fk": {
          "name": "keyword_metrics_project_id_projects_id_fk",
          "tableFrom": "keyword_metrics",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "organization_activation_state": {
      "name": "organization_activation_state",
      "columns": {
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "first_mcp_authorized_at": {
          "name": "first_mcp_authorized_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "first_mcp_tool_call_at": {
          "name": "first_mcp_tool_call_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "organization_activation_state_organization_id_organization_id_fk": {
          "name": "organization_activation_state_organization_id_organization_id_fk",
          "tableFrom": "organization_activation_state",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "project_activation_state": {
      "name": "project_activation_state",
      "columns": {
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "competitor_step_clicked_at": {
          "name": "competitor_step_clicked_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "keyword_step_clicked_at": {
          "name": "keyword_step_clicked_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "mcp_card_dismissed_at": {
          "name": "mcp_card_dismissed_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "ga4_card_dismissed_at": {
          "name": "ga4_card_dismissed_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "project_activation_state_project_id_projects_id_fk": {
          "name": "project_activation_state_project_id_projects_id_fk",
          "tableFrom": "project_activation_state",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "projects": {
      "name": "projects",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "domain": {
          "name": "domain",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "location_code": {
          "name": "location_code",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 2840
        },
        "language_code": {
          "name": "language_code",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'en'"
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        },
        "archived_at": {
          "name": "archived_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "ai_research_keywords": {
          "name": "ai_research_keywords",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "projects_one_default_per_organization_idx": {
          "name": "projects_one_default_per_organization_idx",
          "columns": [
            "organization_id"
          ],
          "isUnique": true,
          "where": "\"projects\".\"name\" = 'Default' AND \"projects\".\"domain\" IS NULL AND \"projects\".\"archived_at\" IS NULL"
        },
        "projects_organization_id_idx": {
          "name": "projects_organization_id_idx",
          "columns": [
            "organization_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "projects_organization_id_organization_id_fk": {
          "name": "projects_organization_id_organization_id_fk",
          "tableFrom": "projects",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "rank_check_runs": {
      "name": "rank_check_runs",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "config_id": {
          "name": "config_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'pending'"
        },
        "keywords_total": {
          "name": "keywords_total",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "keywords_checked": {
          "name": "keywords_checked",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "is_subset_run": {
          "name": "is_subset_run",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "error_message": {
          "name": "error_message",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "started_at": {
          "name": "started_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        },
        "completed_at": {
          "name": "completed_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "rank_check_runs_config_idx": {
          "name": "rank_check_runs_config_idx",
          "columns": [
            "config_id",
            "started_at"
          ],
          "isUnique": false
        },
        "rank_check_runs_project_idx": {
          "name": "rank_check_runs_project_idx",
          "columns": [
            "project_id",
            "started_at"
          ],
          "isUnique": false
        },
        "rank_check_runs_one_active_per_config_idx": {
          "name": "rank_check_runs_one_active_per_config_idx",
          "columns": [
            "config_id"
          ],
          "isUnique": true,
          "where": "\"rank_check_runs\".\"status\" IN ('pending', 'running')"
        }
      },
      "foreignKeys": {
        "rank_check_runs_config_id_rank_tracking_configs_id_fk": {
          "name": "rank_check_runs_config_id_rank_tracking_configs_id_fk",
          "tableFrom": "rank_check_runs",
          "tableTo": "rank_tracking_configs",
          "columnsFrom": [
            "config_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "rank_check_runs_project_id_projects_id_fk": {
          "name": "rank_check_runs_project_id_projects_id_fk",
          "tableFrom": "rank_check_runs",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "rank_snapshots": {
      "name": "rank_snapshots",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "run_id": {
          "name": "run_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "tracking_keyword_id": {
          "name": "tracking_keyword_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "keyword": {
          "name": "keyword",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "device": {
          "name": "device",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "position": {
          "name": "position",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "url": {
          "name": "url",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "serp_features": {
          "name": "serp_features",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "checked_at": {
          "name": "checked_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {
        "rank_snapshots_keyword_device_idx": {
          "name": "rank_snapshots_keyword_device_idx",
          "columns": [
            "tracking_keyword_id",
            "device",
            "checked_at"
          ],
          "isUnique": false
        },
        "rank_snapshots_run_keyword_device_idx": {
          "name": "rank_snapshots_run_keyword_device_idx",
          "columns": [
            "run_id",
            "tracking_keyword_id",
            "device"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "rank_snapshots_run_id_rank_check_runs_id_fk": {
          "name": "rank_snapshots_run_id_rank_check_runs_id_fk",
          "tableFrom": "rank_snapshots",
          "tableTo": "rank_check_runs",
          "columnsFrom": [
            "run_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "rank_tracking_configs": {
      "name": "rank_tracking_configs",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "domain": {
          "name": "domain",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "location_code": {
          "name": "location_code",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 2840
        },
        "language_code": {
          "name": "language_code",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'en'"
        },
        "devices": {
          "name": "devices",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'both'"
        },
        "serp_depth": {
          "name": "serp_depth",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "schedule_interval": {
          "name": "schedule_interval",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'weekly'"
        },
        "location_name": {
          "name": "location_name",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "is_active": {
          "name": "is_active",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "last_checked_at": {
          "name": "last_checked_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "next_check_at": {
          "name": "next_check_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "last_skip_reason": {
          "name": "last_skip_reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {
        "rank_tracking_configs_project_active_created_idx": {
          "name": "rank_tracking_configs_project_active_created_idx",
          "columns": [
            "project_id",
            "is_active",
            "created_at"
          ],
          "isUnique": false
        },
        "rank_tracking_configs_national_idx": {
          "name": "rank_tracking_configs_national_idx",
          "columns": [
            "project_id",
            "domain",
            "location_code"
          ],
          "isUnique": true,
          "where": "\"rank_tracking_configs\".\"location_name\" IS NULL"
        },
        "rank_tracking_configs_local_idx": {
          "name": "rank_tracking_configs_local_idx",
          "columns": [
            "project_id",
            "domain",
            "location_code",
            "location_name"
          ],
          "isUnique": true,
          "where": "\"rank_tracking_configs\".\"location_name\" IS NOT NULL"
        }
      },
      "foreignKeys": {
        "rank_tracking_configs_project_id_projects_id_fk": {
          "name": "rank_tracking_configs_project_id_projects_id_fk",
          "tableFrom": "rank_tracking_configs",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "rank_tracking_keywords": {
      "name": "rank_tracking_keywords",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "config_id": {
          "name": "config_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "keyword": {
          "name": "keyword",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "match_case": {
          "name": "match_case",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "search_volume": {
          "name": "search_volume",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "keyword_difficulty": {
          "name": "keyword_difficulty",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "cpc": {
          "name": "cpc",
          "type": "real",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "metrics_fetched_at": {
          "name": "metrics_fetched_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "pinned_at": {
          "name": "pinned_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {
        "rank_tracking_keywords_config_keyword_idx": {
          "name": "rank_tracking_keywords_config_keyword_idx",
          "columns": [
            "config_id",
            "keyword"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "rank_tracking_keywords_config_id_rank_tracking_configs_id_fk": {
          "name": "rank_tracking_keywords_config_id_rank_tracking_configs_id_fk",
          "tableFrom": "rank_tracking_keywords",
          "tableTo": "rank_tracking_configs",
          "columnsFrom": [
            "config_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "saved_keyword_tag_assignments": {
      "name": "saved_keyword_tag_assignments",
      "columns": {
        "saved_keyword_id": {
          "name": "saved_keyword_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "tag_id": {
          "name": "tag_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {
        "saved_keyword_tag_assignments_unique_idx": {
          "name": "saved_keyword_tag_assignments_unique_idx",
          "columns": [
            "saved_keyword_id",
            "tag_id"
          ],
          "isUnique": true
        },
        "saved_keyword_tag_assignments_tag_idx": {
          "name": "saved_keyword_tag_assignments_tag_idx",
          "columns": [
            "tag_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "saved_keyword_tag_assignments_saved_keyword_id_saved_keywords_id_fk": {
          "name": "saved_keyword_tag_assignments_saved_keyword_id_saved_keywords_id_fk",
          "tableFrom": "saved_keyword_tag_assignments",
          "tableTo": "saved_keywords",
          "columnsFrom": [
            "saved_keyword_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "saved_keyword_tag_assignments_tag_id_saved_keyword_tags_id_fk": {
          "name": "saved_keyword_tag_assignments_tag_id_saved_keyword_tags_id_fk",
          "tableFrom": "saved_keyword_tag_assignments",
          "tableTo": "saved_keyword_tags",
          "columnsFrom": [
            "tag_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "saved_keyword_tags": {
      "name": "saved_keyword_tags",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "normalized_name": {
          "name": "normalized_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "color": {
          "name": "color",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {
        "saved_keyword_tags_project_normalized_name_idx": {
          "name": "saved_keyword_tags_project_normalized_name_idx",
          "columns": [
            "project_id",
            "normalized_name"
          ],
          "isUnique": true
        },
        "saved_keyword_tags_project_name_idx": {
          "name": "saved_keyword_tags_project_name_idx",
          "columns": [
            "project_id",
            "name"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "saved_keyword_tags_project_id_projects_id_fk": {
          "name": "saved_keyword_tags_project_id_projects_id_fk",
          "tableFrom": "saved_keyword_tags",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "saved_keywords": {
      "name": "saved_keywords",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "keyword": {
          "name": "keyword",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "location_code": {
          "name": "location_code",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 2840
        },
        "language_code": {
          "name": "language_code",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'en'"
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {
        "saved_keywords_unique_project_keyword_location_language": {
          "name": "saved_keywords_unique_project_keyword_location_language",
          "columns": [
            "project_id",
            "keyword",
            "location_code",
            "language_code"
          ],
          "isUnique": true
        },
        "saved_keywords_project_created_idx": {
          "name": "saved_keywords_project_created_idx",
          "columns": [
            "project_id",
            "created_at"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "saved_keywords_project_id_projects_id_fk": {
          "name": "saved_keywords_project_id_projects_id_fk",
          "tableFrom": "saved_keywords",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "user_onboarding_answers": {
      "name": "user_onboarding_answers",
      "columns": {
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "interested_features": {
          "name": "interested_features",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'[]'"
        },
        "work_for": {
          "name": "work_for",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "client_website_count": {
          "name": "client_website_count",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "found_via": {
          "name": "found_via",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "mcp_setup_intent": {
          "name": "mcp_setup_intent",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "completed_at": {
          "name": "completed_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "gsc_nudge_dismissed_at": {
          "name": "gsc_nudge_dismissed_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {
        "user_onboarding_answers_organization_idx": {
          "name": "user_onboarding_answers_organization_idx",
          "columns": [
            "organization_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "user_onboarding_answers_user_id_user_id_fk": {
          "name": "user_onboarding_answers_user_id_user_id_fk",
          "tableFrom": "user_onboarding_answers",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "user_onboarding_answers_organization_id_organization_id_fk": {
          "name": "user_onboarding_answers_organization_id_organization_id_fk",
          "tableFrom": "user_onboarding_answers",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "project_competitors": {
      "name": "project_competitors",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "domain": {
          "name": "domain",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        },
        "updated_by": {
          "name": "updated_by",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "project_competitors_project_domain_idx": {
          "name": "project_competitors_project_domain_idx",
          "columns": [
            "project_id",
            "domain"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "project_competitors_project_id_projects_id_fk": {
          "name": "project_competitors_project_id_projects_id_fk",
          "tableFrom": "project_competitors",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "project_context_sections": {
      "name": "project_context_sections",
      "columns": {
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "key": {
          "name": "key",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        },
        "updated_by": {
          "name": "updated_by",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {},
      "foreignKeys": {
        "project_context_sections_project_id_projects_id_fk": {
          "name": "project_context_sections_project_id_projects_id_fk",
          "tableFrom": "project_context_sections",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {
        "project_context_sections_project_id_key_pk": {
          "columns": [
            "project_id",
            "key"
          ],
          "name": "project_context_sections_project_id_key_pk"
        }
      },
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "project_key_pages": {
      "name": "project_key_pages",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "url": {
          "name": "url",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "topic": {
          "name": "topic",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "notes": {
          "name": "notes",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        },
        "updated_by": {
          "name": "updated_by",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "project_key_pages_project_url_idx": {
          "name": "project_key_pages_project_url_idx",
          "columns": [
            "project_id",
            "url"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "project_key_pages_project_id_projects_id_fk": {
          "name": "project_key_pages_project_id_projects_id_fk",
          "tableFrom": "project_key_pages",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "project_research_log": {
      "name": "project_research_log",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "entry_date": {
          "name": "entry_date",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "summary": {
          "name": "summary",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_by": {
          "name": "created_by",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(strftime('%Y-%m-%dT%H:%M:%fZ','now'))"
        }
      },
      "indexes": {
        "project_research_log_project_date_idx": {
          "name": "project_research_log_project_date_idx",
          "columns": [
            "project_id",
            "entry_date"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "project_research_log_project_id_projects_id_fk": {
          "name": "project_research_log_project_id_projects_id_fk",
          "tableFrom": "project_research_log",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "reports": {
      "name": "reports",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "summary": {
          "name": "summary",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "html": {
          "name": "html",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "skill": {
          "name": "skill",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "template_id": {
          "name": "template_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_by": {
          "name": "created_by",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_by_user_id": {
          "name": "created_by_user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "size_bytes": {
          "name": "size_bytes",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "share_token": {
          "name": "share_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "shared_at": {
          "name": "shared_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(strftime('%Y-%m-%dT%H:%M:%fZ','now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(strftime('%Y-%m-%dT%H:%M:%fZ','now'))"
        }
      },
      "indexes": {
        "reports_project_updated_idx": {
          "name": "reports_project_updated_idx",
          "columns": [
            "project_id",
            "updated_at",
            "id",
            "size_bytes"
          ],
          "isUnique": false
        },
        "reports_share_token_idx": {
          "name": "reports_share_token_idx",
          "columns": [
            "share_token"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "reports_project_id_projects_id_fk": {
          "name": "reports_project_id_projects_id_fk",
          "tableFrom": "reports",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "report_templates": {
      "name": "report_templates",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "instructions": {
          "name": "instructions",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_by": {
          "name": "created_by",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_by_user_id": {
          "name": "created_by_user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(strftime('%Y-%m-%dT%H:%M:%fZ','now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(strftime('%Y-%m-%dT%H:%M:%fZ','now'))"
        }
      },
      "indexes": {
        "report_templates_project_name_idx": {
          "name": "report_templates_project_name_idx",
          "columns": [
            "project_id",
            "name"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "report_templates_project_id_projects_id_fk": {
          "name": "report_templates_project_id_projects_id_fk",
          "tableFrom": "report_templates",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "audit_issues": {
      "name": "audit_issues",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "audit_id": {
          "name": "audit_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "page_id": {
          "name": "page_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "page_url": {
          "name": "page_url",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "issue_type": {
          "name": "issue_type",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "severity": {
          "name": "severity",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'info'"
        },
        "details_json": {
          "name": "details_json",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "audit_issues_audit_type_idx": {
          "name": "audit_issues_audit_type_idx",
          "columns": [
            "audit_id",
            "issue_type"
          ],
          "isUnique": false
        },
        "audit_issues_page_id_idx": {
          "name": "audit_issues_page_id_idx",
          "columns": [
            "page_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "audit_issues_audit_id_audits_id_fk": {
          "name": "audit_issues_audit_id_audits_id_fk",
          "tableFrom": "audit_issues",
          "tableTo": "audits",
          "columnsFrom": [
            "audit_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "audit_issues_page_id_audit_pages_id_fk": {
          "name": "audit_issues_page_id_audit_pages_id_fk",
          "tableFrom": "audit_issues",
          "tableTo": "audit_pages",
          "columnsFrom": [
            "page_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "audit_lighthouse_results": {
      "name": "audit_lighthouse_results",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "audit_id": {
          "name": "audit_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "page_id": {
          "name": "page_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "strategy": {
          "name": "strategy",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "performance_score": {
          "name": "performance_score",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "accessibility_score": {
          "name": "accessibility_score",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "best_practices_score": {
          "name": "best_practices_score",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "seo_score": {
          "name": "seo_score",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "lcp_ms": {
          "name": "lcp_ms",
          "type": "real",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "cls": {
          "name": "cls",
          "type": "real",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "inp_ms": {
          "name": "inp_ms",
          "type": "real",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "ttfb_ms": {
          "name": "ttfb_ms",
          "type": "real",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "error_message": {
          "name": "error_message",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "r2_key": {
          "name": "r2_key",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "payload_size_bytes": {
          "name": "payload_size_bytes",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "audit_lighthouse_results_audit_id_idx": {
          "name": "audit_lighthouse_results_audit_id_idx",
          "columns": [
            "audit_id"
          ],
          "isUnique": false
        },
        "audit_lighthouse_results_page_id_idx": {
          "name": "audit_lighthouse_results_page_id_idx",
          "columns": [
            "page_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "audit_lighthouse_results_audit_id_audits_id_fk": {
          "name": "audit_lighthouse_results_audit_id_audits_id_fk",
          "tableFrom": "audit_lighthouse_results",
          "tableTo": "audits",
          "columnsFrom": [
            "audit_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "audit_lighthouse_results_page_id_audit_pages_id_fk": {
          "name": "audit_lighthouse_results_page_id_audit_pages_id_fk",
          "tableFrom": "audit_lighthouse_results",
          "tableTo": "audit_pages",
          "columnsFrom": [
            "page_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "audit_pages": {
      "name": "audit_pages",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "audit_id": {
          "name": "audit_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "url": {
          "name": "url",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "status_code": {
          "name": "status_code",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "redirect_url": {
          "name": "redirect_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "meta_description": {
          "name": "meta_description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "canonical_url": {
          "name": "canonical_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "robots_meta": {
          "name": "robots_meta",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "og_title": {
          "name": "og_title",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "og_description": {
          "name": "og_description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "og_image": {
          "name": "og_image",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "h1_count": {
          "name": "h1_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "h2_count": {
          "name": "h2_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "h3_count": {
          "name": "h3_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "h4_count": {
          "name": "h4_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "h5_count": {
          "name": "h5_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "h6_count": {
          "name": "h6_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "heading_order_json": {
          "name": "heading_order_json",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "word_count": {
          "name": "word_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "images_total": {
          "name": "images_total",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "images_missing_alt": {
          "name": "images_missing_alt",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "images_json": {
          "name": "images_json",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "internal_link_count": {
          "name": "internal_link_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "external_link_count": {
          "name": "external_link_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "has_structured_data": {
          "name": "has_structured_data",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "hreflang_tags_json": {
          "name": "hreflang_tags_json",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "is_indexable": {
          "name": "is_indexable",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "x_robots_tag": {
          "name": "x_robots_tag",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "header_canonical_url": {
          "name": "header_canonical_url",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "crawl_depth": {
          "name": "crawl_depth",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "in_sitemap": {
          "name": "in_sitemap",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "content_hash": {
          "name": "content_hash",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "fetch_class": {
          "name": "fetch_class",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'ok'"
        },
        "response_time_ms": {
          "name": "response_time_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "audit_pages_audit_url_idx": {
          "name": "audit_pages_audit_url_idx",
          "columns": [
            "audit_id",
            "url"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "audit_pages_audit_id_audits_id_fk": {
          "name": "audit_pages_audit_id_audits_id_fk",
          "tableFrom": "audit_pages",
          "tableTo": "audits",
          "columnsFrom": [
            "audit_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "audits": {
      "name": "audits",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "started_by_user_id": {
          "name": "started_by_user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "start_url": {
          "name": "start_url",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'running'"
        },
        "workflow_instance_id": {
          "name": "workflow_instance_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "config": {
          "name": "config",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'{}'"
        },
        "pages_crawled": {
          "name": "pages_crawled",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "pages_total": {
          "name": "pages_total",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "lighthouse_total": {
          "name": "lighthouse_total",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "lighthouse_completed": {
          "name": "lighthouse_completed",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "lighthouse_failed": {
          "name": "lighthouse_failed",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "current_phase": {
          "name": "current_phase",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": "'discovery'"
        },
        "error_code": {
          "name": "error_code",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "error_detail": {
          "name": "error_detail",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "failed_phase": {
          "name": "failed_phase",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "started_at": {
          "name": "started_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        },
        "completed_at": {
          "name": "completed_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "audits_project_id_idx": {
          "name": "audits_project_id_idx",
          "columns": [
            "project_id"
          ],
          "isUnique": false
        },
        "audits_started_by_user_id_idx": {
          "name": "audits_started_by_user_id_idx",
          "columns": [
            "started_by_user_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "audits_project_id_projects_id_fk": {
          "name": "audits_project_id_projects_id_fk",
          "tableFrom": "audits",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "sam_sessions": {
      "name": "sam_sessions",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'New chat'"
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        },
        "archived_at": {
          "name": "archived_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "sam_sessions_project_updated_idx": {
          "name": "sam_sessions_project_updated_idx",
          "columns": [
            "project_id",
            "updated_at"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "sam_sessions_project_id_projects_id_fk": {
          "name": "sam_sessions_project_id_projects_id_fk",
          "tableFrom": "sam_sessions",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "sam_sessions_user_id_user_id_fk": {
          "name": "sam_sessions_user_id_user_id_fk",
          "tableFrom": "sam_sessions",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "account": {
      "name": "account",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "account_id": {
          "name": "account_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "provider_id": {
          "name": "provider_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "access_token": {
          "name": "access_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "refresh_token": {
          "name": "refresh_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "id_token": {
          "name": "id_token",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "access_token_expires_at": {
          "name": "access_token_expires_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "refresh_token_expires_at": {
          "name": "refresh_token_expires_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "scope": {
          "name": "scope",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "password": {
          "name": "password",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "account_userId_idx": {
          "name": "account_userId_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        },
        "account_accountId_providerId_idx": {
          "name": "account_accountId_providerId_idx",
          "columns": [
            "account_id",
            "provider_id"
          ],
          "isUnique": false
        },
        "account_google_grant_owner_idx": {
          "name": "account_google_grant_owner_idx",
          "columns": [
            "user_id",
            "provider_id",
            "account_id"
          ],
          "isUnique": true,
          "where": "\"account\".\"provider_id\" in ('google-search-console', 'google-analytics')"
        }
      },
      "foreignKeys": {
        "account_user_id_user_id_fk": {
          "name": "account_user_id_user_id_fk",
          "tableFrom": "account",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "apikey": {
      "name": "apikey",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "config_id": {
          "name": "config_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'default'"
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "start": {
          "name": "start",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "prefix": {
          "name": "prefix",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "key": {
          "name": "key",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "reference_id": {
          "name": "reference_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "refill_interval": {
          "name": "refill_interval",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "refill_amount": {
          "name": "refill_amount",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "last_refill_at": {
          "name": "last_refill_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "enabled": {
          "name": "enabled",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": true
        },
        "rate_limit_enabled": {
          "name": "rate_limit_enabled",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": true
        },
        "rate_limit_time_window": {
          "name": "rate_limit_time_window",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 60000
        },
        "rate_limit_max": {
          "name": "rate_limit_max",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 120
        },
        "request_count": {
          "name": "request_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false,
          "default": 0
        },
        "remaining": {
          "name": "remaining",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "last_request": {
          "name": "last_request",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "expires_at": {
          "name": "expires_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "permissions": {
          "name": "permissions",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "metadata": {
          "name": "metadata",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "apikey_configId_idx": {
          "name": "apikey_configId_idx",
          "columns": [
            "config_id"
          ],
          "isUnique": false
        },
        "apikey_referenceId_idx": {
          "name": "apikey_referenceId_idx",
          "columns": [
            "reference_id"
          ],
          "isUnique": false
        },
        "apikey_key_idx": {
          "name": "apikey_key_idx",
          "columns": [
            "key"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "invitation": {
      "name": "invitation",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'pending'"
        },
        "expires_at": {
          "name": "expires_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
        },
        "inviter_id": {
          "name": "inviter_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "invitation_organizationId_idx": {
          "name": "invitation_organizationId_idx",
          "columns": [
            "organization_id"
          ],
          "isUnique": false
        },
        "invitation_email_idx": {
          "name": "invitation_email_idx",
          "columns": [
            "email"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "invitation_organization_id_organization_id_fk": {
          "name": "invitation_organization_id_organization_id_fk",
          "tableFrom": "invitation",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "invitation_inviter_id_user_id_fk": {
          "name": "invitation_inviter_id_user_id_fk",
          "tableFrom": "invitation",
          "tableTo": "user",
          "columnsFrom": [
            "inviter_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "member": {
      "name": "member",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'member'"
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "member_organizationId_idx": {
          "name": "member_organizationId_idx",
          "columns": [
            "organization_id"
          ],
          "isUnique": false
        },
        "member_userId_idx": {
          "name": "member_userId_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        },
        "member_organizationId_userId_uidx": {
          "name": "member_organizationId_userId_uidx",
          "columns": [
            "organization_id",
            "user_id"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "member_organization_id_organization_id_fk": {
          "name": "member_organization_id_organization_id_fk",
          "tableFrom": "member",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "member_user_id_user_id_fk": {
          "name": "member_user_id_user_id_fk",
          "tableFrom": "member",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "organization": {
      "name": "organization",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "slug": {
          "name": "slug",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "logo": {
          "name": "logo",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "metadata": {
          "name": "metadata",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "organization_slug_unique": {
          "name": "organization_slug_unique",
          "columns": [
            "slug"
          ],
          "isUnique": true
        },
        "organization_slug_uidx": {
          "name": "organization_slug_uidx",
          "columns": [
            "slug"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "session": {
      "name": "session",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "expires_at": {
          "name": "expires_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "token": {
          "name": "token",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "ip_address": {
          "name": "ip_address",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "user_agent": {
          "name": "user_agent",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "user_id": {
          "name": "user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "active_organization_id": {
          "name": "active_organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "session_token_unique": {
          "name": "session_token_unique",
          "columns": [
            "token"
          ],
          "isUnique": true
        },
        "session_userId_idx": {
          "name": "session_userId_idx",
          "columns": [
            "user_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "session_user_id_user_id_fk": {
          "name": "session_user_id_user_id_fk",
          "tableFrom": "session",
          "tableTo": "user",
          "columnsFrom": [
            "user_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "user": {
      "name": "user",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "email": {
          "name": "email",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "email_verified": {
          "name": "email_verified",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "image": {
          "name": "image",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
        },
        "analytics_opted_out": {
          "name": "analytics_opted_out",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "last_active_organization_id": {
          "name": "last_active_organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "user_email_unique": {
          "name": "user_email_unique",
          "columns": [
            "email"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "verification": {
      "name": "verification",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "identifier": {
          "name": "identifier",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "value": {
          "name": "value",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "expires_at": {
          "name": "expires_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(cast(unixepoch('subsecond') * 1000 as integer))"
        }
      },
      "indexes": {
        "verification_identifier_idx": {
          "name": "verification_identifier_idx",
          "columns": [
            "identifier"
          ],
          "isUnique": false
        },
        "verification_expiresAt_idx": {
          "name": "verification_expiresAt_idx",
          "columns": [
            "expires_at"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "billing_customer_status": {
      "name": "billing_customer_status",
      "columns": {
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "is_paying": {
          "name": "is_paying",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "paid_plan_id": {
          "name": "paid_plan_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "paid_plan_status": {
          "name": "paid_plan_status",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "customer_json": {
          "name": "customer_json",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "synced_at": {
          "name": "synced_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "billing_customer_status_organization_id_organization_id_fk": {
          "name": "billing_customer_status_organization_id_organization_id_fk",
          "tableFrom": "billing_customer_status",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "ga4_connections": {
      "name": "ga4_connections",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "property_id": {
          "name": "property_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "property_display_name": {
          "name": "property_display_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "property_time_zone": {
          "name": "property_time_zone",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "property_currency_code": {
          "name": "property_currency_code",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "connected_by_user_id": {
          "name": "connected_by_user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "ga4_account_id": {
          "name": "ga4_account_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "connected_account_email": {
          "name": "connected_account_email",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {
        "ga4_connections_project_idx": {
          "name": "ga4_connections_project_idx",
          "columns": [
            "project_id"
          ],
          "isUnique": true
        },
        "ga4_connections_organization_idx": {
          "name": "ga4_connections_organization_idx",
          "columns": [
            "organization_id"
          ],
          "isUnique": false
        },
        "ga4_connections_connector_idx": {
          "name": "ga4_connections_connector_idx",
          "columns": [
            "connected_by_user_id",
            "ga4_account_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "ga4_connections_project_id_projects_id_fk": {
          "name": "ga4_connections_project_id_projects_id_fk",
          "tableFrom": "ga4_connections",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "ga4_connections_organization_id_organization_id_fk": {
          "name": "ga4_connections_organization_id_organization_id_fk",
          "tableFrom": "ga4_connections",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "gsc_connections": {
      "name": "gsc_connections",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "organization_id": {
          "name": "organization_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "site_url": {
          "name": "site_url",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "connected_by_user_id": {
          "name": "connected_by_user_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "gsc_account_id": {
          "name": "gsc_account_id",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "connected_account_email": {
          "name": "connected_account_email",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(current_timestamp)"
        }
      },
      "indexes": {
        "gsc_connections_project_idx": {
          "name": "gsc_connections_project_idx",
          "columns": [
            "project_id"
          ],
          "isUnique": true
        },
        "gsc_connections_organization_idx": {
          "name": "gsc_connections_organization_idx",
          "columns": [
            "organization_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "gsc_connections_project_id_projects_id_fk": {
          "name": "gsc_connections_project_id_projects_id_fk",
          "tableFrom": "gsc_connections",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "gsc_connections_organization_id_organization_id_fk": {
          "name": "gsc_connections_organization_id_organization_id_fk",
          "tableFrom": "gsc_connections",
          "tableTo": "organization",
          "columnsFrom": [
            "organization_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "telemetry_state": {
      "name": "telemetry_state",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false,
          "default": 1
        },
        "install_id": {
          "name": "install_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "installed_at": {
          "name": "installed_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "last_heartbeat_at": {
          "name": "last_heartbeat_at",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "last_version": {
          "name": "last_version",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "mcp_tool_call_count": {
          "name": "mcp_tool_call_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "ai_matches": {
      "name": "ai_matches",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "observation_id": {
          "name": "observation_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "domain": {
          "name": "domain",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "own": {
          "name": "own",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "mentioned": {
          "name": "mentioned",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "cited": {
          "name": "cited",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "first_mention": {
          "name": "first_mention",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "ai_matches_observation_domain_idx": {
          "name": "ai_matches_observation_domain_idx",
          "columns": [
            "observation_id",
            "domain"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "ai_matches_observation_id_ai_observations_id_fk": {
          "name": "ai_matches_observation_id_ai_observations_id_fk",
          "tableFrom": "ai_matches",
          "tableTo": "ai_observations",
          "columnsFrom": [
            "observation_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "ai_observations": {
      "name": "ai_observations",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "run_id": {
          "name": "run_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "prompt_id": {
          "name": "prompt_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "engine": {
          "name": "engine",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "branded": {
          "name": "branded",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'pending'"
        },
        "collected_at": {
          "name": "collected_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "answer_markdown": {
          "name": "answer_markdown",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "error": {
          "name": "error",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "ai_observations_run_prompt_engine_idx": {
          "name": "ai_observations_run_prompt_engine_idx",
          "columns": [
            "run_id",
            "prompt_id",
            "engine"
          ],
          "isUnique": true
        },
        "ai_observations_prompt_idx": {
          "name": "ai_observations_prompt_idx",
          "columns": [
            "prompt_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "ai_observations_run_id_ai_runs_id_fk": {
          "name": "ai_observations_run_id_ai_runs_id_fk",
          "tableFrom": "ai_observations",
          "tableTo": "ai_runs",
          "columnsFrom": [
            "run_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "ai_observations_prompt_id_ai_prompts_id_fk": {
          "name": "ai_observations_prompt_id_ai_prompts_id_fk",
          "tableFrom": "ai_observations",
          "tableTo": "ai_prompts",
          "columnsFrom": [
            "prompt_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "ai_prompts": {
      "name": "ai_prompts",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "tracker_id": {
          "name": "tracker_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "topic": {
          "name": "topic",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "text": {
          "name": "text",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "paused": {
          "name": "paused",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "archived": {
          "name": "archived",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "ai_prompts_tracker_idx": {
          "name": "ai_prompts_tracker_idx",
          "columns": [
            "tracker_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "ai_prompts_tracker_id_ai_trackers_id_fk": {
          "name": "ai_prompts_tracker_id_ai_trackers_id_fk",
          "tableFrom": "ai_prompts",
          "tableTo": "ai_trackers",
          "columnsFrom": [
            "tracker_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "ai_runs": {
      "name": "ai_runs",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "tracker_id": {
          "name": "tracker_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "trigger": {
          "name": "trigger",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'queued'"
        },
        "location_code": {
          "name": "location_code",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "language_code": {
          "name": "language_code",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "completed_at": {
          "name": "completed_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        }
      },
      "indexes": {
        "ai_runs_project_created_idx": {
          "name": "ai_runs_project_created_idx",
          "columns": [
            "project_id",
            "created_at"
          ],
          "isUnique": false
        },
        "ai_runs_one_active_idx": {
          "name": "ai_runs_one_active_idx",
          "columns": [
            "tracker_id"
          ],
          "isUnique": true,
          "where": "\"ai_runs\".\"status\" IN ('queued', 'running')"
        }
      },
      "foreignKeys": {
        "ai_runs_tracker_id_ai_trackers_id_fk": {
          "name": "ai_runs_tracker_id_ai_trackers_id_fk",
          "tableFrom": "ai_runs",
          "tableTo": "ai_trackers",
          "columnsFrom": [
            "tracker_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "ai_runs_project_id_projects_id_fk": {
          "name": "ai_runs_project_id_projects_id_fk",
          "tableFrom": "ai_runs",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "ai_sources": {
      "name": "ai_sources",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "observation_id": {
          "name": "observation_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "url": {
          "name": "url",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "domain": {
          "name": "domain",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "position": {
          "name": "position",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "ai_sources_observation_idx": {
          "name": "ai_sources_observation_idx",
          "columns": [
            "observation_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "ai_sources_observation_id_ai_observations_id_fk": {
          "name": "ai_sources_observation_id_ai_observations_id_fk",
          "tableFrom": "ai_sources",
          "tableTo": "ai_observations",
          "columnsFrom": [
            "observation_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "ai_trackers": {
      "name": "ai_trackers",
      "columns": {
        "id": {
          "name": "id",
          "type": "text",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": false
        },
        "project_id": {
          "name": "project_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "enabled": {
          "name": "enabled",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "chatgpt": {
          "name": "chatgpt",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": true
        },
        "gemini": {
          "name": "gemini",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "google_ai_overview": {
          "name": "google_ai_overview",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": false
        },
        "location_code": {
          "name": "location_code",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 2840
        },
        "language_code": {
          "name": "language_code",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'en'"
        },
        "schedule_interval": {
          "name": "schedule_interval",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'weekly'"
        },
        "next_check_at": {
          "name": "next_check_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "last_skip_reason": {
          "name": "last_skip_reason",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        }
      },
      "indexes": {
        "ai_trackers_project_idx": {
          "name": "ai_trackers_project_idx",
          "columns": [
            "project_id"
          ],
          "isUnique": true
        },
        "ai_trackers_due_idx": {
          "name": "ai_trackers_due_idx",
          "columns": [
            "enabled",
            "next_check_at"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "ai_trackers_project_id_projects_id_fk": {
          "name": "ai_trackers_project_id_projects_id_fk",
          "tableFrom": "ai_trackers",
          "tableTo": "projects",
          "columnsFrom": [
            "project_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    }
  },
  "views": {},
  "enums": {},
  "_meta": {
    "schemas": {},
    "tables": {},
    "columns": {}
  },
  "internal": {
    "indexes": {}
  }
}