mirror of
https://github.com/n8n-io/n8n.git
synced 2026-09-21 04:37:50 +08:00
refactor(core): Replace agent knowledge base binary data storage with blob storage (no-changelog) (#34985)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,7 +16,7 @@ Auto-generated from the PostgreSQL migrations in @n8n/db. Do not edit by hand.
|
||||
| [public.agent_eval_run](public.agent_eval_run.md) | 14 | | BASE TABLE |
|
||||
| [public.agent_execution](public.agent_execution.md) | 19 | | BASE TABLE |
|
||||
| [public.agent_execution_threads](public.agent_execution_threads.md) | 17 | | BASE TABLE |
|
||||
| [public.agent_files](public.agent_files.md) | 8 | | BASE TABLE |
|
||||
| [public.agent_files](public.agent_files.md) | 10 | | BASE TABLE |
|
||||
| [public.agent_history](public.agent_history.md) | 9 | | BASE TABLE |
|
||||
| [public.agent_task_definition](public.agent_task_definition.md) | 7 | | BASE TABLE |
|
||||
| [public.agent_task_run_lock](public.agent_task_run_lock.md) | 6 | | BASE TABLE |
|
||||
@@ -447,6 +447,8 @@ erDiagram
|
||||
integer fileSizeBytes
|
||||
varchar_16_ id
|
||||
varchar_255_ mimeType
|
||||
text storageKey
|
||||
varchar_2_ storedAt
|
||||
timestamp_3__with_time_zone updatedAt
|
||||
}
|
||||
"public.agent_history" {
|
||||
|
||||
@@ -5,27 +5,31 @@
|
||||
| Name | Type | Default | Nullable | Children | Parents | Comment |
|
||||
| ---- | ---- | ------- | -------- | -------- | ------- | ------- |
|
||||
| agentId | varchar(36) | | false | | [public.agents](public.agents.md) | Agent that owns this uploaded file |
|
||||
| binaryDataId | text | | false | | | Opaque BinaryDataService reference (mode-prefixed, e.g. "filesystem-v2:\<uuid\>"); not an FK to binary_data, which only has rows in DB storage mode |
|
||||
| binaryDataId | text | | true | | | Opaque BinaryDataService reference (mode-prefixed, e.g. "filesystem-v2:\<uuid\>"); not an FK to binary_data, which only has rows in DB storage mode |
|
||||
| createdAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | |
|
||||
| fileName | varchar(255) | | false | | | |
|
||||
| fileSizeBytes | integer | | false | | | Uploaded file size in bytes |
|
||||
| id | varchar(16) | | false | | | Application-generated n8n nano ID |
|
||||
| mimeType | varchar(255) | | false | | | |
|
||||
| storageKey | text | | false | | | Key addressing the bytes within storedAt: a binary_data.fileId for db, a byte-store key otherwise. Not a foreign key |
|
||||
| storedAt | varchar(2) | 'db'::character varying | false | | | Where the file bytes live: 'db' (binary_data table), or a blob-storage backend ('fs', 's3', 'az') |
|
||||
| updatedAt | timestamp(3) with time zone | CURRENT_TIMESTAMP(3) | false | | | |
|
||||
|
||||
## Constraints
|
||||
|
||||
| Name | Type | Definition |
|
||||
| ---- | ---- | ---------- |
|
||||
| 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_binaryDataId_not_null | n | NOT NULL "binaryDataId" |
|
||||
| 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" |
|
||||
|
||||
## Indexes
|
||||
@@ -52,6 +56,8 @@ erDiagram
|
||||
integer fileSizeBytes
|
||||
varchar_16_ id
|
||||
varchar_255_ mimeType
|
||||
text storageKey
|
||||
varchar_2_ storedAt
|
||||
timestamp_3__with_time_zone updatedAt
|
||||
}
|
||||
"public.agents" {
|
||||
|
||||
@@ -145,6 +145,8 @@ erDiagram
|
||||
integer fileSizeBytes
|
||||
varchar_16_ id
|
||||
varchar_255_ mimeType
|
||||
text storageKey
|
||||
varchar_2_ storedAt
|
||||
timestamp_3__with_time_zone updatedAt
|
||||
}
|
||||
"public.agent_task_definition" {
|
||||
|
||||
Reference in New Issue
Block a user