跳转至

public.agent_files

列

名称 类型 默认值 可空 子表 父表 注释
agentId varchar(36) false public.agents 拥有此上传文件的 Agent
binaryDataId text true 不透明的 BinaryDataService 引用(带模式前缀,例如 "filesystem-v2:\<uuid>");不是对 binary_data 的 FK,binary_data 仅在数据库存储模式下才有行
createdAt timestamp(3) with time zone CURRENT_TIMESTAMP(3) false
fileName varchar(255) false
fileSizeBytes integer false 上传文件的大小(字节)
id varchar(16) false 应用生成的 n8n nano ID
mimeType varchar(255) false
storageKey text false 用于在 storedAt 中寻址字节的键:对于 db 为 binary_data.fileId,否则为字节存储键。不是外键
storedAt varchar(2) 'db'::character varying false 文件字节存放的位置:'db'(binary_data 表),或 blob 存储后端('fs'、's3'、'az')
updatedAt timestamp(3) with time zone CURRENT_TIMESTAMP(3) false

约束

名称 类型 定义
CHK_agent_files_storedAt CHECK CHECK ((("storedAt")::text = ANY ((ARRAY['db'::character varying, 'fs'::character varying, 's3'::character varying, 'az'::character varying])::text[])))
FK_aca4514cb500494b64356c2e164 FOREIGN KEY FOREIGN KEY ("agentId") REFERENCES agents(id) ON DELETE CASCADE
PK_692920e59217af7d124cd95106f PRIMARY KEY PRIMARY KEY (id)
agent_files_agentId_not_null n NOT NULL "agentId"
agent_files_createdAt_not_null n NOT NULL "createdAt"
agent_files_fileName_not_null n NOT NULL "fileName"
agent_files_fileSizeBytes_not_null n NOT NULL "fileSizeBytes"
agent_files_id_not_null n NOT NULL id
agent_files_mimeType_not_null n NOT NULL "mimeType"
agent_files_storageKey_not_null n NOT NULL "storageKey"
agent_files_storedAt_not_null n NOT NULL "storedAt"
agent_files_updatedAt_not_null n NOT NULL "updatedAt"

索引

名称 定义
IDX_45dafc48fe2ce95eac30fc8ffd CREATE INDEX "IDX_45dafc48fe2ce95eac30fc8ffd" ON public.agent_files USING btree ("agentId", "createdAt")
IDX_agent_files_agentId_binaryDataId CREATE UNIQUE INDEX "IDX_agent_files_agentId_binaryDataId" ON public.agent_files USING btree ("agentId", "binaryDataId")
IDX_agent_files_agentId_fileName CREATE UNIQUE INDEX "IDX_agent_files_agentId_fileName" ON public.agent_files USING btree ("agentId", "fileName")
PK_692920e59217af7d124cd95106f CREATE UNIQUE INDEX "PK_692920e59217af7d124cd95106f" ON public.agent_files USING btree (id)

关系

erDiagram

"public.agent_files" }o--|| "public.agents" : "FOREIGN KEY (#quot;agentId#quot;) REFERENCES agents(id) ON DELETE CASCADE"

"public.agent_files" {
  varchar_36_ agentId FK
  text binaryDataId
  timestamp_3__with_time_zone createdAt
  varchar_255_ fileName
  integer fileSizeBytes
  varchar_16_ id
  varchar_255_ mimeType
  text storageKey
  varchar_2_ storedAt
  timestamp_3__with_time_zone updatedAt
}
"public.agents" {
  varchar_36_ activeVersionId FK
  varchar_36_ approvalWorkflowId FK
  boolean availableInMCP
  timestamp_3__with_time_zone createdAt
  varchar_36_ id
  uuid identityId FK
  json integrations
  boolean isArchived
  varchar_128_ name
  varchar_36_ parentFolderId FK
  varchar_255_ projectId FK
  integer publicationRevision
  integer revision
  json schema
  varchar_16_ scope
  timestamp_3__with_time_zone setupCompletedAt
  json skills
  json tools
  timestamp_3__with_time_zone updatedAt
  varchar_36_ versionId
}

由 tbls 生成

本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 n8/n8n