{
  "version": "6",
  "dialect": "sqlite",
  "id": "4249a1ff-27fa-4b85-a8e5-beb3ce8d3a45",
  "prevId": "00000000-0000-0000-0000-000000000000",
  "tables": {
    "attachment_remote_refs": {
      "name": "attachment_remote_refs",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "attachment_id": {
          "name": "attachment_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "provider_id": {
          "name": "provider_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "transport_kind": {
          "name": "transport_kind",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "remote_ref": {
          "name": "remote_ref",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "mime_type": {
          "name": "mime_type",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "expires_at": {
          "name": "expires_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "last_used_at": {
          "name": "last_used_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {
        "attachment_remote_refs_attachment_provider_transport_unique": {
          "name": "attachment_remote_refs_attachment_provider_transport_unique",
          "columns": [
            "attachment_id",
            "provider_id",
            "transport_kind"
          ],
          "isUnique": true
        },
        "attachment_remote_refs_provider_id_idx": {
          "name": "attachment_remote_refs_provider_id_idx",
          "columns": [
            "provider_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "attachment_remote_refs_attachment_id_attachments_id_fk": {
          "name": "attachment_remote_refs_attachment_id_attachments_id_fk",
          "tableFrom": "attachment_remote_refs",
          "tableTo": "attachments",
          "columnsFrom": [
            "attachment_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "attachment_remote_refs_provider_id_providers_id_fk": {
          "name": "attachment_remote_refs_provider_id_providers_id_fk",
          "tableFrom": "attachment_remote_refs",
          "tableTo": "providers",
          "columnsFrom": [
            "provider_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "attachments": {
      "name": "attachments",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "hash": {
          "name": "hash",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "type": {
          "name": "type",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "original_name": {
          "name": "original_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "origin_path": {
          "name": "origin_path",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "mime_type": {
          "name": "mime_type",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "size": {
          "name": "size",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {
        "attachments_hash_unique": {
          "name": "attachments_hash_unique",
          "columns": [
            "hash"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "built_in_tool_logs": {
      "name": "built_in_tool_logs",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "tool_id": {
          "name": "tool_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "tool_call_id": {
          "name": "tool_call_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "session_id": {
          "name": "session_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "message_id": {
          "name": "message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "iteration": {
          "name": "iteration",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 1
        },
        "input": {
          "name": "input",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "output": {
          "name": "output",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'pending'"
        },
        "approval_state": {
          "name": "approval_state",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'none'"
        },
        "approval_summary": {
          "name": "approval_summary",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "duration_ms": {
          "name": "duration_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "error_message": {
          "name": "error_message",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "built_in_tool_logs_session_id_sessions_id_fk": {
          "name": "built_in_tool_logs_session_id_sessions_id_fk",
          "tableFrom": "built_in_tool_logs",
          "tableTo": "sessions",
          "columnsFrom": [
            "session_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "built_in_tool_logs_message_id_messages_id_fk": {
          "name": "built_in_tool_logs_message_id_messages_id_fk",
          "tableFrom": "built_in_tool_logs",
          "tableTo": "messages",
          "columnsFrom": [
            "message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "built_in_tools": {
      "name": "built_in_tools",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "tool_id": {
          "name": "tool_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "display_name": {
          "name": "display_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "description": {
          "name": "description",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "enabled": {
          "name": "enabled",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 1
        },
        "risk_level": {
          "name": "risk_level",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'medium'"
        },
        "config_json": {
          "name": "config_json",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "last_used_at": {
          "name": "last_used_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {
        "built_in_tools_tool_id_unique": {
          "name": "built_in_tools_tool_id_unique",
          "columns": [
            "tool_id"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "llm_metadata": {
      "name": "llm_metadata",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "model_id": {
          "name": "model_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "attachment": {
          "name": "attachment",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "modalities": {
          "name": "modalities",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "open_weights": {
          "name": "open_weights",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "reasoning": {
          "name": "reasoning",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "release_date": {
          "name": "release_date",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "temperature": {
          "name": "temperature",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 1
        },
        "tool_call": {
          "name": "tool_call",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "knowledge": {
          "name": "knowledge",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "limit": {
          "name": "limit",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {
        "llm_metadata_model_id_unique": {
          "name": "llm_metadata_model_id_unique",
          "columns": [
            "model_id"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "mcp_servers": {
      "name": "mcp_servers",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "transport_type": {
          "name": "transport_type",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "command": {
          "name": "command",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "args": {
          "name": "args",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "env": {
          "name": "env",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "cwd": {
          "name": "cwd",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "url": {
          "name": "url",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "headers": {
          "name": "headers",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "enabled": {
          "name": "enabled",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 1
        },
        "tool_timeout": {
          "name": "tool_timeout",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 30000
        },
        "version": {
          "name": "version",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "last_error": {
          "name": "last_error",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "last_connected_at": {
          "name": "last_connected_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {
        "mcp_servers_name_unique": {
          "name": "mcp_servers_name_unique",
          "columns": [
            "name"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "mcp_tool_logs": {
      "name": "mcp_tool_logs",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "server_id": {
          "name": "server_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "tool_name": {
          "name": "tool_name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "tool_call_id": {
          "name": "tool_call_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "session_id": {
          "name": "session_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "message_id": {
          "name": "message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "iteration": {
          "name": "iteration",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 1
        },
        "input": {
          "name": "input",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "output": {
          "name": "output",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'pending'"
        },
        "duration_ms": {
          "name": "duration_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "error_message": {
          "name": "error_message",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "mcp_tool_logs_server_id_mcp_servers_id_fk": {
          "name": "mcp_tool_logs_server_id_mcp_servers_id_fk",
          "tableFrom": "mcp_tool_logs",
          "tableTo": "mcp_servers",
          "columnsFrom": [
            "server_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "mcp_tool_logs_session_id_sessions_id_fk": {
          "name": "mcp_tool_logs_session_id_sessions_id_fk",
          "tableFrom": "mcp_tool_logs",
          "tableTo": "sessions",
          "columnsFrom": [
            "session_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "mcp_tool_logs_message_id_messages_id_fk": {
          "name": "mcp_tool_logs_message_id_messages_id_fk",
          "tableFrom": "mcp_tool_logs",
          "tableTo": "messages",
          "columnsFrom": [
            "message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "mcp_tools": {
      "name": "mcp_tools",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "server_id": {
          "name": "server_id",
          "type": "integer",
          "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": false,
          "autoincrement": false
        },
        "input_schema": {
          "name": "input_schema",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "enabled": {
          "name": "enabled",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 1
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "mcp_tools_server_id_mcp_servers_id_fk": {
          "name": "mcp_tools_server_id_mcp_servers_id_fk",
          "tableFrom": "mcp_tools",
          "tableTo": "mcp_servers",
          "columnsFrom": [
            "server_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "message_attachments": {
      "name": "message_attachments",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "message_id": {
          "name": "message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "attachment_id": {
          "name": "attachment_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "sort_order": {
          "name": "sort_order",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "origin_path": {
          "name": "origin_path",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "message_attachments_message_id_messages_id_fk": {
          "name": "message_attachments_message_id_messages_id_fk",
          "tableFrom": "message_attachments",
          "tableTo": "messages",
          "columnsFrom": [
            "message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "message_attachments_attachment_id_attachments_id_fk": {
          "name": "message_attachments_attachment_id_attachments_id_fk",
          "tableFrom": "message_attachments",
          "tableTo": "attachments",
          "columnsFrom": [
            "attachment_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "messages": {
      "name": "messages",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "session_id": {
          "name": "session_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "role": {
          "name": "role",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "content": {
          "name": "content",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "tool_log_id": {
          "name": "tool_log_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "tool_log_kind": {
          "name": "tool_log_kind",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "messages_session_id_sessions_id_fk": {
          "name": "messages_session_id_sessions_id_fk",
          "tableFrom": "messages",
          "tableTo": "sessions",
          "columnsFrom": [
            "session_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "models": {
      "name": "models",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "provider_id": {
          "name": "provider_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "model_id": {
          "name": "model_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "is_default": {
          "name": "is_default",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "last_used_at": {
          "name": "last_used_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "attachment": {
          "name": "attachment",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "modalities": {
          "name": "modalities",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "open_weights": {
          "name": "open_weights",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "reasoning": {
          "name": "reasoning",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "release_date": {
          "name": "release_date",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "temperature": {
          "name": "temperature",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 1
        },
        "tool_call": {
          "name": "tool_call",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "knowledge": {
          "name": "knowledge",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "context_limit": {
          "name": "context_limit",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "output_limit": {
          "name": "output_limit",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "is_custom_metadata": {
          "name": "is_custom_metadata",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {},
      "foreignKeys": {
        "models_provider_id_providers_id_fk": {
          "name": "models_provider_id_providers_id_fk",
          "tableFrom": "models",
          "tableTo": "providers",
          "columnsFrom": [
            "provider_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "providers": {
      "name": "providers",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "name": {
          "name": "name",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "driver": {
          "name": "driver",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "api_endpoint": {
          "name": "api_endpoint",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "api_key": {
          "name": "api_key",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "config_json": {
          "name": "config_json",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "logo": {
          "name": "logo",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "enabled": {
          "name": "enabled",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 1
        },
        "is_builtin": {
          "name": "is_builtin",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {},
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "quick_search_click_stats": {
      "name": "quick_search_click_stats",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "query_norm": {
          "name": "query_norm",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "path_norm": {
          "name": "path_norm",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "click_count": {
          "name": "click_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {
        "quick_search_click_stats_query_path_unique": {
          "name": "quick_search_click_stats_query_path_unique",
          "columns": [
            "query_norm",
            "path_norm"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "session_turn_attempts": {
      "name": "session_turn_attempts",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "turn_id": {
          "name": "turn_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "attempt_index": {
          "name": "attempt_index",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "max_retries": {
          "name": "max_retries",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'pending'"
        },
        "checkpoint_json": {
          "name": "checkpoint_json",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "delivery_manifest_json": {
          "name": "delivery_manifest_json",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "error_message": {
          "name": "error_message",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "duration_ms": {
          "name": "duration_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "started_at": {
          "name": "started_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "finished_at": {
          "name": "finished_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {
        "session_turn_attempts_turn_id_idx": {
          "name": "session_turn_attempts_turn_id_idx",
          "columns": [
            "turn_id"
          ],
          "isUnique": false
        },
        "session_turn_attempts_turn_attempt_unique": {
          "name": "session_turn_attempts_turn_attempt_unique",
          "columns": [
            "turn_id",
            "attempt_index"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {
        "session_turn_attempts_turn_id_session_turns_id_fk": {
          "name": "session_turn_attempts_turn_id_session_turns_id_fk",
          "tableFrom": "session_turn_attempts",
          "tableTo": "session_turns",
          "columnsFrom": [
            "turn_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "session_turns": {
      "name": "session_turns",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "session_id": {
          "name": "session_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "model_id": {
          "name": "model_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "task_id": {
          "name": "task_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "execution_mode": {
          "name": "execution_mode",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'foreground'"
        },
        "prompt_snapshot_json": {
          "name": "prompt_snapshot_json",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "prompt_message_id": {
          "name": "prompt_message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "response_message_id": {
          "name": "response_message_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "status": {
          "name": "status",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "'pending'"
        },
        "error_message": {
          "name": "error_message",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "tokens_used": {
          "name": "tokens_used",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "duration_ms": {
          "name": "duration_ms",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {
        "session_turns_session_id_idx": {
          "name": "session_turns_session_id_idx",
          "columns": [
            "session_id"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "session_turns_session_id_sessions_id_fk": {
          "name": "session_turns_session_id_sessions_id_fk",
          "tableFrom": "session_turns",
          "tableTo": "sessions",
          "columnsFrom": [
            "session_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "session_turns_model_id_models_id_fk": {
          "name": "session_turns_model_id_models_id_fk",
          "tableFrom": "session_turns",
          "tableTo": "models",
          "columnsFrom": [
            "model_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "cascade",
          "onUpdate": "no action"
        },
        "session_turns_prompt_message_id_messages_id_fk": {
          "name": "session_turns_prompt_message_id_messages_id_fk",
          "tableFrom": "session_turns",
          "tableTo": "messages",
          "columnsFrom": [
            "prompt_message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        },
        "session_turns_response_message_id_messages_id_fk": {
          "name": "session_turns_response_message_id_messages_id_fk",
          "tableFrom": "session_turns",
          "tableTo": "messages",
          "columnsFrom": [
            "response_message_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "sessions": {
      "name": "sessions",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "session_id": {
          "name": "session_id",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "title": {
          "name": "title",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "model": {
          "name": "model",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "provider_id": {
          "name": "provider_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "last_message_preview": {
          "name": "last_message_preview",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "last_message_at": {
          "name": "last_message_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "message_count": {
          "name": "message_count",
          "type": "integer",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": 0
        },
        "status_badge_dismissed_turn_id": {
          "name": "status_badge_dismissed_turn_id",
          "type": "integer",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "pinned_at": {
          "name": "pinned_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "archived_at": {
          "name": "archived_at",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {
        "sessions_session_id_unique": {
          "name": "sessions_session_id_unique",
          "columns": [
            "session_id"
          ],
          "isUnique": true
        },
        "sessions_provider_id_idx": {
          "name": "sessions_provider_id_idx",
          "columns": [
            "provider_id"
          ],
          "isUnique": false
        },
        "sessions_archived_at_idx": {
          "name": "sessions_archived_at_idx",
          "columns": [
            "archived_at"
          ],
          "isUnique": false
        },
        "sessions_pinned_at_idx": {
          "name": "sessions_pinned_at_idx",
          "columns": [
            "pinned_at"
          ],
          "isUnique": false
        },
        "sessions_last_message_at_idx": {
          "name": "sessions_last_message_at_idx",
          "columns": [
            "last_message_at"
          ],
          "isUnique": false
        }
      },
      "foreignKeys": {
        "sessions_provider_id_providers_id_fk": {
          "name": "sessions_provider_id_providers_id_fk",
          "tableFrom": "sessions",
          "tableTo": "providers",
          "columnsFrom": [
            "provider_id"
          ],
          "columnsTo": [
            "id"
          ],
          "onDelete": "set null",
          "onUpdate": "no action"
        }
      },
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "settings": {
      "name": "settings",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "key": {
          "name": "key",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "value": {
          "name": "value",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {
        "settings_key_unique": {
          "name": "settings_key_unique",
          "columns": [
            "key"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "statistics": {
      "name": "statistics",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "key": {
          "name": "key",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "value": {
          "name": "value",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {
        "statistics_key_unique": {
          "name": "statistics_key_unique",
          "columns": [
            "key"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    },
    "touchai_meta": {
      "name": "touchai_meta",
      "columns": {
        "id": {
          "name": "id",
          "type": "integer",
          "primaryKey": true,
          "notNull": true,
          "autoincrement": true
        },
        "key": {
          "name": "key",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false
        },
        "value": {
          "name": "value",
          "type": "text",
          "primaryKey": false,
          "notNull": false,
          "autoincrement": false
        },
        "created_at": {
          "name": "created_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        },
        "updated_at": {
          "name": "updated_at",
          "type": "text",
          "primaryKey": false,
          "notNull": true,
          "autoincrement": false,
          "default": "(datetime('now'))"
        }
      },
      "indexes": {
        "touchai_meta_key_unique": {
          "name": "touchai_meta_key_unique",
          "columns": [
            "key"
          ],
          "isUnique": true
        }
      },
      "foreignKeys": {},
      "compositePrimaryKeys": {},
      "uniqueConstraints": {},
      "checkConstraints": {}
    }
  },
  "views": {},
  "enums": {},
  "_meta": {
    "schemas": {},
    "tables": {},
    "columns": {}
  },
  "internal": {
    "indexes": {}
  }
}
