public.knowledge_file¶
列¶
| 名称 | 类型 | 默认值 | 可空 | 子表 | 父表 | 注释 |
|---|---|---|---|---|---|---|
| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | |||
| createdById | uuid | true | public.user | 作者。作者被删除后为 NULL | ||
| description | text | true | ||||
| fileSizeBytes | integer | false | 上传文件的大小(字节) | |||
| id | varchar(16) | false | 应用程序生成的 n8n nano ID | |||
| knowledgeCollectionId | varchar(16) | false | public.knowledge_collection | 包含此上传文件的集合 | ||
| mimeType | varchar(255) | false | ||||
| name | 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_knowledge_file_storedAt | CHECK | CHECK ((("storedAt")::text = ANY ((ARRAY['db'::character varying, 'fs'::character varying, 's3'::character varying, 'az'::character varying])::text[]))) |
| FK_1a602cf1fc75e3dc7184f1dc67d | FOREIGN KEY | FOREIGN KEY ("knowledgeCollectionId") REFERENCES knowledge_collection(id) ON DELETE CASCADE |
| FK_ba192ee6fdf188abf6684dea64f | FOREIGN KEY | FOREIGN KEY ("createdById") REFERENCES "user"(id) ON DELETE SET NULL |
| PK_de80a3d739f042ff20bf79c3f5a | PRIMARY KEY | PRIMARY KEY (id) |
| knowledge_file_createdAt_not_null | n | NOT NULL "createdAt" |
| knowledge_file_fileSizeBytes_not_null | n | NOT NULL "fileSizeBytes" |
| knowledge_file_id_not_null | n | NOT NULL id |
| knowledge_file_knowledgeCollectionId_not_null | n | NOT NULL "knowledgeCollectionId" |
| knowledge_file_mimeType_not_null | n | NOT NULL "mimeType" |
| knowledge_file_name_not_null | n | NOT NULL name |
| knowledge_file_storageKey_not_null | n | NOT NULL "storageKey" |
| knowledge_file_storedAt_not_null | n | NOT NULL "storedAt" |
| knowledge_file_updatedAt_not_null | n | NOT NULL "updatedAt" |
索引¶
| 名称 | 定义 |
|---|---|
| IDX_6a7161d655f5fd4eb2d4419b3d | CREATE UNIQUE INDEX "IDX_6a7161d655f5fd4eb2d4419b3d" ON public.knowledge_file USING btree ("knowledgeCollectionId", name) |
| IDX_a87d3bb786f06c0a677dc11fb5 | CREATE INDEX "IDX_a87d3bb786f06c0a677dc11fb5" ON public.knowledge_file USING btree ("knowledgeCollectionId", "createdAt") |
| PK_de80a3d739f042ff20bf79c3f5a | CREATE UNIQUE INDEX "PK_de80a3d739f042ff20bf79c3f5a" ON public.knowledge_file USING btree (id) |
关系¶
erDiagram
"public.knowledge_file" }o--o| "public.user" : "FOREIGN KEY (#quot;createdById#quot;) REFERENCES #quot;user#quot;(id) ON DELETE SET NULL"
"public.knowledge_file" }o--|| "public.knowledge_collection" : "FOREIGN KEY (#quot;knowledgeCollectionId#quot;) REFERENCES knowledge_collection(id) ON DELETE CASCADE"
"public.knowledge_file" {
timestamp_3__with_time_zone createdAt
uuid createdById FK
text description
integer fileSizeBytes
varchar_16_ id
varchar_16_ knowledgeCollectionId FK
varchar_255_ mimeType
varchar_255_ name
text storageKey
varchar_2_ storedAt
timestamp_3__with_time_zone updatedAt
}
"public.user" {
timestamp_3__with_time_zone createdAt
boolean disabled
varchar_255_ email
varchar_32_ firstName
uuid id
varchar_16_ kind
date lastActiveAt
varchar_32_ lastName
boolean mfaEnabled
text mfaRecoveryCodes
text mfaSecret
varchar_255_ password
json personalizationAnswers
varchar_128_ roleSlug FK
json settings
timestamp_3__with_time_zone updatedAt
}
"public.knowledge_collection" {
varchar_36_ agentId FK
timestamp_3__with_time_zone createdAt
uuid createdById FK
varchar_512_ description
varchar_16_ id
boolean isGlobal
varchar_16_ kind
varchar_128_ name
varchar_36_ projectId FK
varchar_24_ slug
timestamp_3__with_time_zone updatedAt
}由 tbls 生成
本页原文 Markdown:在 AtomGit 查看·内容源自开源项目 n8/n8n